Sei sulla pagina 1di 23

25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Open-Source Routing and Network Simulation

Home / Open Source Networking / Set up the Mininet network simulator

Set up the Mininet network simulator


September 17, 2013

The easiest way to get started using the Mininet network simulator is to use the Mininet virtual machine. It is based on the Ubuntu Linux Server
operating system and comes with all the software and tools required to support Mininet already installed.

The Mininet web site provides detailed setup notes, describing how to download and use the Mininet virtual machine. While I was following the
procedure described in these notes, I found a few points where some more information would have been helpful. For my own reference, and to help
anyone else who will install Mininet, I list the procedure I followed in the post, below.

SSH and X Server software


I set up the Mininet virtual machine on my Apple iMac computer. The Mac OS X operating system comes with SSH software but does not come with an
X server already installed. You must install the XQuartz X server from http://xquartz.macosforge.org. See the Apple Support web sit for more details at:
http://support.apple.com/kb/HT5293.

On the Linux desktop distributions, the SSH and X-server software are already available.

On a computer running Windows, you need to download and install the required SSH and X-server software (I recommend PuTTY and XMing).

Download the Mininet virtual machine


Download the Mininet virtual machine (VM) from http://mininet.org/download. I chose the latest version available, which was mininet-2.1.0-130919-
ubuntu-13.04-server-amd64-ovf.zip. This file is a compressed ZIP archive containing two files so, after downloading it, decompress it and save the files
to my hard drive.

To decompress the archive, double-click on the mininet-2.1.0-130919-ubuntu-13.04-server-amd64-ovf.zip file to automatically launch the archive
application or use the following command in the terminal window:

$ tar -xvf mininet-2.1.0-130919-ubuntu-13.04-server-amd64-ovf.zip

This will create a folder named mininet-2.1.0-130919-ubuntu-13.04-server-amd64-ovf. The folder will contain the following files:

http://www.brianlinkletter.com/set-up-mininet/ 1/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

mininet-vm-x86_64.vmdk
mininet-2.1.0-130919-ubuntu-13.04-server-amd64.ovf

Import the virtual machine into VirtualBox


Next, create a version of the Mininet virtual machine that will run in VirtualBox by importing the Mininet virtual machine into the VirtualBox program

Start the VirtualBox manager application on your host system.

To import the Mininet virtual machine, use the VirtualBox menu command:

File → Import Appliance

In the next screen, click the “Open appliance” button.

Navigate to the folder containing the mininet-2.1.0-130919-ubuntu-13.04-server-amd64.ovf file and select it.

Then, click the “Continue” button to get to the Appliance Settings screen. Use the default settings, but you can change virtual machine’s name, if you
want to. I changed the name from vm to Mininet. Click on the “Import” button.

http://www.brianlinkletter.com/set-up-mininet/ 2/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

After a few minutes, you will see the Mininet VM you imported in the VirtualBox window.

Add a Host-only Adapter in VirtualBox


To use Mininet in the way recommended by the Mininet setup notes, you must create a “host only” network interface in VirtualBox. This creates a
loopback interface on the host computer that can be used to connect the virtual machine to the host computer (or to other virtual machines). You will
need this so that the host computer can run remote X11 sessions on the virtual machine in the later steps.

Open the VirtualBox preferences panel. Use the VirtualBox menu command:

VirtualBox → Preferences.

Click on the “Network” icon in the Preferences panel. Then. click on the small green “plus” sign on the right side of the window to add a new network
adapter. An adapter called vboxnet0 will be created. The default settings should be acceptable.

http://www.brianlinkletter.com/set-up-mininet/ 3/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Check the settings by clicking on the small “screwdriver” icon on the right side of the window to edit the adapter’s configuration. Make a note of the IP
address.

In this case the default IP address used by VirtualBox for the first host-only adapter is 192.168.56.1/24.

The DHCP server is enabled on the interface and we see that the Lower Address Bound is 192.168.56.101/24. So, we know that the IP address of the
virtual interface connected to the host-only network on the virtual machine will be assigned that IP address.

For future use, note the following information:

Host-only network address: 192.168.56.0/24


Host IP address on host-only network: 192.168.56.1/24
Virtual Machine’s virtual interface IP address on host-only network: 192.168.56.101/24

Add Network Adapter to Mininet virtual machine

http://www.brianlinkletter.com/set-up-mininet/ 4/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation
In the VirtualBox Manager window, click on the Mininet virtual machine and then click on the “Settings” icon on the top of the window. Click on the
“Network” icon in the settings panel that appears.

The virtual machine already has one interface defined. On the “Adapter 1” tab, we see an interface set up as a NAT.

This will allow the virtual machine to connect to the internet. But to use Mininet we still need a way for the virtual machine to connect directly to the host
computer. So, we need to add another virtual adapter and connect it to the “host-only network” interface we created earlier.

Click on the “Adapter 2” tab and, in the “Attached to:” field, select “Host-only network”. This allows other programs running on your host computer to
connect to the VM using SSH. Since only one host-only network is currently created, VirtualBox will automatically select the vboxnet0 host-only
network.

Click the “OK” button.

Now the network settings are configured for the Mininet virtual machine. You may change some of the other settings if you want to but the default
values for all other settings will work well.

Start the Mininet virtual machine


http://www.brianlinkletter.com/set-up-mininet/ 5/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation
In the VirtualBox manager, select the Mininet virtual machine and then click the “Start” button to start the Mininet VM.

The VM will boot up and present you with a login prompt.

Log in with userid=mininet and password=mininet

Configure a new virtual ethernet interface on the virtual machine


Run the ifconfig command to see the interfaces available on the Mininet virtual machine. We see two interfaces: eth0 and lo. You previously set up the
Mininet virtual machine so that the interface eth0 would be connected to the NAT interface on your host computer, so it has been assigned an IP
address that will work on the LAN connected to the host computer. In this case, eth0 has the IP address, 10.0.2.15/24.

This allows the virtual machine to connect to the internet. We can verify a connection to the internet by pinging an external server such as google.com.

mininet@mininet-vm:~$ ping -c 1 google.com

But, we do not see an interface that is connected to the host-only interface. We need to configure eth1.

http://www.brianlinkletter.com/set-up-mininet/ 6/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation
To see all available interfaces, even ones that are not up, execute the ifconfig -a command.

mininet@mininet-vm:~$ ifconfig -a

Now, we see that we have three interfaces: lo, eth0, and eth1. But eth1 is not up and does not have an IP address assigned. We can fix this by starting
the DHCP client on eth1 so it will request an IP address from the DHCP server that is running on the host-only interface connected to eth1.

mininet@mininet-vm:~$ sudo dhclient eth1

Run the ifconfig command again. You will see that the interface eth1 now has an IP address 192.168.56.101 assigned to it.

You can verify this interface is working now by pinging the host computer’s host-only interface address, 192.168.56.1 from the Mininet virtual machine.

mininet@mininet-vm:~$ ping -c 1 192.168.56.1

To permanently configure the new interface, edit the /etc/network/interfaces file and add an interface named eth1.

mininet@mininet-vm:~$ sudo vi /etc/network/interfaces

Just copy the same configuration for eth0 for eth1. In my case, I added the following lines to the file:

auto eth1
iface eth1 inet dhcp

http://www.brianlinkletter.com/set-up-mininet/ 7/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Now, the next time you start the Mininet virtual machine, the system will automatically configure the eth1.

Using SSH to connect to the Mininet VM


We are done using the VirtualBox interface to the Mininet virtual machine. In the next steps, you will use the SSH client software on your computer to
connect to the Mininet virtual machine. This accomplishes two things:

1. From the host computer, we can connect to remote X applications running on the Mininet VM, such as xterm and wireshark.
2. We can use an easier-to-use terminal window or xterm window to interact with the Mininet virtual machine. You will have noticed by now that
working with the VirtualBox console window is difficult because:
The VirtualBox console window captures your mouse whenever you use it and you have to use the appropriate “host key” to escape from the
virtual machine and return control to your host computer.
You cannot cut-and-paste text from the virtual machine console window to a program on your host computer.

We need to set up an SSH connection to the virtual machine with X11 forwarding enabled so that we can run X applications on the Mininet virtual
machine but display the applications on the X Server running on our host computer. Then we can set up an Xterm and stop using the virtual machine
console window.

SSH configuration
On the Mininet VM, SSH forwarding is already enabled (in the /etc/ssh/sshd_config file). So you do not need to make any SSH configuration changes
on the virtual machine.

Connect with SSH


Open the Terminal application on your computer (Windows users will use PuTTY).

In the Terminal window, use the SSH client on your computer to start an SSH session to the Mininet VM.

iMac:Desktop blinklet$ ssh -Y mininet@192.168.56.101

You will see a warning about the RSA key. Enter “yes” to continue. This will also add the RSA key to your SSH client so you will not see the warning
again.

http://www.brianlinkletter.com/set-up-mininet/ 8/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Now you are logged into the Mininet virtual machine via a secure SSH session. Now, you can run remote X11 clients on the Mininet virtual machine
over this SSH session.

Launch a remote X11 client


Note: As stated earlier, on a Mac you need to install the XQuartz X server from http://xquartz.macosforge.org.

In the Terminal window, which is now running an SSH session connected to the Mininet virtual machine, start an Xterm:

mininet@mininet-vm:~$ xterm -sb &

An Xterm window will open on the screen. You need the “-sb” option if you want to have a scrolling buffer in the Xterm window (so you can scroll back if
you need to).

Now you know that applications running on the Mininet virtual machine can use X forwarding to display windows on the host computer. You will be able
to use the Mininet virtual machine as described in the documentation on the Mininet web site.

As an extra activity, run Wireshark on the Mininet Xterm window:

mininet@mininet-vm:~$ sudo wireshark &

Wireshark should start up running on the Mininet virtual machine but is displayed in an X window on your host computer.

http://www.brianlinkletter.com/set-up-mininet/ 9/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

You have completed setting up the Mininet virtual machine.

Conclusion
We set up the Mininet virtual machine on our computer and we verified that we can communicate properly with it. We are ready to work with Mininet.
The next step is to follow the documentation on the Mininet web site and try out the Mininet Walkthrough tutorial.

Share this:

    
4 25

Related Posts:

1. How to install the Mininet SDN Network Simulator


2. Mininet network simulator review
3. Install Mininet on an Amazon EC2 server
4. How to build Mininet documentation
5. How to use MiniEdit, Mininet’s graphical user interface

In Open Source Networking mininet, SDN

Marionnet network simulator... Mininet network simulator...

91 responses to Set up the Mininet network simulator


odimegwu david September 17, 2013 at 1:37 pm

it seems mininet has zip downloads only for ubuntu.


https://github.com/mininet/mininet/downloads

Sulabh Bista September 30, 2013 at 8:50 pm

Nice walkthrough. Thanks.

Gordon October 4, 2013 at 3:45 pm

This is absolutely a great guide for someone who is new to VM and mininet. Thanks!

http://www.brianlinkletter.com/set-up-mininet/ 10/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

FalconEnayat April 15, 2014 at 7:34 am

Nice work…it was so helpful. thanks !

Brian Linkleter April 19, 2014 at 9:41 pm

Thanks for the positive feedback!

Nam April 25, 2014 at 2:56 pm

Nicely done…Thank you very much!

Brian Linkleter April 25, 2014 at 8:34 pm

You’re welcome! I’m glad you found this useful.

Jeremy June 18, 2014 at 12:56 pm

I am not able to ping my host from my mininet vm. My vboxnet0 on my mac has:

vboxnet0: flags=8843 mtu 1500


ether 0a:00:27:00:00:00
inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255

when I run ping -c 1 192.168.56.1 , I get the message saying that 0 packets received and 100% loss.

One more thing while I am asking, how do I enable scrolling on the VM terminal window? I am using a macbook pro and the
trackpad.

Thanks,
Jeremy

Jeremy June 18, 2014 at 12:56 pm

Fyi.. I am running the ping from mininet guest.

Brian Linkletter June 22, 2014 at 12:08 am

Hi Jeremy,
I would need more information about your setup before I could suggest how to fix your problem.
Thanks,
Brian

zibafar July 8, 2014 at 12:01 pm

ping -c 1 192.168.56.1 is not correct.


ping -c l 192.168.56.1 is correct.
please attention to “l” is correct.
not 1

Brian Linkletter July 8, 2014 at 12:08 pm

Hi zibafar,
I use the ping -c 1 x.x.x.x command so I sent just one ICMP echo request. The -c 1 (one) option is correct.
Thanks,
Brian

zibafar July 8, 2014 at 11:55 am

Hello, I have a problem, when I type


‘$sudo dhclient eth1’
I receive an error that says
“can’t find interface eth1”.
how do I fix it?

http://www.brianlinkletter.com/set-up-mininet/ 11/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation
I’ve been using VirtualBox in windows 8
I am a beginner in mininet and I want to learn it.
can any one help me please? thanks alot

Brian Linkletter July 8, 2014 at 12:10 pm

Hi zibafar,
Did you set up the second network adapter in VirtualBox before you started the mininet virtual machine?
When you run the ifconfig -a command, do you see the eth1 interface?
Thanks,
Brian

yazan August 22, 2014 at 12:55 pm

hello
i tried so many times to solve the problem

________________________
mininet> xterm h1 h2
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm: Xt error: Can’t open display: %s
xterm: DISPLAY is not set
mininet> Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm: Xt error: Can’t open display: %s
xterm: DISPLAY is not set
any options ?? :/

Brian Linkletter August 23, 2014 at 11:22 pm

Did you connect to the Mininet VM using SSH?


–Brian

yazan August 24, 2014 at 12:06 pm

yeah i did
this what i get
{
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm: Xt error: Can’t open display: %s
xterm: DISPLAY is not set
}

another question is it related to python >???


cause i got error msg located to line in python any ideas
am a beginner :/
thanx

xuchenhui November 5, 2014 at 4:28 am

hi
Did you resolve you problem ? I encontered the same problem with you.

Parth July 23, 2015 at 8:53 pm

ssh -X @

This will work!

asdfascd September 27, 2016 at 6:59 am

http://www.brianlinkletter.com/set-up-mininet/ 12/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Thanks. It works as you said.

yazan August 24, 2014 at 12:08 pm

i also check X11 forward yes its fine but i don’t know what is the problem

yazan August 24, 2014 at 12:14 pm

does this mean anything


3547 pts/1 00:00:00 xterm

yazan August 24, 2014 at 12:18 pm

mininet> gterm h1
Traceback (most recent call last):
File “/usr/local/bin/mn”, line 5, in
pkg_resources.run_script(‘mininet==2.0.0’, ‘mn’)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File “/usr/lib/python2.7/dist-packages/pkg_resources.py”, line 1239, in run_script
execfile(script_filename, namespace, namespace)
File “/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/scripts/mn”, line 280, in
MininetRunner()
File “/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/scripts/mn”, line 113, in __init__
self.begin()
File “/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/EGG-INFO/scripts/mn”, line 266, in begin
CLI( mn )
File “/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/mininet/cli.py”, line 72, in __init__
self.cmdloop()
File “/usr/lib/python2.7/cmd.py”, line 142, in cmdloop
stop = self.onecmd(line)
File “/usr/lib/python2.7/cmd.py”, line 221, in onecmd
return func(arg)
File “/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/mininet/cli.py”, line 235, in do_gterm
self.do_xterm( line, term=’gterm’ )
File “/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/mininet/cli.py”, line 231, in do_xterm
self.mn.terms += makeTerms( [ node ], term = term )
File “/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/mininet/term.py”, line 60, in makeTerms
return [ makeTerm( node, title, term ) for node in nodes ]
File “/usr/local/lib/python2.7/dist-packages/mininet-2.0.0-py2.7.egg/mininet/term.py”, line 44, in makeTerm
return Popen( cmds[ term ] + args )
File “/usr/lib/python2.7/subprocess.py”, line 679, in __init__
errread, errwrite)
File “/usr/lib/python2.7/subprocess.py”, line 1259, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

:/ am really sorry for asking much but am lost

Brian Linkletter August 24, 2014 at 10:31 pm

Hi Yazan,
I tried to reproduce this problem in my own system. I run the Mininet VM v2.1 in VirtualBox on a host system that runs Xubuntu
14.04. I followed the procedures in described in my two Mininet posts related to setting up the Mininet VM and running Mininet. I
saw no problems. The xterms started correctly.

I don’t know your setup so it is difficult for me to help debug this issue. I suggest you post your issue to the Mininet mailing list.
Someone on that list may be better able to help you.

Sorry I cannot be more helpful.


–Brian

yazan August 26, 2014 at 9:01 am

brian really thanx


i feel embarrassed cuz i have been working on windows 7 with vmware workstation
and i have downloaded cygwin 64 terminal and ssh package
i didnt know about the ubuntu that i should work with ubuntu :/
i will try to do this again :))) thank u

http://www.brianlinkletter.com/set-up-mininet/ 13/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Brian Linkletter August 26, 2014 at 11:51 am

Hi Yazan,

This should work on a Windows 7 host machine.

Based on what you’ve told me so far, I suspect you do not have an X-server running on your Windows 7 host. That would
explain why you get the “display not found” errors. So, maybe just start by running XMing, a free X-server for Windows,
along with your current setup and see if that helps.

In the past, I ran the Mininet VM in VirtualBox on a Windows 7 host computer, I used XMing as my X-server, and I used
Putty as my SSH client. This worked fine for me. I suggest you use VirtualBox, XMing, and Putty and see if that works for
you on Windows 7. They are all free tools. I have not used VMWare or Cygwin so I cannot help you with those tools.

Brian

yazan August 31, 2014 at 11:34 am

hy brian
ok now am usuing ubuntu 13.10 wireshrak works well and xterm !!
every thing is fine with it but i downloaded virtualbox and mininet
i faced the same problem
root@mininet-vm:/home/mininet# sudo wireshark

(process:8496): Gtk-WARNING **: Locale not supported by C library.


Using the fallback ‘C’ locale.
error: XDG_RUNTIME_DIR not set in the environment.

(wireshark:8496): Gtk-WARNING **: cannot open display


any ideas ????
thank u very much :))))

Brian Linkletter August 31, 2014 at 11:56 am

Please check the host-only network adapter in VirtualBox. Is it set up correctly?


I’ve never seen this problem after I followed the steps I describe in this blog post. Please tell me all the steps you
followed to set up the mininet VM and VirtualBox, and to connect to the mininet VM.
–Brian

yazan August 31, 2014 at 2:30 pm

ok fisrt extract the file


then import
adding vbox0 then adapter to vm
actully i didnt do it from terminal i just
extracted the file then i did every thing
from terminal i can use xterm , sudo wireshark it opens every thing is fine
i saw at wireshark my connection ssh with vm but
when i start the connection with mininet i cant xterm or wireshark
sudo mn works
pingall works
but i have no idea why ://
i am working on it more than 5 days , crashed my o.s but still trying
-yazan

Brian Linkletter August 31, 2014 at 4:20 pm

That’s not enough detail.


Did you set up the host-only adapter in VirtualBox? I think that you do not have a connection between the mininet VM and the
host system.

Joy March 9, 2015 at 8:36 am

I faced the same issue, it was solved once I downloaded xming and started it, before starting VM

Brian Linkletter March 9, 2015 at 9:14 am

Hi Joy,
Thanks for your solution!
Brian

http://www.brianlinkletter.com/set-up-mininet/ 14/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

yazan September 1, 2014 at 2:49 pm

it wooooooooooooooooooooooooooorks !!!!! finally


biko@yazan-Inspiron-5520:~$ ssh -AX mininet@192.168.56.102
this was the problem do u believe it !!!!!!!
not ssh -x but -AX worked !!! i dont know how and why actually

Brian Linkletter September 2, 2014 at 11:15 am

I’m glad this works for you now. SSH -Y should work, too.

Michael Riley October 21, 2014 at 6:12 pm

Hey, great tutorial! I’m getting stuck with the dhclient tool, it’s not resolving a new interface for eth1.

sudo dhclient eth1 -v

DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval # (xid=0xcb0a6ce) *repeating a bunch of times*


No DHCPOFFERS received

Been working on getting this up for almost a week…

Diya October 31, 2014 at 5:22 pm

hi.
I am new on mininet, I had floodlight switch and I run it on Eclipse, on mininet I want to make network by this command “sudo mn –
controller=remote –ip=192.168.1.51, –port=6633” but there is an error said “sudo mn –controller=remote –ip=192.168.1.51, –
port=6633” could you tel me what I should do?
regards.

Diya October 31, 2014 at 5:26 pm

hi.
I am new on mininet, I had floodlight switch and I run it on Eclipse, on mininet I want to make network by this command “sudo mn –
controller=remote –ip=192.168.1.51, –port=6633″ but there is an error said “ mn: error: no such option: –port ″ could you tel me what
I should do?
regards.

santha January 3, 2015 at 2:51 am

i can’t access the port 6633 when connecting the openflow with sdn

Daniela May 1, 2015 at 10:14 pm

I am having a problem. When I follow the steps and do the initial ifconfig, it gives me that eth0 has the inet addr: 192.168.56.101
why is that happening? I followed the steps, I am not sure why it is not showing the correct inet add r. anyone can help me?

Brian Linkletter May 1, 2015 at 10:38 pm

Check the settings in VirtualBox. Are you using the default NAT or did you have another NAT network created using a different
network CIDR? Check VirtualBox preferences (File –> Preferences).

Daniela May 1, 2015 at 10:45 pm

I am new to this, so I do not really know what to do. I followed the instructions. I just went to preferences and created the
vboxnet0 and then when to setting, etc, as described. Please help me. I am desperate.

Daniela May 1, 2015 at 11:00 pm

I tried installing it on another computer, followed all the steps, and it is giving me the same problem. I did it for a previous
project, and it worked, I am not sure why it is not working for this one.
I even tried to continue, and followed the steps to add ethi1, but when it gets an addr, it adds the one that eth0 should
have. I am confused and running out of time. help

http://www.brianlinkletter.com/set-up-mininet/ 15/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Brian Linkletter May 2, 2015 at 9:31 pm

I recreated the same issue you saw. VirtualBox has changed the way it handles network interfaces since I posted this
tutorial. Now, it starts the host-only interface first on eth0. This is why you see the address 192.168.56.101. The NAT
interface is now connected to eth1, so when you follow the next step in the tutorial and execute the command sudo
dhclient eth1 , you will see the address 10.0.2.15 assigned to it.

This is confusing because we set up the NAT interface on Adapter 1 so we expect it should connect to the VM’s eth0,
not the eth1 interface. I do not know why VirtualBox is working this way right now (or maybe it is something new in
version 2.2 of the Mininet VM).

So you can continue with the tutorial after executing the command, sudo dhclient eth1 . The host-only network
and the NAT network will both be up and running at that point and the rest of the tutorial is not affected by the change
to the numbering of the network interfaces.

vineet November 19, 2015 at 3:13 pm

Hi, I tried the same and i am having the same problem. And when i try to follow next steps to SSH in VM from the host
it is not working. The terminal in host shows Request timeout for icmp_seq#. Please help. I am stuck and cant go
forward.

Marc van der Laan December 8, 2015 at 4:54 am

This message should help the people who get a time out error when trying to connect via putty (ssh) to the virtual
machine.
VirtualBox has changed the host-only adapter IP-address to 169.254.230.107 (in my set-up). When I do change this
IP-address to a (static) one with format: 192.168.56.[1-10] – e.g. 192.168.56.3 (in my set-up) – an IP-address that
does not exist yet – then I can finally ping and connect with putty in the DOS cmd prompt: putty.exe -X
mininet@192.168.56.103. The IP-address 192.168.56.103 is the one assigned to eth0 in my set-up.

sailen August 16, 2015 at 10:59 am

i want to know how to use miniedit

Reshma September 20, 2015 at 1:38 pm

Hi Brian,
I followed all the steps mentioned in your blog, but i am facing with a problem. IP address of eth0 and eth1 are getting interchanged
wen i checked using ifconfig. eth0 is showing address 192.168.56.101 and eth1 showing 10.0.2.15. Please help me .I am stuck and i
couldnt go further

Shakti Kumar September 20, 2016 at 6:52 am

Hi Brian,
Even I am facing the same problem. Due to this my putty doesn’t connect to eth1 interface at all, it says connection timed out.
However I tried connecting to other ip addresses on my network via putty and it works fine. This means problem is not with the
connection or putty.

Shakti Kumar September 20, 2016 at 7:11 am

This problem is not solved even in the previous comments who raised this issue of changed ip address to 10.0.2.15.
I am still facing “Network Error: Connection Timed out”.

Deva October 8, 2015 at 11:57 am

I am not able to create two network adapter in Mininet VM. Adapter2/3/4 is grey out. can You please help me on this??

Rich January 12, 2016 at 8:38 am

Brian – You saved me hours – thank you so much


Rich

Brian Linkletter January 12, 2016 at 9:31 am

http://www.brianlinkletter.com/set-up-mininet/ 16/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation
Thanks! I am happy you found this post to be helpful.

hira January 25, 2016 at 11:58 pm

Hello Brian, thanks for an awesome walkthrough, could you please help me with something? I installed Mininet just like the
instructions, but when I try to ping it says unable to ping google.com. The IP address assigned to eth0 (before adding eth1) is
192.168.56.101 . I tried to edit my DNS configuration (to OpenDNS servers) using
instructions but it still doesn’t help. I am new to networks and would appreciate any help. Thanks.

Brian Linkletter January 26, 2016 at 12:09 am

Hello Hira,
If you set up the Mininet VM by following my instructions, then you should be able to connect to the internet from the Mininet VM.
What exactly are you trying to do? Eth0 should be connected to the NAT interface in VirtualBox. I suggest you check your
VirtualBox configurations for the Mininet VM.
Thanks, Brian

hira January 28, 2016 at 12:41 am

Thanks so much for the answer! I did follow them exactly as you said. However, the place where you mentioned adding a host-
only adapter, that is by going into Preferences -> Network -> Host-only Adapter tab, I didn’t add a new one, because there
already was one, and with exactly the same setting as the one in your snapshots. How do you think I can check that etho0 is
connected to the NAT interface ?

Brian Linkletter January 28, 2016 at 9:18 am

I think maybe VirtualBox is using eth0 to connect to the NAT interface because the IP address looks like it is on host-only-
adapter’s IP subnet. Probably, eth1 is connected to the NAT interface. Check that eth1 is set up and has an IP address.
Thanks,
Brian

Adnan March 23, 2016 at 4:31 am

Sir xterm command now working in my virtual box…i install xming also…
when i command ” xterm h1″ so it says “cannot connect to display” please help

Adnan March 23, 2016 at 4:33 am

not working sorry for mistake

Claudia May 26, 2016 at 6:44 am

Hello! I installed Wireshark version 2.0.3 for mac on my MacBook Pro. It starts correctly from launchpad without Xquartz. If I try to
launch wireshark from the terminal, it doesn’t start. Why?

Claudia May 26, 2016 at 7:09 am

I get this error: XDG_RUNTIME_DIR not set in the environment


(wireshark:1667): Gtk-WARNING **: cannot open display

Brian Linkletter May 26, 2016 at 9:18 am

Hi Claudia,
Where are you running Wireshark on the command line? Are you running wireshark in the terminal window of the Mininet VM? If
so, it does not matter that Wireshark is also set up on your Mac OS. You still need an X server to display the Wireshark GUI
running on the Mininet VM. You still need to install Quartz.
Brian

Claudia May 26, 2016 at 11:29 am

http://www.brianlinkletter.com/set-up-mininet/ 17/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation
Thank you Brian! I installed XQuartz. Now when I launch wireshark from the Terminal window (which is now running an SSH
session connected to the Mininet virtual machine), wireshark version 1.10.6 (an old version that I thought I had uninstalled time
ago) starts even if wireshark version 2.0.3 is installed on my mac.
Instead, if I launch wireshark from the Terminal of the Mininet virtual machine, I still have these errors: XDG_RUNTIME_DIR
not set in the environment and : Gtk-WARNING **: cannot open display.

Brian Linkletter May 26, 2016 at 11:40 am

When I have encountered this issue, it was because I had a problem either with the connection between the VM and my
host machine or I had not started SSH with the correct options.

Use “ssh -X” to turn on X forwarding. If this does not work, try “ssh -Y”.

Also, you will be running the version of Wireshark that comes bundled on the Mininet VM.

Brian

Claudia May 28, 2016 at 9:56 am

Thank you so much for the answer!

Petr June 10, 2016 at 3:38 pm

Hi, Brian!

After mininet VM installation, I have eth0 initialized with 192.168.56.104 IP-address and after I activate eth1 with sudo dhclient
command it assigns 10.0.2.15 IP-address to eth0. When I ping google.com from VM environment it comes back with 1 packets
transmitted, 0 received, 100% packet loss so it does seem that there is no connectivity via interface. When I try to connect to VM
from terminal via ssh it says ssh: connect to host 192.168.56.104 port 22: Operation timed out.

What the reason can be?

Regards, Petr.

Petr June 10, 2016 at 3:50 pm

when I ping 192.168.56.104 from Virtual Machine the transmission comes through successfully but I’m still not able to connect to
VM environment (ssh -Y Mininet-VM@192.168.56.104) via ssh.

Maruthi Ramprasad August 19, 2016 at 1:19 am

thanks so much for the detailed walkthrough


definetely recommended for getting started with mininet

Surbhi August 29, 2016 at 1:41 pm

I love you. This is the best tutorial on mininet. Thanks a ton!

Brian Linkletter September 6, 2016 at 10:26 am

Thank you!

aman September 8, 2016 at 11:00 pm

Hi Brian. Thanks for tutorial. I am working on DDOS attack using POX controller. I setup topology in MINIEDIT with 64 hosts
connected to 4 different switches. Problem is by default in miniedit default IP base is set to ‘10.0.0.0/8’. But in my work i need to
assign different hosts with different IP addresses e.g. 10 hosts that belong to subnet 10.0.0.0/8 fine, rest 10 hosts belong to different
subnet IP e.g. 140.45.0.0/16 and so on. How I can do this in mininet? I am stuck here badly and really frustrated due to limitations of
mininet. Please help

Brian Linkletter September 8, 2016 at 11:06 pm

You can set host IP addresses using the Mininet Python API. Create a custom topology script.

saleh October 13, 2016 at 8:51 am

http://www.brianlinkletter.com/set-up-mininet/ 18/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation
Yes.It work. I’m new in Mininet ,,, but it is amazing, I’m going to do my Ph.D on that. thanks a lot Dear Brain.

Ahmed September 23, 2016 at 5:40 am

Hi brian,

Thanks for the detail setup process. It has helped me a lot. However I am trying to get the hosts h1 and h2 in mininet to connect to
the Internet so I connect the eth1 to s1 through the following process,

sudo ovs-vsctl add-port s1 eth1

xterm to h1
ifconfig h1-eth0 0
dhclient h1-eth0

I get the host h1 and h2 to connect to Internet but my SSH connection to th VM is lost. Later I tried to get switch-port s1 (internal) in
openvswicth s1 to get IP from DHCP so I ca re-establish the SSH connection but it doesn’t work. switch-port s1 (internal) doesnt get
any IP from DHCP server. Can you help me with this issue?

kanwar October 1, 2016 at 12:24 am

Thanks for the detailed explanation.It works

Fran November 5, 2016 at 6:26 pm

Thank you it was really useful.

Dzenis November 29, 2016 at 10:12 am

Hello,can somebody help me,i have problem with Mininet.When i want to create SSH,enable x11 forwarding using Putty i get
message putty fatal network error,connection timed out.What is the problem ???

isams1 January 18, 2017 at 2:49 pm

Hi,
It seems that i couldnt ping to google or any website using mininet cmd (it gave “Unknown host” error) . I also noticed the inet
address of eth0 was not 10.2.0.15 but 192.168.56.101. This happened when i added host-only adapter as 2nd adapter but when i
removed it, the inet address of eth0 was correct (10.2.0.5) and i could ping to google site as normal.

isams1 January 18, 2017 at 2:51 pm

Sorry the inet address was 10.2.0.15 after i removed the 2nd adapter (the host-only one).

Luis Quesada February 2, 2017 at 2:12 pm

Dear Brian,

Thanks a lot for this great guide. It was indeed helpful. I had some minor issues while I was going through the instructions:

1) 192.168.56.101 did not work for me. 192.168.56.102 did. Please see below:

insight086:~ lquesada$ ping 192.168.56.101


PING 192.168.56.101 (192.168.56.101): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
ping: sendto: No route to host
Request timeout for icmp_seq 8
ping: sendto: Host is down
Request timeout for icmp_seq 9
ping: sendto: Host is down
Request timeout for icmp_seq 10
ping: sendto: Host is down
Request timeout for icmp_seq 11

http://www.brianlinkletter.com/set-up-mininet/ 19/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation
^C
— 192.168.56.101 ping statistics —
13 packets transmitted, 0 packets received, 100.0% packet loss
insight086:~ lquesada$ ping 192.168.56.102
PING 192.168.56.102 (192.168.56.102): 56 data bytes
64 bytes from 192.168.56.102: icmp_seq=0 ttl=64 time=0.355 ms
64 bytes from 192.168.56.102: icmp_seq=1 ttl=64 time=0.332 ms
64 bytes from 192.168.56.102: icmp_seq=2 ttl=64 time=0.333 ms
64 bytes from 192.168.56.102: icmp_seq=3 ttl=64 time=0.386 ms
64 bytes from 192.168.56.102: icmp_seq=4 ttl=64 time=0.476 ms
64 bytes from 192.168.56.102: icmp_seq=5 ttl=64 time=0.317 ms
64 bytes from 192.168.56.102: icmp_seq=6 ttl=64 time=0.272 ms
64 bytes from 192.168.56.102: icmp_seq=7 ttl=64 time=0.208 ms
64 bytes from 192.168.56.102: icmp_seq=8 ttl=64 time=0.299 ms
64 bytes from 192.168.56.102: icmp_seq=9 ttl=64 time=0.308 ms
64 bytes from 192.168.56.102: icmp_seq=10 ttl=64 time=0.285 ms
64 bytes from 192.168.56.102: icmp_seq=11 ttl=64 time=0.332 ms

2) When excecuting the command ‘sudo wireshark &’ I got the following error:
https://www.dropbox.com/s/94vxhixrpi93il0/errorMsg.png?dl=0

I am running virtual box Version 5.1.14 r112924 (Qt5.6.2). I am using Mininet 2.2.1 on Ubuntu 14.04 LTS
(http://onlab.vicci.org/mininet-vm/mininet-2.2.1-150420-ubuntu-14.04-server-amd64.zip)

My machine is a MacBookPro running macOS Sierra version 10.12.2.

Cheers,
Luis

Trackbacks and Pingbacks:


1. How to install the Mininet SDN Network Simulator | Open-Source Routing and Network Simulation - December 12, 2014
[…] people who use the Mininet network simulator will download and set up the Mininet virtual machine image. However, there are times when we
may want to use a different version of Mininet than the one […]

2. How to build Mininet documentation | Open-Source Routing and Network Simulation - December 13, 2014
[…] Start the Mininet virtual machine and log into it via SSH. See my previous post about setting up the Mininet SDN Network Simulator virtual
machine. […]

3. Emulating a Hetzner root with mininet at Rene's Blog - December 14, 2014
[…] At first get and install a Mininet VM, Another Howto. […]

4. Recommended Links - GlobalConfig.net - - February 16, 2015


[…] Set up the Mininet network simulator […]

5. How to use MiniEdit, Mininet’s graphical user interface | Open-Source Routing and Network Simulation - April 2, 2015
[…] SSH with X forwarding enabled. If you need to learn how to do this, please read my post describing how to set up Mininet. If you want to use
Mininet on an Amazon EC2 server, please see my post about installing Mininet on […]

6. Install Gephi on the Mininet VM | Open-Source Routing and Network Simulation - May 7, 2015
[…] of the POX SDN controller that interface with the Gephi graph visualization utility. Previously, I set up the Mininet network simulator, which
includes the POX SDN controller. The final step is to install Gephi on the Mininet virtual […]

7. Visualizing software defined network topologies using POX and Gephi | Open-Source Routing and Network Simulation - June 2, 2015
[…] have set up the Mininet 2.2.1 virtual machine on your […]

8. How to map OpenFlow switch TCP ports in Mininet SDN simulations | Open-Source Routing and Network Simulation - September 19, 2015
[…] Start the Mininet network emulator and create a Mininet network topology with a remote controller. […]

9. Using POX components to create a software defined networking application | Open-Source Routing and Network Simulation - September 21, 2015
[…] have set up the Mininet 2.2.1 virtual machine on your […]

10. Mininet Graphical Topology Creation – Mohit Ritolia - March 5, 2016


[…] Before starting this tutorial, you should have already started the Mininet VM and connected to it via SSH with X forwarding enabled. If you
need to learn how to do this, please read my post describing how to set up Mininet. […]

11. Setting Up A Virtual Web Server With Virtualbox – VPS - March 31, 2016
[…] Set up the Mininet network simulator | … – The easiest way to get started using the Mininet network simulator is to use the Mininet virtual
machine. It is based on the Ubuntu Linux Server operating system … […]

12. Using the OpenDaylight SDN Controller with the Mininet Network Emulator | Open-Source Routing and Network Simulation - October 27, 2016
[…] will use VirtualBox to run the Mininet VM that I downloaded from the mininet project web site, which is the easiest way to experiment with […]
http://www.brianlinkletter.com/set-up-mininet/ 20/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Follow me on Twitter

Join my mailing list


Please type your e-mail address

Subscribe

Network Simulators

Open-Source Network Simulators

Cloonix network emulator

CORE network emulator

GNS3 network emulator

IMUNES network emulator

Mininet SDN network emulator

Netkit network emulator

NS-3 network simulator

OpenStack all-in-one (DevStack, etc.)

Shadow network simulator

UNetLab and EVE.NG network emulators

VNX and VNUML network emulators

Search this site

Search...

Translate this page

Select Language ▼

Top Posts

How to emulate a network using VirtualBox

Open-Source Network Simulators

Installing Debian Linux in a VirtualBox Virtual Machine

How to set up the UNetLab or EVE-NG network emulator on a Linux system

Using the OpenDaylight SDN Controller with the Mininet Network Emulator

Recent Posts

Enable nested virtualization on Google Cloud

Install and run the Cloonix network emulator on Packet.net

Set up a dedicated virtualization server on Packet.net

Install the CORE Network Emulator from source code

Netdev 2.1 conference report

Build a custom Linux Router image for UNetLab and EVE-NG network emulators

How to set up the UNetLab or EVE-NG network emulator on a Linux system

DNS and BIND demonstration using the Cloonix network emulator

OFNet SDN network emulator

http://www.brianlinkletter.com/set-up-mininet/ 21/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

Psimulator2 forked, updated

How to emulate a network using VirtualBox

How to build a network of Linux routers using quagga

How To Install dCore Linux in a virtual machine

Mininet-WiFi: SDN emulator supports WiFi networks

OpenStack all-in-one: test cloud services in one laptop

Using the OpenDaylight SDN Controller with the Mininet Network Emulator

Saving a Cloonix network topology

Lenovo Thinkpad T420: Another excellent, inexpensive Linux laptop

Use ImageMagick to quickly and easily process images for your blog

Cloonix Network Simulator updated to v28

KVM Performance Limits for virtual CPU cores

Capture data on open-source router interfaces in GNS3

Using VirtualBox linked clones in the GNS3 network simulator

Using POX components to create a software defined networking application

How to map OpenFlow switches to TCP ports in Mininet SDN simulations

IMUNES on Linux

GNS3 Version 1.3: What’s new for Open-Source Routers

Book review: The Book of GNS3

Install the GNS3 network simulator version 1.x

Build your own network simulator using open-source DevOps tools

CORE Network Emulator updated to 4.8

Cloonix network simulator updated to version 26

Visualizing software defined network topologies using POX and Gephi

Install Gephi on the Mininet VM

Using the POX SDN controller

How to use MiniEdit, Mininet’s graphical user interface

Install Mininet on an Amazon EC2 server

Control an Amazon EC2 server from an Apple iPad using SSH and VNC

Install the CORE Network Emulator on Amazon AWS

How to run GUI applications on an Amazon AWS cloud server

Archive

Archive

Select Month

Open Source Routing and Network Simulation blog by Brian Linkletter is licensed under a Creative Commons Attribution-NonCommercial 4.0 International
License.

© 2018 Open-Source Routing and Network Simulation — Standard by 8BIT

http://www.brianlinkletter.com/set-up-mininet/ 22/23
25/01/2018 Set up the Mininet network simulator | Open-Source Routing and Network Simulation

http://www.brianlinkletter.com/set-up-mininet/ 23/23

Potrebbero piacerti anche