Search Mailing List Archives
[mininet-discuss] Node names in xterm, multiple Mininet CLIs
jdb109120 at utdallas.edu
Thu Mar 5 10:30:50 PST 2015
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:
#This will execute the command but it won’t be attached to a tty.
h1.cmd('ifconfig '+ h1.intfs.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
From: Tomer Godinger [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
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.
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:
> 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.
> Tomer Godinger.
> mininet-discuss mailing list
> mininet-discuss at lists.stanford.edu<mailto:mininet-discuss at lists.stanford.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the mininet-discuss