Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[mininet-discuss] Node names in xterm, multiple Mininet CLIs

Bob Lantz rlantz at cs.stanford.edu
Thu Mar 5 15:27:34 PST 2015


There are lots of interesting things you can do.

You might also want to look at examples/consoles.py.

> On Mar 5, 2015, at 2:26 PM, Tomer Godinger <tomergod at post.bgu.ac.il> wrote:
> 
> Thanks, I'll give it a try. =)
> 
> 
> On Thu, Mar 5, 2015 at 8:30 PM, Beshay, Joseph <jdb109120 at utdallas.edu <mailto:jdb109120 at utdallas.edu>> wrote:
> With regards to running a script inside one of the hosts or a separate xterm when scripting my experiments in python, I usually do it this way:
> 
>  
> 
> h1= net.hosts[0]
> 
>  
> 
> #This will execute the command but it won’t be attached to a tty.
> 
> h1.cmd('ifconfig '+ h1.intfs[0].name +' 10.0.0.1’)
> 
>  
> 
> #This will start an xterm and execute the command inside it. This allows automatically starting commands which need to be attached to a tty.
> 
> net.terms += makeTerm( h1, cmd = "bash -c './h1.sh;'")
> 
>  
> 
> The second one is not in upstream mininet. I have it in my github fork and I submitted a pull request for it here: https://github.com/mininet/mininet/pull/473 <https://github.com/mininet/mininet/pull/473>
>  
> 
> HTH,
> 
>  
> 
> Joseph
> 
>  
> 
> From: Tomer Godinger [mailto:tomergod at post.bgu.ac.il <mailto:tomergod at post.bgu.ac.il>] 
> Sent: Thursday, March 05, 2015 5:52 AM
> To: Bob Lantz
> Cc: mininet-discuss at lists.stanford.edu <mailto:mininet-discuss at lists.stanford.edu>
> Subject: Re: [mininet-discuss] Node names in xterm, multiple Mininet CLIs
> 
>  
> 
> Thanks for the ideas.
> 
> I hadn't thought of adding them to the hosts file.
> 
> It would indeed be a solution, but I'd rather use Mininet's Python API - but how do I invoke a Mininet Python command / script from an xterm?
> 
> In other words, I have no problem writing a script that would do what I need, but for that I need the 'net' variable that the running Mininet has. And when I open an xterm window, I get the standard bash shell on the host, and not the Mininet CLI.
> 
> Alternatively, if I run a script from within the Mininet CLI, I'd be able to use the 'net' variable, but then the script would run from within the terminal on which the Mininet CLI is running, and not on another xterm.
> 
>  
> 
> I'm currently trying to look into how xterms windows are created in Mininet, hoping that I'd be able to figure out how to open them myself in a Python script.
> 
> Any information on the subject would be appreciated.
> 
>  
> 
> Thanks again,
> 
> Tomer Godinger.
> 
>  
> 
>  
> 
> On Thu, Mar 5, 2015 at 3:48 AM, Bob Lantz <rlantz at cs.stanford.edu <mailto:rlantz at cs.stanford.edu>> wrote:
> 
> The best way to do this is to use Mininet’s python API to run your experiment.
> 
> Alternately, you could add your Mininet host IP addresses to /etc/hosts or to a local DNS server in the VM (e.g. dnsmasq.)
> 
> 
> On Mar 4, 2015, at 7:50 AM, Tomer Godinger <tomergod at post.bgu.ac.il <mailto:tomergod at post.bgu.ac.il>> wrote:
> >
> > Hi,
> >
> > Is it possible to open an xterm window for a host where node names (h1, s2, etc.) would be recognized?
> > Alternatively, if I could open the Mininet CLI on multiple screens (can I ssh into it, for example?), this would also be adequate.
> > Basically I wish to run blocking scripts and pass the IPs of nodes to them, and I'd very much rather not look them up and enter them manually every time.
> >
> > Thanks,
> > Tomer Godinger.
> >
> 
> > _______________________________________________
> > mininet-discuss mailing list
> > mininet-discuss at lists.stanford.edu <mailto:mininet-discuss at lists.stanford.edu>
> > https://mailman.stanford.edu/mailman/listinfo/mininet-discuss <https://mailman.stanford.edu/mailman/listinfo/mininet-discuss>
>  
> 
> 
> _______________________________________________
> mininet-discuss mailing list
> mininet-discuss at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/mininet-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/mininet-discuss/attachments/20150305/44dd8a1b/attachment.html>


More information about the mininet-discuss mailing list