Configure a Vbox network for GNS3 with Internet through a cloud with a TAP interface

Today we going to configure a virtual network within GNS3. We can download older GNS3 versiones from sourceforge or the most recent from
We need to add the repositories to apt and after install gns3:

sudo add-apt-repository ppa:gns3/ppa
sudo apt-get update
sudo apt-get install gns3-gui

To have a connection to access Internet through our physical interface, we create a TAP interface (virtual bridge):

sudo apt-get install uml-utilities
modprobe tun
ifconfig tap0 netmask up

On the last line, you configure the ip, that will be the gateway for your virtual topology.
Now, as we need forward the packets, between the virtual network and your physical router, you must enable the forwarding option:

sudo iptables -I INPUT -j ACCEPT -i tap0
sudo iptables -I OUTPUT -j ACCEPT -o tap0
sudo sysctl -w net.ipv4.ip_forward=1

Now, you need an appliance or a any host image to create our virtual network. You can use a minimal Ubuntu version  downloadable from:


NOTE: You can use axel to download faster

After you create your VirtualMachine with VirtualBox, you need run it with GNS3 and configure.
If you need change your language keyboard, you may use this command, where 'es' is the language ID:

loadkeys es

If you need change your repositories zone, you can do that with this (in this case to Chilean repositories):

sed 's/' /etc/apt/sources.list 

For connectivity, we need configure the gateway and the DNS inside the machines. For the gateway you can add this command as follows, where the ip is the same that TAP interface:

sudo route add -net netmask gw dev eth0

Don't forget configure the eth0 ip with an ip in the same network:

sudo ifconfig eth0 netmask

To configure the DNS, you need edit /etc/resolvconf/resolv.conf.d/base file and add your favorite DNS servers:


After that, restart your resolv configuration with this command:

sudo resolvconf -u

Now, repeat the same for any amount of hosts and put them behind a switch (you need a switch to connect to tap iface). Connect a cloud to the switch and in the cloud option choice a TAP interface, where you need put the name of your TAP interface (by default is tap0).


Popular posts from this blog

from: can't read /var/mail/ in Python scripts

How to fix Android when developer options are not available for this user

How to install a WhatsApp bot based on Python