Monday 3 March 2014

Add Loopbacks in Linux MInt for GNS3

This is a quick howto to connect a gns3 simulation to the physical pc to allow testing from the pc or configure access to the internet.


run gns3 as root "sudo gns3"
place a cloud onto your topology
configure the NIO TAP to use tap0

on linux:

first install the necessary tools

sudo apt-get install uml-utilities
sudo apt-get install bridge-utils
then

sudo tunctl -t tap0
sudo ifconfig tap0 10.200.200.1 netmask 255.255.255.252 up

then configure the router:
R1>enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface FastEthernet 0/0
R1(config-if)#ip address 10.200.200.2 255.255.255.252
R1(config-if)#no shutdown
Add a default route so that the router knows where to forward the internet traffic.
R1(config)#ip route 0.0.0.0 0.0.0.0 10.200.200.1

Try pinging the linux pc and the router from each other and you should get a reply.


to forward the traffic to the internet:


iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

iptables -A FORWARD -i tap0 -j ACCEPT

echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward








No comments:

Post a Comment