{"id":625,"date":"2011-09-28T05:11:32","date_gmt":"2011-09-28T09:11:32","guid":{"rendered":"http:\/\/www.xavignu.com\/?p=625"},"modified":"2011-09-28T05:11:32","modified_gmt":"2011-09-28T09:11:32","slug":"connecting-gns3-simulator-to-the-internet-part-2","status":"publish","type":"post","link":"https:\/\/www.xavignu.com\/?p=625","title":{"rendered":"Connecting GNS3 simulator to the Internet (part 2)"},"content":{"rendered":"<p>So now we need to configure a cloud to connect GNS3 to the laptop. We should already have tap0 up and running and <a href=\"http:\/\/www.netfilter.org\/\" target=\"blank_\">IPtables<\/a> configured to allow traffic as seen on the <a href=\"http:\/\/www.xavignu.com\/?p=603\" target=\"blank_\">previous post<\/a>.<\/p>\n<p>Below is a network topology diagram.<br \/>\n<br \/> <br \/>\n<a href=\"http:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/gns3.png\"><img loading=\"lazy\" src=\"http:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/gns3-300x182.png\" alt=\"GNS3 topology\" title=\"gns3\" width=\"300\" height=\"182\" class=\"aligncenter size-medium wp-image-626\" srcset=\"https:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/gns3-300x182.png 300w, https:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/gns3-1024x621.png 1024w, https:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/gns3.png 1280w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<br \/>\nWe need to create the cloud connecting it to tap0 interface. For that we edit the .net file containing the topology and add the following.<\/p>\n<p><text><br \/>\n    [[ROUTER R2]]<br \/>\n        model = 3640<br \/>\n        console = 2002<br \/>\n        aux = 2108<br \/>\n        cnfg = configs\/R2.cfg<br \/>\n        slot0 = NM-1FE-TX<br \/>\n        f0\/0 = nio_tap:tap0<br \/>\n        slot1 = NM-4T<br \/>\n        s1\/0 = R3 s1\/0<br \/>\n        slot2 = NM-1E<br \/>\n        e2\/0 = R1 f2\/0<br \/>\n        slot3 = NM-16ESW<br \/>\n        x = -21.0<br \/>\n        y = -61.0<br \/>\n<\/text><br \/>\nand for the cloud<br \/>\n<text><br \/>\n    [[Cloud C2]]<br \/>\n        x = -63.8566172588<br \/>\n        y = 84.919044975<br \/>\n        connections = R2:f0\/0:nio_tap:tap0<br \/>\n<\/text><br \/>\nNow save the configuration and restart GNS3.<\/p>\n<p>Now there should be connectivity to the gateway (192.168.1.1). To connect to the internet add a default gateway.<\/p>\n<p>Router2#<b>conf t<\/b><br \/>\nEnter configuration commands, one per line.  End with CNTL\/Z.<br \/>\nRouter2(config)#ip rou<br \/>\nRouter2(config)#ip route<br \/>\nRouter2(config)#<b>ip route 0.0.0.0 0.0.0.0 192.168.1.1<\/b><br \/>\nRouter2(config)#<b>do sh ip route<\/b><br \/>\nCodes: C &#8211; connected, S &#8211; static, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP<br \/>\n       D &#8211; EIGRP, EX &#8211; EIGRP external, O &#8211; OSPF, IA &#8211; OSPF inter area<br \/>\n       N1 &#8211; OSPF NSSA external type 1, N2 &#8211; OSPF NSSA external type 2<br \/>\n       E1 &#8211; OSPF external type 1, E2 &#8211; OSPF external type 2<br \/>\n       i &#8211; IS-IS, su &#8211; IS-IS summary, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2<br \/>\n       ia &#8211; IS-IS inter area, * &#8211; candidate default, U &#8211; per-user static route<br \/>\n       o &#8211; ODR, P &#8211; periodic downloaded static route<\/p>\n<p>Gateway of last resort is 192.168.1.1 to network 0.0.0.0<\/p>\n<p>     172.16.0.0\/16 is variably subnetted, 2 subnets, 2 masks<br \/>\nC       172.16.0.0\/30 is directly connected, Ethernet2\/0<br \/>\nD       172.16.0.0\/16 is a summary, 00:18:32, Null0<br \/>\n     10.0.0.0\/8 is variably subnetted, 2 subnets, 2 masks<br \/>\nC       10.0.0.0\/30 is directly connected, Serial1\/0<br \/>\nD       10.0.0.0\/8 is a summary, 00:18:32, Null0<br \/>\n     192.168.1.0\/30 is subnetted, 1 subnets<br \/>\nC       192.168.1.0 is directly connected, FastEthernet0\/0<br \/>\nS*   0.0.0.0\/0 [1\/0] via 192.168.1.1<br \/>\nRouter2(config)#<\/p>\n<p>We can see the connectivity below.<br \/>\n<br \/>\n<a href=\"http:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/router2.png\"><img loading=\"lazy\" src=\"http:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/router2-300x162.png\" alt=\"Connectivity to the internet\" title=\"router2\" width=\"300\" height=\"162\" class=\"aligncenter size-medium wp-image-635\" srcset=\"https:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/router2-300x162.png 300w, https:\/\/www.xavignu.com\/wp-content\/uploads\/2011\/09\/router2.png 900w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Also don&#8217;t forget to add the routes on your Linux box for the other routers.<\/p>\n<p>[11:07:13] xavi@lstkco14073: ~ $ <b>sudo ip route add 172.16.0.0\/30 dev tap0<\/b><br \/>\n[11:07:49] xavi@lstkco14073: ~ $ <b>sudo ip route add 10.0.0.0\/30 dev tap0<\/b><br \/>\n[11:08:13] xavi@lstkco14073: ~ $ <b>netstat -nr | grep tap<\/b><br \/>\n10.0.0.0        0.0.0.0         255.255.255.252 U         0 0          0 tap0<br \/>\n172.16.0.0      0.0.0.0         255.255.255.252 U         0 0          0 tap0<br \/>\n192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 tap0<br \/>\n[11:08:21] xavi@lstkco14073: ~ $ <b>ping -c 3 10.0.0.1<\/b><br \/>\nPING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.<br \/>\n64 bytes from 10.0.0.1: icmp_req=1 ttl=255 time=19.9 ms<br \/>\n64 bytes from 10.0.0.1: icmp_req=2 ttl=255 time=3.12 ms<br \/>\n64 bytes from 10.0.0.1: icmp_req=3 ttl=255 time=6.61 ms<\/p>\n<p>&#8212; 10.0.0.1 ping statistics &#8212;<br \/>\n3 packets transmitted, 3 received, 0% packet loss, time 2001ms<br \/>\nrtt min\/avg\/max\/mdev = 3.122\/9.878\/19.901\/7.229 ms<br \/>\n[11:08:39] xavi@lstkco14073: ~ $ <\/p>\n<p>That would be all. Comments and suggestions are more than welcome. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So now we need to configure a cloud to connect GNS3 to the laptop. We should already have tap0 up and running and IPtables configured to allow traffic as seen on the previous post. Below is a network topology diagram. We need to create the cloud connecting it to tap0 interface. For that we edit [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[30,56,22,6,70],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/pTQgt-a5","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/625"}],"collection":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=625"}],"version-history":[{"count":12,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/625\/revisions"}],"predecessor-version":[{"id":639,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=\/wp\/v2\/posts\/625\/revisions\/639"}],"wp:attachment":[{"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=625"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=625"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xavignu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=625"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}