User:Rajendrameena

Network Operating Systems Page 1 2001 W.Buchanan/Napier University Worksheet 1 (Router Programming) Name: Programme: The Cisco emulator (eSIM) can be used to program each of the routers in the topology given in Figure 1. Initially you will see that you have to program five routers (identified with A, B, C, D and E). The basic tasks are: · Set-up hostname. This uses the hostname command. · Set-up IP addresses and subnet masks for each of the ports. This uses the ip address command. · Set-up an executive password. This uses the enable secret command. · Set-up login (console) and telnet (vty) passwords. This uses the password and login commands. · Set-up a routing protocol. This uses the network command. · Set-up a hosts name table. This uses the ip host command. · Show the status of the ports, and the running configuration. The command used for these are show protocols and show running-config. Figure 1: Router topology Network Operating Systems Page 2 2001 W.Buchanan/Napier University No Task Successfully Complete (tick) Notes 1 Start eSim a 2 Program router A (LAB_A) 3 Ping all the ports of LAB_A and make sure that they are responding. Also use the show running-config, and show protocols commands. 4 Show that you cannot make contact with any of the other routers. 5 Program router B (LAB_B) 6 Ping all the ports of LAB_B and make sure that they are responding. Also use the show running-config, and show protocols commands. 7 Ping the ports of LAB_A from LAB_B, and make sure that they are responding. 8 Ping the ports of LAB_B from LAB_A, and make sure that they are responding. 9 Telnet from LAB_A to LAB_B. Network Operating Systems Page 3 2001 W.Buchanan/Napier University 10 Telnet from LAB_B to LAB_A. 11 Program LAB_C, LAB_D and LAB_E. 12 Prove that you can ping LAB_A from LAB_E, and viceversa. 13 Prove that you can telnet from LAB_A to LAB_E, and vice-versa. Programming Router A Getting in privileged mode The router has two main modes: · User mode. This is the initial mode that the user goes into when they log onto the router. In this mode it is not possible to configure the router, and it is only possible to perform simple commands such as telnet and ping. · Executive mode. In this mode the full range of commands can be used, and the router can be programmed. The command which is used to go from user mode into executive mode is enable. If a password is set for the executive mode, the user must enter this before they can enter into the executive mode. The prompt should change from a ‘>’ to a ‘#’. The following gives an example: Router> enable Router# If at any time you cannot remember the syntax of a command type-in the command and then press the ‘?’ key. Setting hostname The hostname is set using the hostname command. This name is reflected in the prompt of the router, and makes it easier to identify the current router. For example to set the host of LAB_A to LAB_A: Network Operating Systems Page 4 2001 W.Buchanan/Napier University Router# config t Enter configuration commands, one per line. End with END. Router (config)# hostname LAB_A LAB_A (config)# Setting the secret password The secret password is used to enter into the executive mode. In the following case the password is defined as class. LAB_A (config)# enable secret class LAB_A (config)# exit LAB_A# exit LAB_A> enable Password: ccc Password: class LAB_A# Setting the IP addresses on the ports One of the most important things to set on the router is the IP address of each of the ports. These ports will be used as gateways out of the network segment to which they connect to. The interface command (or int for short) programs each of the interfaces. In the following example the three ports on the router are programmed with the required IP addresses, and subnet masks. The ports will not automatically come on-line, and will start in a shutdown mode. Thus the no shutdown command is used to start them up. LAB_A# config t LAB_A (config)# int e0 LAB_A (config-if)# ip address 192.5.5.1 255.255.255.0 LAB_A (config-if)# no shutdown LAB_A (config-if)# exit LAB_A (config)# int e1 LAB_A (config-if)# ip address 205.7.5.1 255.255.255.0 LAB_A (config-if)# no shutdown LAB_A (config-if)# exit LAB_A (config)# int s0 LAB_A (config-if)# ip address 201.100.11.1 255.255.255.0 LAB_A (config-if)# clock rate 56000 LAB_A (config-if)# no shutdown LAB_A (config-if)# exit Setting a routing protocol The router will not be able to connect to other routers unless it runs a routing protocols which is the same as the other routers. This allows the routers to determine the best path to a remote device. In this case the RIP protocol is set-up with the router rip command, and then each of the networks in which the router will broadcast its routing table are defined (using the network command): LAB_A (config)# router rip LAB_A (config-router)# network 192.5.5.0 LAB_A (config-router)# network 205.7.5.0 Network Operating Systems Page 5 2001 W.Buchanan/Napier University LAB_A (config-router)# network 201.100.11.0 LAB_A (config-router)# exit LAB_A (config)# Setting the line console password Passwords are important in providing a degree of security to the router. The are three main passwords to set: the executive password, the console password, and the remote login (vty) password. The vty password defines the telnet password, and the console password defines the initial login password. LAB_A (config)# Line con 0 LAB_A (config-line)# password cisco LAB_A (config-line)# login LAB_A (config-line)# exit LAB_A (config)# exit LAB_A # exit User Access Verification Password: cisco LAB_A> enable Password: class LAB_A # config t LAB_A (config)# The telnet password is set with: LAB_A (config)# Line vty 0 LAB_A (config-line)# password cisco LAB_A (config-line)# login LAB_A (config-line)# exit LAB_A (config)# exit Setting the hostnames table It is often difficult to remember the IP address of each of the ports, thus a router can be setup with its own hosts table, as shown next: LAB_A (config)# ip host LAB_A 192.5.5.1 205.7.5.1 201.100.11.1 LAB_A (config)# ip host LAB_B 201.100.11.2 219.17.100.1 199.6.13.1 LAB_A (config)# ip host LAB_C 223.8.151.1 204.204.7.1 199.6.13.1 LAB_A (config)# ip host LAB_D 210.93.105.1 204.204.7.2 LAB_A (config)# ip host LAB_E 210.93.105.2 LAB_A (config)# exit LAB # show running-config Determining if the ports are operating To see if the ports are up, and if they are connected to the other routers, the show protocols command is used. For example: LAB_A# show protocols E0 is up, line protocol is up Internet address is 192.5.5.1 Network Operating Systems Page 6 2001 W.Buchanan/Napier University E1 is up, line protocol is up Internet address is 205.7.5.1 S0 is up, line protocol is up Internet address is 201.100.11.1 The hosts table can also be viewed with show hosts.