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`
Create a TUN/TAP device
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
Enable the bridge interface and give it an ip address
sudo ifconfig br0 up
sudo ifconfig br0 192.168.0.77/24
Or force interface to get IP address from DHCP
sudo dhclient br0
Configure the default route
sudo route add default gw 192.168.0.1
For easy copy paste
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
source: http://myhomelab.blogspot.ru/2011/12/add-loopbacks-in-ubuntu-for-gns3.html
P.S.
user@desktop:~$ cat /home/user/Dropbox/GNS3/tap_int.sh
#!/bin/bash
modprobe tun
sleep 1
sudo tunctl -t tap0
sleep 1
sudo ifconfig enp8s0 0.0.0.0 promisc up
sudo ifconfig tap0 0.0.0.0 promisc up
sleep 1
sudo brctl addbr br0
sudo brctl addif br0 tap0
sudo brctl addif br0 enp8s0
sleep 1
sudo ifconfig br0 up
sleep 1
sudo dhclient br0
sleep 1