Running GNS3 on Linux and trying to reach the outside world, you will not be able to use your host PC to telnet to the virtual routers unless you create loopbacks. see related post in GNS3 forum
Below I post the steps for creating loopback on Ubuntu. After that you will be able to use your PC to telnet or ping to the virtual routers. (more details here)
First we need to install the utility programs and bridge-utils to be able to create network bridges
sudo apt-get install uml-utilities
sudo apt-get install bridge-utils
Load module for tunneling
modprobe tun
Backup the current interfaces file with a copy (that has the current date)
sudo cp /etc/network/interfaces /etc/network/interfaces.`date +%F-%T`
The setup needs to be done as root, but once that's done, there is no need for root assistance. Setting up the device is done as follows
sudo tunctl -t tap0
Remove ip addressing and set eth0 and tap0 to promiscuous mode
sudo ifconfig eth0 0.0.0.0 promisc up
sudo ifconfig tap0 0.0.0.0 promisc up
Create a new bridge interface
sudo brctl addbr br0
Check the created bridge
brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no
Add tap0 and eth0 to the bridge group
sudo brctl addif br0 tap0
sudo brctl addif br0 eth0
To see the new interfaces under the bridge brctl show
bridge name bridge id STP enabled interfaces
br0 8000.001fc675588b no eth0
tap0
sudo ifconfig br0 up
sudo ifconfig br0 192.168.0.77/24
sudo dhclient br0
sudo route add default gw 192.168.0.1
sudo tunctl
sudo ifconfig eth0 0.0.0.0 promisc up
sudo ifconfig tap0 0.0.0.0 promisc up
sudo brctl addbr br0
sudo brctl addif br0 tap0
sudo brctl addif br0 eth0
sudo ifconfig br0 up
sudo ifconfig br0 192.168.0.77/24
sudo route add default gw 192.168.0.1
My example in GNS3
Create the cloud, then right on it and go to configuration
Then goto NIO TAP - and type tap0
Example of Cloud configuration
Router#show arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.0.1 6 000d.29aa.b1b1 ARPA FastEthernet1/0
Internet 192.168.0.88 - ca00.0c26.001c ARPA FastEthernet1/0
Internet 192.168.0.104 6 3a16.33c4.9982 ARPA FastEthernet1/0
Internet 192.168.0.105 0 Incomplete ARPA
On R3
interface FastEthernet1/0
ip address 192.168.0.88 255.255.255.0
On PC
ip addr show
2: eth0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
5: tap0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN
inet 192.168.0.104/24 brd 192.168.0.255 scope global br0
From R3 to PC
R3#ping 192.168.0.104
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.104, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 4/8/12 ms
Router#ping 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/11/24 ms
From PC to R3
ping 192.168.0.88
PING 192.168.0.88 (192.168.0.88) 56(84) bytes of data.
64 bytes from 192.168.0.88: icmp_req=1 ttl=255 time=4.80 ms
64 bytes from 192.168.0.88: icmp_req=2 ttl=255 time=2.22 ms
14 comments:
Thank you so much, I try with other blogs, but yours is the better explained.
Thanks Alex
Thanks a lot for this. Valuable information. Finally got this working..
Thanks
Awesome bro!! It perfectly works! Thanks!!
Thanks Leonardo.
Outstanding!!! thank you! :)
Thanks
Thanks a lot mate! I was able to configure GNS3 + tap0 on Elemental Linux.
Cheers
Konrad
Thanks Konrad.
Very well documented- clearly explained. You Rock !! thank you very much for this fantastic guide. Worked like a charm.
I was able to run the commands but when I went to add it to GNS is said Tap0 didn't have a connection but br0 did and the lab itself works ie i can ping to and from my virtual router to a virtual pc but not to the linux box it is running on.
Your guide says select Tap0 but br0 is what I saw it configured.
It appears you link Tap0 and eth0 to br0.
How did you get your GNS to see Tap0?
Hi B Green
when configuring the cloud, there are options for :
|Ethernet|NAT|UDP|TAP |UNIX|VDE|NUL|Misc|
use TAP and type tap0
If you go through option Ethernet yes it cannot see tap interface but typing "tap0" will accept it but might not work at the end.
Bravo re stellara poli kalo arthro...
How you make the interface permanent? after I rebooted the server the config was gone.
Thanks,
Stelios
Post a Comment