Friday, August 20, 2010

CCNA - CCNP Certification - Hands-On Lab Configuring Two Cisco Routers

Objective: In this lab you will configure a simple network to allow two routers to route packets between to remote networks. The text that is in bold is the text you need to type during the lab. Requirements:


Two Cisco routers with one Ethernet port and one serial port.
Cisco IOS 10.0 or higher
One PC for consoling into routers with terminal emulation software
One serial cable
One Cisco rollover cable

Setup: Step 1: Physical Connections Connect the following interfaces:


Console: Connect your PC/terminal to the console port using a rollover cable and HyperTerminal (9600-8-N-1-no flow)
Ethernet: Connect Ethernet ports to a hub or a switch using a straight-through cable. Use a cross-over cable if going directly from the PC's NIC to the Ethernet (AUI) port on the router using a transceiver.
Serial: If going directly between two routers, don't forget to connect one port via the DTE cable and the other via the DCE cable.

Step 2: Boot up the routers Just say "no" to use the setup mode (setup dialogue). The setup mode will only allow you to configure the router with the basic features and not with any advanced features. If asked if you would like to terminate the auto configuration; say "yes". Let the routers finish booting.

Step 3: Host Name and Passwords Begin your configuration with the host name and passwords. This is to remind you of what router you are configuring and now's the time to start thinking about router security.

RouterA

router>en

router#config t Enter configuration commands, one per line. End with CNTL/Z.

router(config)#hostname RouterA (sets the router's name)

RouterA(config)#enable secret cisco (Sets the secret password for the router)

RouterA(config)#line vty 0 4 (there are five concurrent connections for the telnet ports coming into a Cisco 2500 router. We are setting the login password on all five of them)

RouterA(config-line)#login (This enables the router to require a login password for a telnet session to the router)

RouterA(config-line)#password cisco (this sets the login password for all 5 telnet sessions coming into the router as cisco)

RouterA(config-line)#exit

RouterA(config)#^Z (This is the key combination of control+z which takes you back to the privileged executive mode)

RouterA#

RouterB

router>en

router#config t Enter configuration commands, one per line. End with CNTL/Z.

router(config)#hostname RouterB (sets the router's name)

RouterB(config)#enable secret cisco (Sets the secret password for the router) RouterB(config)#line vty 0 4 (there are five concurrent connections for the telnet ports coming into a Cisco 2500 router. We are setting the login password on all five of them)

RouterB(config-line)#login (This enables the router to require a login password for a telnet session to the router)

RouterB(config-line)#password cisco (this sets the login password for all 5 telnet sessions coming into the router as cisco)

RouterB(config-line)#exit

RouterB(config)#^Z (This is the key combination of control+z which takes you back to the privileged executive mode)

FYI: Anytime you make a configuration change to a router and you come back to the privileged exec mode you need to save your changes to NVRAM. This ensures that if the router reboots, you won't loose your changes which are in the running-config which is volatile RAM. The following command(s) saves your changes to the startup-config.

RouterA#copy running-config startup-config

or

RouterA# copy run start

or

RouterA#wr me (short for write memory)

Step 4: Adding IP Addresses Adding IP addresses, is a basic function of configuring routers. Below is an example of configuring both an Ethernet and serial interface. For serial interface with the DCE cable you will need to also add the clocking with the clockrate command. Get the IP addresses from the network diagram.

RouterA RouterA#config t Enter configuration commands, one per line. End with CNTL/Z.

RouterA(config)#int e0

RouterA(config-if)#ip address 172.16.12.1 255.255.255.0

RouterA(config-if)# description LAN Network for

RouterA RouterA(config-if)# no shutdown

RouterA(config-if)#int s0

RouterA(config-if)#ip address 172.16.10.1 255.255.255.0 (RouterA will have the serial 0 with the DCE end of the serial cable. The other partner will have serial1 with the DTE end of the serial cable. Check the network diagram to confirm to see who has what interface)

RouterA(config-if)#clockrate 250000 (DCE interface only which is the s0 on RouterA)

RouterA(config-if)#no shutdown

RouterA(config-if)#description Network connection to RouterB

RouterB

RouterB#config t Enter configuration commands, one per line. End with CNTL/Z.

RouterB(config)#int e0

RouterB(config-if)#ip address 172.16.11.1 255.255.255.0

RouterB(config-if)# description LAN Network for RouterB

RouterB(config-if)# no shutdown

RouterB(config-if)#int s1

RouterB(config-if)#ip address 172.16.10.2 255.255.255.0

RouterB(config-if)#no shutdown

RouterB(config-if)#description Network connection to RouterA

Once both routers are configured properly, you should be able to use the ping command and ping the interface e0 on each of the routers from the neighboring router. If you do a show ip route on both routers and do not see the directly connected interfaces in the routing table, they are either not configured or they never came up. Confirm that the IP addressing took and the interfaces came up by using the show ip int and looking at the interfaces' status and ip address configuration. RouterA# show ip route RouterA# show ip int Do this on both routers.

Step 5a: Adding Dynamic Routing: RIP For this router to participate in a dynamic routing using a dynamic routing protocol like RIP or IGRP, you'll need to enable a routing protocol and advertise the directly connected networks that want advertised.. We only advertise the classful network address, not the subnet mask of the network.

RouterA

RouterA>en RouterA#config t Enter configuration commands, one per line. End with CNTL/Z. RouterA(config)#router RIP RouterA(config-router)#network 172.16.12.0

RouterB

RouterB>en RouterB#config t Enter configuration commands, one per line. End with CNTL/Z.

RouterB(config)#router RIP

RouterB(config-router)#network 172.16.11.0

FYI: We need to advertise the network, not any particular host. An example of that would be enabling RIP on RouterB. We want the other router (RouterA) to know that any packet destined for the network 172.16.11.0 can be sent to RouterB which has a directly connected 5 entry in it's routing table showing what interface to send the packet to; in this case its e0. If you route to 172.16.11.1, all your every going to route to, is the e0 on RouterB and nothing else. Test your configuration to ensure that it is configured properly by pinging from router to router. Check your routing table for entries that are preceded by a capital letter "R" to ensure that you are receiving routing updates using RIP. Ensure that your partner has finished configuring his router so that you can receive his updates. No updates, no ping. Do a show ip protocol to see what routing protocol is configured on the routers.

Step 5b: Adding Dynamic Routing: IGRP IGRP uses an autonomous system (AS) number or process id. This number must be the same on all routers wanting to share IGRP routing updates or they don't share. Turn RIP off before you turn on IGRP. For this lab we'll be using an AS number of 100.

RouterA

RouterA>en RouterA#config t

RouterA(config)#no router rip RouterA(config)#router igrp 100

RouterA(config-router)#network 172.16.12.0 (again, just the network portion of the IP for your Ethernet network, NO subnet mask)

RouterB

RouterB>en RouterB#config t Enter configuration commands, one per line. End with CNTL/Z.

RouterB(config)#no router rip

RouterB(config)#router igrp 100

RouterB(config-router)#network 172.16.11.0 (again, your Ethernet network IP NO Subnet Address)

Step 6: Adding Default Routes Good candidates for default routes are routers which are known as the boundary router. This is a router which is normally part of a stub network. Inside the stub network, the routers may be participating in a dynamic routing using a protocol like RIP, but only a static default route is needed to connect the stub network to the Internet.

RouterA

RouterA>en RouterA#config t RouterA(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.2

RouterB

RouterB>en RouterB#config t

RouterB(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.1

Step 7: Adding Static Routes A static route can be used for different reasons. One reason may be for a router to connect to another router in a lab. You'll need to turn off all routing protocols before you configure the router for static routing.

RouterA

RouterA>en

RouterA#config t

RouterA(config)#no router igrp 100

RouterA(config)#ip route 172.16.11.0 255.255.255.0 172.16.10.2 What we are saying here is: For RouterA to route to the network 172.16.11.0, go to the next hop interface which is the serial1 (172.16.10.2) attached to RouterB. Since RouterB knows about the directed connected Ethernet network of 172.16.11.0, it will have route for it in its routing table proceeded by the letter "C". (See next example)

RouterB#sh ip route (Output omitted) 172.16.0.0/24 is subnetted, 1 subnets C 172.16.0.0 is directly connected, Ethernet0 RouterB# RouterB

RouterB>en

RouterB#

RouterB#config t

RouterB(config)#no router igrp 100

RouterB(config)#ip route 172.16.12.0 255.255.255.0 172.16.10.1

Step 8: Testing and Monitoring At this point it is a good idea to start testing your network using various commands. Perform the following on both routers.

RouterA# show ip route

RouterA# show ip interface brief (This command shows the IP and status of all interface)

RouterA# show controller s0 (Shows whether or not the serial cable is DCE or DTE.)

RouterA# ping ip-address

RouterA# trace ip-address

RouterA# debug ip rip (Remember to turn debug off when done, use undebug all, no debug all or un all)

RouterA# terminal monitor (for using debug from a telnet session, otherwise debug output will go to the console. Caution: This will cause the debug output to go to all telnet sessions on the router.)

Show commands

RouterA# terminal no monitor(To turn off monitoring during a telnet session.)

RouterA# show cdp neighbors

RouterA# show ip protocols

RouterA# #show version

RouterA# #show flash

RouterA# show ip route (shows the routing table)

RouterA# show memory

RouterA# show stacks

RouterA# show buffers

RouterA# show arp

RouterA# show processes

RouterA# show processes cpu

RouterA# show tech-support

Step 9: Finishing up Once you have your routers up and working you may wish to run some commands to make working on Cisco routers easier and to stop some of the default annoying behavior of Cisco routers.

RouterA(config)# ip host RouterB 172.16.10.2 (This configures a host table entry for the name RouterB. So instead of having to remember the IP of RouterB to ping it, you can now ping it using its name, RouterB. It's the same as using a hosts file on a computer. If you just type in RouterB and hit enter, the router will assume you're wanting to telnet into RouterB using port 23)

RouterA(config)# no ip domain-lookup (When there is no DNS server and you miss spell a single word command, it will try to do a DNS lookup using a broadcast address of 255.255.255.255. To stop this lookup of a non-existent DNS server, we can turn off the DNS lookup capability using this command.)

RouterA(config)# banner motd #!!!!Warning! Authorized Access Only!!!!# (This message will be seen by anyone trying to logon to your router. The # sign is known as a delimiting character and is used to identify the text portion of the MOTD. Notice that the actual message starts and ends with the delimiting character)

RouterA(config)# no service-config (When you reboot a Cisco router, the default behavior is to try and find a configuration file on the network using a number of methods over a broadcast address of 255.255.255.255. To stop this annoying behavior, Use this command.)

RouterA(config)#no logging console (Each time you leave one level of the router and return to the previous level or bring an interface up, you get a read out on the console screen. If you get busy typing and configuring the router this can be distracting and annoying. Use this command to stop the logging of messages to the console screen.) And don't forget to...

RouterA# show running-config

RouterA# copy running-config startup-config

Friends Link : Temperature Data Logger

No comments:

Post a Comment