Building a Network in GNS3 In this tutorial, you will create a network in GNS3 between two routers, and each router will have one host connected to it. The ultimate goal is to route data between network A and C so that two hosts will be able to communicate with one another. However, you will not configure the host in this lab. If everything is correct, the router R1 should be able ping the f0/0 interface of the router R2. Below is the topology for what this network will look like: There are the IP addresses that will be used: Network A: 192.168.101.0 / 255.255.255.0 R1 f 0/0: 192.168.101.1 / 255.255.255.0 Network B: 192.168.100.0 / 255.255.255.252 R1 s 0/0: 192.168.100.1 / 255.255.255.252 R2 s 0/0: 192.168.100.2 / 255.255.255.252 Network C: 192.168.102.0 / 255.255.255.0 R2 f 0/0: 192.168.102.1 / 255.255.255.0 1 of 1
A. Configuring Interfaces for R1 GNS3 allows you to add cards to different slots on a router. This portion of the tutorial will describe how to configure the slots, as well as the Cisco commands to set up the interfaces. By default, Cisco network interfaces are disabled and you must turn them on before they can be used. 1. Begin by opening GNS3 and creating a project named network. Check the box in front of Save nvrams and virtual hard drives and the box in front of Save IOS startup configurations. 2. Drag a c2691 router from the Nodes Types column to the empty workspace. By default, this router is referred to as R1. 3. Right click R1 and select Configure. In the tree to the left, select R1. Navigate to the Slots tab, and click on the drop down menu for slot 1. 4. There are a variety of choices listed. For this exercise, choose the NM 4T adapter. The router originally had two Fast Ethernet ports, but by modifying slot 1, it now has four additional serial ports. Click OK. Again, the serial port will be used to connect the two routers and the Fast Ethernet ports will be used to connect hosts to routers. 5. Right click R1 and click Start, then click Console. The router will boot and a console window to the router will open. 6. When the router has finished booting, type enable to enter privileged mode. R1>enable 7. Then, type config terminal to enter the configuration mode. R1#config terminal 2 of 2
8. From here, interfaces can be configured. Type int s0/0, which will enter the configuration for serial interface 0/0. In this exercise, you will use a serial connection to connect the two routers. R1(config)#interface s0/0 9. To enable the interface, type no shutdown. Shortly after doing so, the router should post that the interface is now up. R1(config)#no shutdown 10. Set the IP address of s0/0 to 192.168.100.1 with the subnet mask 255.255.255.252, type the following command: R1(config if)#ip address 192.168.100.1 255.255.255.252 11. Press ctrl + c to return back the privileged (or you can type exit twice). 12. Before saving the new configuration, type show running, which will display the running configuration. R1#show running When you see More on the screen, press the spacebar to view the next segment of data. Look for the s0/0 interface does it have the settings you specified? 13. Your changes have taken effect immediately, but if the router is shut down, the 3 of 3
changes will disappear. To save what you have done, type copy running config startup config, then press Enter to confirm. By doing so, your current configuration becomes the configuration that is loaded whenever the router is booted up. R1#copy running config startup config 14. Now, you will configure fast ethernet interface (fa 0/0). Type the following commands back to back to enter the interface configuration. R1#config terminal R1(config)#interface fa 0/0 13. Then, type no shutdown to bring the interface up and press Enter once more to enable the interface. R1(config)#no shutdown 14. Type the following command to set R1 s Fast Ethernet address to 192.168.101.1. R1(config if)#ip address 192.168.101.1 255.255.255.0 15. Press ctrl + c to return back the privileged (or you can type exit twice). 16. Before saving the new configuration, type show running, which will display the running configuration. R1#show running 17. To save what you have done, type copy running config startup config, then press Enter to confirm. R1#copy running config startup config B. Configuring Interfaces for R2 1. Drag a c2691 router from the Nodes Types column to the empty workspace. By 4 of 4
default, this router is referred to as R2. 2. Right click R2 and select Configure. In the tree to the left, select R2. Navigate to the Slots tab, and click on the drop down menu for slot 1. 3. For this exercise, choose the NM 4T adapter. The router originally had two Fast Ethernet ports, but by modifying slot 1, it now has four additional serial ports. Click OK. Again, the serial port will be used to connect the two routers and the Fast Ethernet ports will be used to connect hosts to routers. 4. Right click R2 and click Start, then click Console. The router will boot and a console window to the router will open. You need to repeat the configuration steps in part A and configure the interfaces as follows: s 0/0 192.168.100.2 / 255.255.255.252 fa 0/0 192.168.102.1 / 255.255.255.0 Basically, you need to follow the following commands: R2>enable R2#configure terminal R2(config)#interface s 0/0 R2(config if)#no shutdown R2(config if)#ip address 192.168.100.2 255.255.255.252 R2(config if)#exit R2(config)#interface fa 0/1 R2(config if)#no shutdown R2(config if)#ip address 192.168.102.1 255.255.255.0 R2(config if)#exit R2(config)#exit R2#copy running config startup config B. Connecting Nodes 5 of 5
1. Minimize the console windows so that the GNS3 workspace is visible. At the top bar, find the icon that resembles a connector. 2. Click on the icon and select Serial. This will allow you to attempt to create a serial connection between two nodes. Click on R1 and then click on R2, which will create a red line connecting the two nodes. To exit the Link feature, click on the red X icon where the connector icon previously was. 3. To the right, under Topology Summary, expand the trees for R1 and R2. More details are given regarding the connection that is in place. 4. From the Nodes Types column to the left, click and drag two Qemu hosts to the workspace. These devices are running microcore Linux OS, and they will be used as hosts in this exercise. 5. In the top bar, click on the connector icon again and select FastEthernet. Click on 6 of 6
R1 and then click on Qemu1 and select e0 to create a connection between the router and host. When finished, exit the Link feature by clicking the red X icon. 6. Repeat the previous step, but this time, draw the connection from R2 to Qemu2 C. Testing the Serial Connections 1. Now that the routers have been physically connected, they must be tested to see if the serial connection is running successfully. On the privileged console for R1 and R2, try the followings: Router 1 Success (y/n)? Router 2 Success (y/n)? 1 R1#ping 192.168.100.2 R2#ping 192.168.100.2 2 R1#ping 192.168.102.1 R2#ping 192.168.101.1 3 R1#ping 192.168.101.1 R2#ping 192.168.102.1 Discuss why some pings are successful, but others are not. D. IP Routing Tables Routing tables are necessary to tell routers where to forward their packets. To set a static route, 7 of 7
you will need the IP address, subnet mask, and the next hop address or interface. 1. On R1, type config t to enter configuration mode if you are not. R1#configure terminal 2. Then, type ip route 192.168.102.0 255.255.255.0 s0/0. This command will put any IP packet addressed to network 192.168.102.0 on serial interface s0/0. R1(config)#ip route 192.168.102.0 255.255.255.0 s0/0 3. Type exit to exit configuration mode, then type show ip route. The current routing table will be displayed. Do you see a static setting for your serial connection? R1(config)#exit R1#show ip route 4. On R2, in configuration mode, repeat these commands to set the routing table R2#configure terminal R2(config)#ip route 192.168.101.0 255.255.255.0 s0/0 R2(config)#exit R2#show ip route 5. Do you see a static setting for your serial connection? F. Testing Connections Again 1. Now that all interfaces and routing tables have been configured, test the following again. 8 of 8
Router 1 Success (y/n)? Router 2 Success (y/n)? 1 R1#ping 192.168.100.2 R2#ping 192.168.100.2 2 R1#ping 192.168.102.1 R2#ping 192.168.101.1 3 R1#ping 192.168.101.1 R2#ping 192.168.102.1 Review Assignment: Create the network below in GNS3. Demonstrate that any router can ping all interfaces of the other two routers. Test this for the R1, R2, and R3 router. Include the routing tables of the three routers as a picture in your report. (PS: use SM=255.255.255.0 for all networks and do not configure the hosts 192.168.1.5 and 192.168.4.5. They will be only used to create the connections to the routers). 9 of 9