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

Beshay, Joseph jdb109120 at
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:

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 +'’)

#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 './;'")

The second one is not in upstream mininet. I have it in my github fork and I submitted a pull request for it here:



From: Tomer Godinger [mailto:tomergod at]
Sent: Thursday, March 05, 2015 5:52 AM
To: Bob Lantz
Cc: mininet-discuss at
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<mailto:rlantz at>> 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<mailto:tomergod at>> 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<mailto:mininet-discuss at>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the mininet-discuss mailing list