skip to main | skip to sidebar
Showing posts with label CCNP Routing. Show all posts
Showing posts with label CCNP Routing. Show all posts

Monday, July 7, 2008

Router Connectivity Tools

0 comments
TELNET
Telnet is a virtual terminal protocol that is part of the TCP/IP protocol suite. Telnet allows you to make connections to remote devices, gather information, and run programs. After your routers and switches are configured, you can use Telnet to configure and check your routers and switches remotely. You can run telnet by typing telnet along with the IP address from the command line or just the IP address (an attempt will be made to open a telnet connection to the IP address). Before you can login via telnet you will have to enable logins and set the VTY password. Telnet allows a user at one site to establish a TCP connection to a login server at another site, and then passes the keystrokes from one system to the other. Telnet can accept either an IP address or a fully qualified domain name as the remote system address. Telnet tests connectivity up to the application layer of the OSI model.In short, Telnet offers three main services:
Network virtual terminal connection
Option negotiation
Symmetric connection
The Cisco Systems implementation of Telnet supports the following Telnet options:
Remote echo
Binary transmission
Suppress go ahead
Timing mark
Terminal type
Send location
Terminal speed
Remote flow control
X display location
Telnet to devices
Below is an example telnet session, I telneted from the router to a Linux server. {Never telnet and login as the root user, telnet sends passwords in plain text. If you must login remotely to a server as root, use Secure Shell SSH instead}. Router_2>192.168.1.70 Trying 192.168.1.70 ... Open Welcome to SuSE Linux (i386) - Kernel 2.4.5 (pts/0). suse login: lxuser Password: lxuser@suse~ >
Below is an example telnet session, I telneted into another router. Router_2>192.168.1.1 Trying 192.168.1.1 ... Open User Access Verification Password: Router3>
You can telnet into multiple devices simultaneously, telnet into the first device then switch back to the original device by pressing the following keys: [Ctrl]+[Shift]+6, let go and then press X.
Checking Telnet Users
You can list all active consoles and VTY ports in use with the show users command. The asterisk denotes who entered the command. Host(s) shows outgoing connections. Idle is the time in minutes since a user has typed something. Location is either the hardwired location for the line or, if there is an incoming connection, the host the incoming connection is from.Router3#show users Line User Host(s) Idle Location 0 con 0 idle* 2 vty 0 mb idle 0 SUSE.BELL.NET
Checking Telnet Sessions
To see the connections made from your router to a remote host, use the show sessions command. The asterisk denotes the console was the last session used. Host shows the remote connection to which the router is connected through a Telnet session. Address is the address of the remote host. Byte is the number of unread bytes that are waiting for the user to see on the connection. Idle is the interval (in minutes) since data was last sent on the line. Conn Name is the Assigned name of the connection. Router3#show sessions Conn Host Address Byte Idle Conn Name 1 192.168.1.1 192.168.1.1 0 0 192.168.1.1 * 2 192.168.1.2 192.168.1.2 0 0 192.168.1.2
Ending Telnet Sessions
There are a couple of different ways to end telnet sessions. They are the exit ordisconnect [session number, session name] commands.
You can disconnect users with the clear line [number] command, you can see the users with the show users command.
TRACE
Trace can be used to show the path a packet takes through the internetwork to a remote host. Trace is similar to the windoze tracert command or the UNIX traceroute command.
PING
You can use ping to test network connectivity and test name resolution. Router_2#ping ? WORD Ping destination address or hostname apollo Apollo echo appletalk Appletalk echo clns CLNS echo decnet DECnet echo ip IP echo ipx Novell/IPX echo vines Vines echo xns XNS echo
An example ping session. Router_2>en Router_2#ping 192.168.1.70 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.70, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
Name Resolution
In order to use hostnames instead of IP address to connect to remote devices, you need a method to resolve names. One method is to use a host table and another is to use a DNS (Domain Name System) Server.
Host Table
The syntax for building a host table is: ip host [name] [tcp port #] [IP_address]. The command is used in global configuration mode (conf t) and you can assign up to eight IP address to a hostname. To see the host table use the command show hosts.
DNS Server
If you have many devices and don't want to create a host table at each device, you can use a central DNS server to resolve hostnames. DNS lookups are enabled by default and can be disabled with the following command in global configuration mode no ip domain-lookup. To specify the DNS server to use, use the command ip name-server [ip_address] in global configuration mode. The last command you should use to enable DNS resolution of hostnames is to specify the domain you are in with the command ip domain-name [domain] since DNS server resolve FQDN (Fully Qualified Domain Names).Here is how to set up a DNS server in Linux (BIND 8)Here is how to set it up in NT 4.0. Router_2>en Router_2#conf t Enter configuration commands, one per line. End with CNTL/Z. Router_2(config)#ip domain-lookup Router_2(config)#ip name-server 192.168.1.70 Router_2(config)#ip domain-name bell.net Router_2(config)#^Z
After entering the domain information, you can telnet and ping using the hostnames. Every hostname will be cached for faster access next time

Configuration Register

0 comments
Routers use a 16-bit software configuration register, with which you can set specific system parameters. Settings for the software configuration register are written into nonvolatile random access memory (NVRAM).
Some reasons for changing the software configuration register settings are as follows:
To set and display the configuration register value
To force the system into the ROM monitor or boot ROM
To select a boot source and default boot filename
To enable or disable the Break function
To control broadcast addresses
To set the console terminal baud rate
To load operating software from Flash memory
To enable booting from a Trivial File Transfer Protocol (TFTP) server
To recover a lost password
To manually boot the system using the boot command at the bootstrap program prompt.
To force the switch router to boot automatically from the system bootstrap software (boot image) or from its default system image in onboard Flash memory, and read any boot system commands that are stored in the configuration file in NVRAM
Boot Field
Config Register #
2
1
0
2
Bit Number
15 14 13 12
11 10 9 8
7 6 5 4
3 2 1 0
Binary
0 0 1 0
0 0 0 1
0 0 0 0
0 0 1 0
The lowest four bits of the configuration register (bits 3, 2, 1, and 0) form the boot field. The order in which the switch/router looks for system bootstrap information depends on the boot field setting in the configuration register.
When the boot field is set to either 0 or 1 (0-0-0-0 or 0-0-0-1), the system ignores any boot instructions in the system configuration file and the following occurs:
When the boot field is set to 1 (the factory default), you will boot from an IOS image stored in ROM.
When the boot field is set to 0, you must boot the operating system manually by giving a boot command to the system bootstrap program, or ROM monitor.
Boot Command
You can enter the boot command only, or include additional boot instructions with the command, such as the name of a file stored in Flash memory or a file that you specify for booting from a network tftp server.
If you use the boot command without specifying a file or any other boot instructions, the system boots from the default Flash image (the first image in onboard Flash memory). Otherwise, you can instruct the system to boot from a specific Flash image (using the boot system flash filename command), or boot from a network server by sending broadcast TFTP requests (using the boot system filename command), or by sending a direct TFTP request to a specific server (using the boot system filename ip address command).
You can also use the boot command to boot images stored in the Personal Computer Memory Card International Association (PCMCIA) Flash memory cards in the route processor. If you set the boot field to any bit pattern other than 0 or 1, the system uses the resulting number to form a filename for booting over the network. The system uses the filename to invoke the system image by booting over the net. However, if the configuration file contains any boot instructions, the system uses those boot instructions instead of the filename it computed from the configuration register settings.
You must set the boot field for the boot functions you require. For more detailed information on the software configuration register features, refer to the following sections.
Changing the Software Configuration Register
Settings for the software configuration register are written into NVRAM. The factory default value for Cisco router is 0x2102.
You can change the default configuration register setting with the enabled config-mode command config-register. Use a hexadecimal number as the argument to this command. For example, the command Router(config)# config-register 0x2100
configures the router to boot to ROM monitor mode.
A Summary of Boot Tasks and Their Register Values
To change the boot field and leave all the other bits set to their default values, follow these guidelines:
To enter the ROM monitor (primarily a programmer's environment), set the configuration register value to 0x2100. This value sets the boot field bits to 0-0-0-0.
From the ROM monitor, boot the operating system manually by issuing the boot command at the ROM monitor prompt.
To boot the system automatically from ROM, set the configuration register to 0x2101. This value sets the boot field bits to 0-0-0-1.
To configure the system to use the boot system commands in NVRAM, set the configuration register to any value from 0x2102 to 0x210F. These values set the boot field bits to 0-0-1-0 through 1-1-1-1.
Software Configuration Register
Bit Number
Hexadecimal
Meaning
00 to 03
0x0000 to 0x000F
Boot field
06
0x0040
Causes system software to ignore NVRAM contents
07
0x0080
OEM bit enabled
08
0x0100
Break disabled
09
0x0200
Use secondary bootstrap
10
0x0400
IP broadcast with all zeros
11 to 12
0x0800 to 0x1000
Console line speed (default is 9600 baud)
13
0x2000
Boot default Flash software if network boot fails
14
0x4000
IP broadcasts do not have network numbers
15
0x8000
Enable diagnostic messages and ignore NVRAM contents

Configuration Register Boot Field
Boot Field
Meaning
Used For:
00
ROM monitor mode
To boot to ROM monitor mode, set the configuration register to 2100. You must then manually boot the router with the b command. The router will show a rommon> prompt.
01
Boot image from ROM
To boot an IOS image stored in ROM, set the configuration register to 2101. The router will show the router(boot)> prompt.
02 to 0F
Specifies a default boot filename
Any value from 2102 to 210F tells the router to use the boot commands specified in NVRAM.
Understanding the Boot Field Commands
The lowest four bits of the software configuration register (bits 3, 2, 1, and 0) form the boot field. The boot field specifies a number in binary form which you have to convert to Hexadecimal to use in the configuration register. If you set the boot field value to 0, you must boot the operating system manually by entering the boot command at the bootstrap prompt ( either > or for newer platforms rommon> ).
Definitions of the Boot Command Options
Command
Function
boot
Boots the default system software from Flash memory.
boot flash [filename]
Boots the first file in onboard Flash memory. The optional filename argument is the name of the system image file to boot from onboard Flash memory.
boot filename [ip address]
Boots from server host using TFTP. IP address of the TFTP server on which the system image resides. If omitted, this value defaults to the IP broadcast address of 255.255.255.255
Changing Register Settings While Running System Software
To change the configuration register while running the system software, follow these steps:
Step 1 At the privileged EXEC prompt (Router#), enter the configure terminal command to enter global configuration mode. Router#configure terminal Router(config)#
Step 2 Set the contents of the configuration register by entering the config-register value configuration command, where value is a hexadecimal number preceded by 0x as in the following example: Router(config)# config-register 0x2142
Step 3 Press Ctrl-Z to exit Global Configuration mode.
Step 4 Display the current configuration register value, which will be used at the next system reload, by entering the show version command.
The value is displayed on the last line of the screen display, as in the following example: Configuration register is 0x2102 (will be 0x2142 at next reload)
Step 5 Restart the router.
Changes to the configuration register take effect only when the system reloads. Router# reload Proceed with reload? [confirm] %SYS-5-RELOAD: Reload Requested

Routing Protocols RIP and IGRP

0 comments
In global configuration mode enter router ? to see the available routing protocols. Router3>en Router3#conf t Enter configuration commands, one per line. End with CNTL/Z. Router3(config)#router ? bgp Border Gateway Protocol (BGP) egp Exterior Gateway Protocol (EGP) eigrp Enhanced Interior Gateway Routing Protocol (EIGRP) igrp Interior Gateway Routing Protocol (IGRP) isis ISO IS-IS iso-igrp IGRP for OSI networks mobile Mobile routes odr On Demand stub Routes ospf Open Shortest Path First (OSPF) rip Routing Information Protocol (RIP) static Static routes
Routing Information Protocol (RIP)
The Routing Information Protocol (RIP) is a distance-vector protocol that uses hop count as its metric. RIP is widely used for routing traffic in the global Internet and is an interior gateway protocol (IGP), which means that it performs routing within a single autonomous system. RIP only uses hop count to determine the best route to a remote network, RIP has a maximum hop count of 15, 16 is deemed unreachable. RIP works well in small internetworks, but is inefficient for large networks. RIP is susceptible to all the problems normally associated with distance vector routing protocols. It is slow to converge and forces routers to learn network information only from neighbors. RIP version 1 uses classful routing (all devices in the network must use the same subnet mask because RIP version 1 doesn't send updates with subnet information). RIP version 2 uses classless routing and does send subnet mask information with route updates. RIP networks need the same hop count to load balance multiple links.
Routing Updates
RIP sends its complete routing table out to all active interfaces at regular intervals (every 30 seconds) and when the network topology changes. When a router receives a routing update that includes changes to an entry, it updates its routing table to reflect the new route. The metric value for the path is increased by one, and the sender is indicated as the next hop. RIP routers maintain only the best route (the route with the lowest metric value) to a destination. After updating its routing table, the router immediately begins transmitting routing updates to inform other network routers of the change. These updates are sent independently of the regularly scheduled updates that RIP routers send.
RIP Routing Metric
RIP uses a single routing metric (hop count) to measure the distance between the source and a destination network. Each hop in a path from source to destination is assigned a hop-count value, which is typically 1. When a router receives a routing update that contains a new or changed destination-network entry, the router adds one to the metric value indicated in the update and enters the network in the routing table. The IP address of the sender is used as the next hop.
RIP prevents routing loops from continuing indefinitely by implementing a limit on the number of hops allowed in a path from the source to a destination (15 hops). If a router receives a routing update that contains a new or changed entry, and if increasing the metric value by one causes the metric to be infinity (that is, 16), the network destination is considered unreachable.
Stability Features
To adjust for rapid network-topology changes, RIP specifies a number of stability features that are common to many routing protocols. RIP, for example, implements the split-horizon and hold-down mechanisms to prevent incorrect routing information from being propagated. In addition, the RIP hop-count limit prevents routing loops from continuing indefinitely.
RIP Timers
Route Update Timer - The routing-update timer clocks the interval between periodic routing updates. It is usually set to 30 seconds.
Route Invalid TImer - The Route Invalid Timer determines the length of time (90 seconds) before a route is considered invalid. If it doesn't receive an update for the route it sets the route as invalid and notifies its neighbors.
Route Flush Timer - The Route Flush Timer sets the time between when a route becomes invalid and its removal from the routing table (240 seconds). Time must be longer than invalid timer so it can tell its neighbors about the route.
Configuring RIP

Using the sample network below, we'll enable RIP routing for the network.
The network's configuration is as follows:
Router
Interface Addresses
Network to Next Hop Router
Router1
E0 - 172.20.10.1 /24S0 - 172.20.1.1 /24
Router1 to Router2172.20.1.0/24
Router2
E0 - 172.20.20.1 /24S0 - 172.20.1.2 /24S1 - 172.20.2.1 /24
Router2 to Router1 172.20.1.0/24 Router2 to Router3 172.20.2.0/24
Router3
E0 - 172.20.30.1 /24E1 - 172.20.35.1 /24S0 - 172.20.2.2 /24
Router3 to Router2 172.20.2.0/24
Use the command router rip and tell the RIP protocol which network to advertise (network ). Routers send RIP version 1 by default and RIP v.1 is classful, which means all the devices in the network need to use the same subnet mask. The network is entered in using the classful boundary and RIP will find the subnets to advertise since all the networks are using the same subnet mask (/24). Below is the actual configuration for the above sample network, the interface configurations are also shown for completeness.
Router1 Router1> enable Router1# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router1(config)# interface e0 Router1(config-if)# ip address 172.20.10.1 255.255.255.0 Router1(config-if)# no shutdown Router1(config-if)# interface s0 Router1(config-if)# ip address 172.20.1.1 255.255.255.0 Router1(config-if)# no shutdown Router1(config-if)# exit Router1(config)# router rip Router1(config-router)# network 172.20.0.0
Router2 Router2> enable Router2# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router2(config)# interface e0 Router2(config-if)# ip address 172.20.20.1 255.255.255.0 Router2(config-if)# no shutdown Router2(config-if)# interface s0 Router2(config-if)# ip address 172.20.1.2 255.255.255.0 Router2(config-if)# no shutdown Router2(config-if)# interface s1 Router2(config-if)# ip address 172.20.2.1 255.255.255.0 Router2(config-if)# no shutdown Router2(config-if)# exit Router2(config)# router rip Router2(config-router)# network 172.20.0.0
Router3 Router3> enable Router3# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router3(config)# interface e0 Router3(config-if)# ip address 172.20.30.1 255.255.255.0 Router3(config-if)# no shutdown Router3(config-if)# interface e1 Router3(config-if)# ip address 172.20.35.1 255.255.255.0 Router3(config-if)# no shutdown Router3(config-if)# interface s0 Router3(config-if)# ip address 172.20.2.2 255.255.255.0 Router3(config-if)# no shutdown Router3(config-if)# exit Router3(config)# router rip Router3(config-router)# network 172.20.0.0
Viewing the routing table
You can use the show ip route command to view the router's routing table. Router3#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 172.20.0.0/24 is subnetted, 6 subnets R 172.20.1.0 [120/2] via 172.20.2.1, 00:00:04, Serial0 R 172.20.10.0 [120/2] via 172.20.2.1, 00:00:04, Serial0 R 172.20.20.0 [120/2] via 172.20.2.1, 00:00:04, Serial0 C 172.20.2.0 is directly connected, Serial0 C 172.20.35.0 is directly connected, Ethernet1 C 172.20.30.0 is directly connected, Ethernet0
Stopping RIP Propagation
Use the passive-interface command to stop RIP broadcasts from going out an interface. The interface will still receive RIP updates, but it won't send them on the network that the interface is connected to. Router3(config)# router rip Router3(config-router)# passive-interface serial 1
Interior Gateway Routing Protocol (IGRP)
The Interior Gateway Routing Protocol (IGRP) is a proprietary routing protocol that was developed in the mid-1980s by Cisco Systems, Inc. Cisco's principal goal in creating IGRP was to provide a robust protocol for routing within an autonomous system (AS). IGRP has a maximum hop count of 255, but defaults to 100. IGRP uses bandwidth and line delay by default for determining the best route in an internetwork (Composite Metric).
IGRP Protocol Characteristics
IGRP is a distance-vector interior gateway protocol (IGP). Distance-vector routing protocols call for each router to send all or a portion of its routing table in a routing-update message at regular intervals (every 90 seconds) to each of its neighboring routers. As routing information proliferates through the network, routers can calculate distances to all nodes within the internetwork. IGRP uses a combination (vector) of metrics. Internetwork delay, bandwidth, reliability, and load are all factored into the routing decision. Network administrators can set the weighting factors for each of these metrics. IGRP uses either the administrator-set or the default weightings to automatically calculate optimal routes.
Stability Features
IGRP provides a number of features that are designed to enhance its stability. These include hold-downs, split horizons, and poison-reverse updates.
Hold-downs are used to prevent regular update messages from inappropriately reinstating a route that might have gone bad. When a router goes down, neighboring routers detect this via the lack of regularly scheduled update messages. These routers then calculate new routes and send routing update messages to inform their neighbors of the route change. This activity begins a wave of triggered updates that filter through the network. These triggered updates do not instantly arrive at every network device, so it is therefore possible for a device that has yet to be informed of a network failure to send a regular update message (indicating that a route that has just gone down is still good) to a device that has just been notified of the network failure. In this case, the latter device would contain (and potentially advertise) incorrect routing information. Hold-downs tell routers to hold down any changes that might affect routes for some period of time. The hold-down period usually is calculated to be just greater than the period of time necessary to update the entire network with a routing change.
Split horizons derive from the premise that it is never useful to send information about a route back in the direction from which it came. Although hold-downs should prevent this, split horizons are implemented in IGRP because they provide extra algorithm stability.
Split horizons should prevent routing loops between adjacent routers, but poison-reverse updates are necessary to defeat larger routing loops. Increases in routing metrics generally indicate routing loops. Poison-reverse updates then are sent to remove the route and place it in hold-down. In Cisco's implementation of IGRP, poison-reverse updates are sent if a route metric has increased by a factor of 1.1 or greater.
IGRP Timers
Update Timer - The update timer specifies how frequently routing update messages should be sent. The IGRP default for this variable is 90 seconds.
Invalid Timer - The invalid timer specifies how long a router should wait, in the absence of routing-update messages about a specific route before declaring that route invalid. The IGRP default for this variable is three times the update period.
Hold down Timer- The hold-time variable specifies the hold-down period. The IGRP default for this variable is three times the update timer period plus 10 seconds.
Flush Timer - Finally, the flush timer indicates how much time should pass before a route should be flushed from the routing table. The IGRP default is seven times the routing update period.
Configuring IGRP
Same as RIP except you need an Autonomous System (AS) number when specifying the routing protocol. All routers in the same Autonomous System need the same AS in order to communicate with each other. If your network doesn't already have an autonomous number, you are free to use any one you like. Router3> enable Router3# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router3(config)# router igrp ? <1-65535> Autonomous system number Router3(config)# router igrp 200 Router3(config-router)# network 172.30.0.0
Load Balancing
To provide additional flexibility, IGRP permits multipath routing. Dual equal-bandwidth lines can run a single stream of traffic in round-robin fashion, with automatic switchover to the second line if one line goes down. Also, multiple paths can be used even if the metrics for the paths are different. If, for example, one path is three times better than another because its metric is three times lower, the better path will be used three times as often. Only routes with metrics that are within a certain range of the best route are used as multiple paths. IGRP can load balance up to 6 unequal links. To load balance IGRP over unequal links the variance command is needed to control the load balancing between the best metric and the worst acceptable metric.traffic shared balanced command is used to have the routers share inversely proportional to the metrics (i.e. balanced).traffic shared min command tells the IGRP routing process to use routes that have only minimum costs. Router3# conf t Enter configuration commands, one per line. End with CNTL/Z. Router3(config)# router igrp 5 Router3(config-router)# variance 20 Router3(config-router)# traffic-share balanced Router3(config-router)# traffic-share min
Verifying Configurations
The show protocols command shows the network layer addresses for each interface. Router1# show protocols Global values: Internet Protocol routing is enabled Ethernet0 is up, line protocol is up Internet address is 192.168.1.1/24 Serial0 is up, line protocol is up Internet address is 10.128.22.1/24 Serial1 is up, line protocol is up Internet address is 10.128.23.1/24
The show ip protocols command shows the routing protocols that are configured on the router. Information includes the Autonomous System number, routing timers, networks being advertised, gateways, and administrative distances. Router1#show ip protocols Routing Protocol is "rip" Sending updates every 30 seconds, next due in 25 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Redistributing: rip Default version control: send version 1, receive any version Interface Send Recv Key-chain Ethernet0 1 1 2 Serial0 1 1 2 TokenRing0 1 1 2 Routing for Networks: 10.128.22.0 Routing Information Sources: Gateway Distance Last Update 10.128.22.3 120 00:00:03 Distance: (default is 120)
The debug ip rip command displays routing updates as they are sent and received to the console screen. This command places very high processing demands on your router and could affect network performance. If you are using telnet to configure the router, you will need to use the terminal monitor command to see the output from debug. Turn off debugging with the undebug all or nodebug all commands
The debug ip igrp [events transactions] command is used to display routing information for IGRP.
The events command shows a summary of the IGRP routing info that is running on the network. Information about individual routers isn't shown with this command.
The transactions command show message requests from neighbor routers asking for updates and the broadcasts sent to them.
Turn off debugging with the undebug all or nodebug all commands

Routing Protocols

0 comments
Routing is the process of directing packets from a source node to a destination node on a different network. Getting packets to their next hop requires a router to perform two basic activities: path determination and packet switching.
Path determination
Involves reviewing all paths to a destination network and choosing the optimal route. To determine the optimal route, information is put in a route table, which includes information such as destination network, the next hop, and an associated metric.
Packet switching
Involves changing a packet's physical destination address to that of the next hop (the packet's logical destination and source addresses will stay the same).
Information a Router needs to know to route a packet
Destination address.
Neighbor routers.
Possible routes to all remote networks.
The best route to each network.
How to maintain and verify routing information.
Routers learn about remote networks from neighboring routers or an administrator. The router then builds a routing table that tells how to get to the remote networks. Routes are either directly connected, static, or dynamic. Static routes are entered in by the administrator. Dynamic routes are learned from neighboring routers using routing protocols. In dynamic routing, the routers update each other at set intervals. Changes cause the routers to update all the other routers. If a routers receives a packet with a destination network not in its routing tables, it will discard the packet. To show the IP routing tables on a Cisco router use the show ip route command: Router_2#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 172.16.0.0/24 is subnetted, 7 subnets C 172.16.30.0 is directly connected, Ethernet0 C 172.16.40.0 is directly connected, Serial1 C 172.16.20.0 is directly connected, Serial0 I 172.16.10.0 [100/1] via 172.16.20.1, 00:00:01, Serial0 I 172.16.15.0 [100/1] via 172.16.20.1, 00:00:01, Serial0 I 172.16.55.0 [100/1] via 172.16.40.2, 00:00:14, Serial1 I 172.16.50.0 [100/1] via 172.16.40.2, 00:00:14, Serial1
Static Routing
The process of manually adding routes in each router's routing table. The administrator configures the destination network, next hop, and appropriate metrics. The route doesn't change until the network administrator changes it.
Advantages
No overhead on router CPU.
No bandwidth usage between links.
Security (only administrator adds routes).
Disadvantages
Administrator must really understand internetwork and how each router is connected.
If a new network is added, administrator must update all routers.
Not practical on large networks as it is time intensive.
Uses syntax of: ip route [destination_network] [subnet_mask] [next_hop_address exit_interface] [administrative_distance] [permanent]
Example of static route Router3(config)#ip route 192.168.1.0 255.255.255.0 serial0 permanent
Default Routing
A default route, which will point to a router, can be established to receive and attempt to process all packets for which no route appears in the routing table instead of discarding them. Only used when there is only 1 exit interface on a router. Same as static route with the ip route command, but use 0.0.0.0 0.0.0.0 for the IP network and subnet mask followed by the next hop router's common interface. Have to also use the ip classless command since there aren't any routes in the routing table. ip classless is enabled by default in IOS version 12. Router3(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2 Router3(config)#ip classless
Dynamic Routing
Dynamic routes adjust to changes within the internetwork environment automatically. When network changes occur, routers begin to converge by recalculating routes and distributing route updates. The route update messages spread through the network, which causes other routers to recalculate their routes. The process continues until all routes have converged. Uses protocols to find and update routes on a routing table. It uses CPU time and consumes bandwidth between links. The routing protocol defines the rules used by the routers when they communicate with each other.
There are two types of routing protocols on internetworks, Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP). IGP is used in networks in the same administrative domain. EGPs are used to communicate between the domains.
Administrative Distances
Used to note the reliability of routing information received on a router from a neighbor router. ADs range from 0-255. 0 is the most trusted and 255 means the route won't be used.
Route Source
Default Distance
Connected interface
0
Static Route
1
EIGRP
90
IGRP
100
OSPF
110
RIP
120
External EIGRP
170
Unknown
255
The Three Classes of Routing Protocols
Distance Vector
Uses the distance to a remote network to find the best path. Each time a packet goes through a router, it is called a hop. The route with the least number of hops is determined to be the best. Examples of DV are RIP and IGRP.
Link State
Typically called shortest path first, each router creates three tables. 1 tracks directly attached neighbors, 1 determines the entire network topology, and 1 is used for routing table. An example of LS is OSPF.
Hybrid
Uses parts of DV and LS. An example is EIGRP.
Distance Vector vs. Link State Routing Protocols
Distance Vector
Link State
Sees the network from its neighbor's perspective.
Sees the entire network from its own perspective.
Distance metrics accumulate from router to router.
Calculates shortest path to other routers.
Route updates occur periodically.
Route updates are event triggered.
Convergence is slow.
Convergence is fast.
Broadcasts entire route table to neighbors.
Broadcasts link status information to all routers.
Link State Routing Protocols
Link state protocols require each router to send the state of its own interfaces to every router in the internetwork. Link state protocols converge more quickly, but they use more of the router's CPU and memory resources. Link state protocols rely on network events to address topology changes in the network. If a router detects a network event (new router or router down), it triggers an update.
Link State Overview
Routers broadcast and receive link state packets to and from other routers via the network. Link state packets contain the status of a router's links or network interfaces.
The router builds a topology database of the network.
The router runs the Shortest Path First (SPF) algorithm against the database and generates a SPF tree of the network with itself as the root of the tree.
The router populates it route table with optimal paths and ports to transmit data through to reach each network.
Link State Problems
CPU and memory usage when maintaining routing tables on large networks. -- This affects the router's ability to move user data packets through the network.
Large amount of network bandwidth used during convergence. -- Affects the amount of bandwidth that is available to users during this time. Occurs with network initialization or when several routers start up.
If one part of the network receives route information before another part, convergence may take longer or SPF trees and route tables may store inaccurate information.
Link State Remedies
Minimize router resource usage by lengthening update frequency or exchanging route summaries.
Coordinate updates with time stamps or sequence numbers.
Distant Vector Routing Protocols
Passes complete routing tables to neighbors. The neighbors integrate the new table with theirs to create their internetwork map, this is how distance vector determines the network topology. Can have multiple links to a network if this occurs the administrative distance is first checked and the one with the lowest administrative distance is used. RIP uses hop count for best path to a network, if it finds multiple links it uses load balancing with a maximum of 6 equal links. However, it doesn't take the bandwidth into consideration and treats all links equally.
Convergence
When routers using routing protocols first startup, they send their routing tables to each other and the time it takes for them to synchronize is called network convergence. RIP has a slow convergence time, which can cause routing loops.
Routing Loops
Occur in part because of slow convergence times. Routers using Distance Vector routing protocols send their routing tables at set intervals. When a router's network goes down, it broadcasts a message that updates its neighbors. The neighboring routers will gradually update their neighbors (convergence). However; if one of the distant routers, who hasn't received the update about the downed network, sends out its normal update packet which states that the downed network is reachable through it, it will create a routing loop. Its path really points to its neighbors who are closer to the downed network and know the network is down, but they will see the downed network as being available through the distant router. They will send the packets destined for the downed network to the distant router who will in turn send the packet along the path that it originally had (to the downed network's neighbors). The neighbor to the downed network knows its connection to the downed network isn't available so it sends the packet to the distant router (thinking that it is a new path) who still believes the original path is available. This will repeat itself continuously; the neighbor sends it to the distant router and the distant router sends it to the neighbor of the downed network who in turn sends it back to the distant router, each thinks that the other has a connected path. This is called counting to infinity.
Solutions to Routing Loops Maximum Hop Count
DV (RIP) permits hot count of up to 15. So a packet that is caught in a routing loop will only travel 15 hops, on the 16th the network is deemed unreachable and the packet is discarded.
Split Horizons
Specify that a router can't send information about routes back out the interface they originated from. Won't send old data about downed networks.
Route Poisoning
If a router's connected network goes down, it sets its hop count to unreachable (16 for RIP) for the network. The neighboring router will receive information about the unreachable network and won't try to send packets to it even if it receives outdated data from a distant router.
Hold downs
Prevent regular update messages from reinstating a route that is down. Also prevent router from changing too rapidly by allowing time for the downed network to come backup or the network to stabilize before changing to the next best route. Also tells the router to restrict changes for a specific time period, any changes that would affect recently removed routes. If a router receives an update claiming that a network has gone down, it starts the hold down timer. If it receives an update with a better metric, the timer is removed and packets are passed. However, if an update arrives from a neighbor router before the hold down timer expires and it has a lower metric than the previous route, the timer keeps going. This allows for convergence. Hold downs use triggered updates that are sent immediately to neighboring routers and contains a new routing table.

Router Interfaces

0 comments
Routers can have many different types of connectors; from Ethernet, Fast Ethernet, and Token Ring to Serial and ISDN ports. Some of the available configurable items are logical addresses (IP,IPX), media types, bandwidth, and administrative commands. Interfaces are configured in interface mode which you get to from global configuration mode after logging in.
Logging in to the Router
Depending on the port you're using, you might have to press enter to get the prompt to appear (console port). The first prompt will look like Routername> the greater than sign at the prompt tell you that you are in user mode. In user mode you can only view limited statistics of the router in this mode. To change configurations you first need to enter privileged EXEC mode. This is done by typing enable at the Routername> prompt, the prompt then changes to Routername#. This mode supports testing commands, debugging commands, and commands to manage the router configuration files. To go back to user mode, type disable at the Routername# prompt. If you want to leave completely, type logout at the user mode prompt. You can also exit from the router while in privileged mode by typing exit or logout at the Routername# prompt.
Global Configuration Mode
Enter this mode from the privileged mode by typing configure terminal or (conf t for short). The prompt will change to Routername(config)#. Changes made in this mode change the running-config file in DRAM. Use configure memory to change the startup-config in NVRAM. Using configure network allows you to change the configuration file on a TFTP server. If you change the memory or network config files, the router has to put them into memory (DRAM) in order to work with them, so this will change your router's current running-config file.
Interfaces mode
While in global configuration mode you can make changes to individual interfaces with the command Routername(config)#interface ethernet 0 or Routername(config)#int e0 for short, this enters the interface configuration mode for Ethernet port 0 and changes the prompt to look like Routername(config-if)#.
Bringing Up Interfaces
If an interface is shown administratively down when the show interface command is given in privileged EXEC mode, use the command no shutdown to enable the interface while in interface configuration mode.
Setting IP Addresses
In global configuration mode, enter the interface configuration mode (Routername(config)#int e0) and use the command Routername(config-if)#ip address [ip address] [network mask]. If it is the first time using the interface, also use the no shutdown command to enable and bring up the interface. Router_2(config)#int e0 Router_2(config-if)#ip address 192.168.1.1 255.255.255.0 Router_2(config-if)#no shutdown
Secondary IP Addresses
You can add another IP address to an interface with the secondary command. The syntax is the same as setting an IP address except you add secondary to the end of it. Using secondary interfaces, it allows you to specify 2 IP addresses for 1 interface. Use subinterfaces instead, since they allow for more than 2 IP addresses on an interface and secondaries will probably be replaced soon.
Subinterfaces
In global configuration mode you can create virtual interfaces (subinterfaces), so at the prompt Routername(config)# type int e0.1 and the prompt will change to Routername(config-subif)#. For all practical purposes there isn't a limit to the amount of subinterfaces an interface can have.
Show Interfaces
To view information about an interface, use the command: Router_2#show interface e0 Ethernet0 is up, line protocol is up Hardware is Lance, address is 0000.cc34.ec7d (bia 0000.cc34.ec7d) Internet address is 192.168.1.1/24 MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, rely 255/255, load 1/255 Encapsulation ARPA, loopback not set, keepalive set (10 sec) ARP type: ARPA, ARP Timeout 04:00:00 Last input never, output 00:00:07, output hang never Last clearing of "show interface" counters never Queueing strategy: fifo Output queue 0/40, 0 drops; input queue 0/75, 0 drops 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes, 0 no buffer Received 0 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0 input packets with dribble condition detected 614 packets output, 58692 bytes, 0 underruns 0 output errors, 0 collisions, 2 interface resets 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier 0 output buffer failures, 0 output buffers swapped out

Interface Problems
When using the command show interface [type #] interface problems can be seen and appropriate action taken.
Message
Solution
Ethernet0 is up, line protocol is up
None needed, interface working properly
Ethernet0 is up, line protocol is down
Clocking or framing problem, check clock rate and encapsulation type on both routers
Ethernet0 is down, line protocol is down
Cable or interface problem, check interfaces on both ends to ensure they aren't shutdown
Ethernet0 is administratively down, line protocol is down
The interface has been shutdown, use the no shutdown command in the interface's configuration mode
Serial Interfaces
The serial interface is usually attached to a line that is attached to a CSU/DSU that provides clocking rates for the line. However, if two routers are connected together, one of the serial interfaces must act as the DCE device and provide clocking. The DCE end of the cable is the side of the cable that has a female connector where it connects to the other cable. The clocking rate on the DCE device is set in interface configuration mode with the commands: Router3(config)#int s0 Router3(config-if)#clock rate ? Speed (bits per second) 1200 2400 4800 9600 19200 38400 56000 64000 72000 125000 148000 250000 500000 800000 1000000 1300000 2000000 4000000 <300-8000000> Choose clockrate from list above Router3(config-if)#clock rate 56000
Bandwidth
Cisco routers ship with T1 (1.544 mbps) bandwidth rates on their serial interfaces. Some routing protocols use the bandwidth of links to determine the best route. The bandwidth setting is irrelevant with RIP routing. Bandwidth is set with the bandwidth command and ranges from 1 - 10000000 kilobits per second. Router3(config)#int s0 Router3(config-if)#bandwidth ? <1-10000000> Bandwidth in kilobits Router3(config-if)#bandwidth 10000000
Saving Changes
Any time you make changes and want them saved over the next reboot, you need to copy the running-config to the startup-config in NVRAM. Use the command: Router3#copy run start
You can see either of the files by using the commands: Router3#show run Router3#show start
To erase the startup file use the command: Router3#erase start
Show Controllers
Tells you information about the physical interface itself, it also gives you the cable type and whether it is a DTE or DCE interface. Syntax is: Router_2#show controllers s 1
*Note there is a space between the s and the 1.

Setting Router Passwords

0 comments
The router has a number of ports that allow access to the router, on each of these ports you can specify passwords to provide a layer of security to the router. There is also the option of disabling login password checking to any of the ports by entering the command to get to the Router(config-line)# section of the port and entering the no login command. In the examples the password is set to ccna with the enable secret password set to ccna2.
Setting the enable and enable secret password:
Router(config)#enable ccna
Router(config)#enable secret ccna2
The enable secret password is the password you use to gain access to enable mode and to the global configuration mode on the router and is encrypted. The enable password is used when you do not specify a enable secret password. The enable password should be different from the enable secret password.
Setting the auxiliary port password:
Router(config)#line aux 0
Router(config-line)#login
Router(config-line)#password ccna
The auxiliary port is on the back of the router and is commonly used to connect a modem to. It is used to allow a remote user access to the configuration of the router. If a modem is connected to the port, it should definitely have a password specified for it.
Setting the console password:
Router(config)#line con 0
Router(config-line)#login
Router(config-line)#password ccna
The console port is also on the back of the router and is used to directly connect a console to the router for configuring the router. The console is usually a PC running a program like HyperTerminal set to 8 N 1. The PC connects to the console port from the PC's COM port, the COM port uses a 9 pin to RJ45 connector, the connector uses a rolled CAT 5 cable (reversed on one end) to connect to the RJ45 port on the back of the router. This port should allow logins with passwords if the router is physically secured. The port should be disabled if it is not regularly used or the router is not securable. This port can be very useful especially when configuring a new router or a corrupted router as you don't have to rely on IP addresses being correct or the interfaces being up.
Setting the Virtual Terminal (Telnet) password:
Router(config)#line vty 0 4
Router(config-line)#login
Router(config-line)#password ccna
The vty ports are specified with the command line vty 0 4 depending on your router you might have more than five (0,1,2,3,4) virtual terminals available, in that case use the command line vty 0 X where X is the number of terminals -1. You can also specify less than the maximum, which will limit the number of sessions that can exist on the router. The Virtual Terminal ports are just that, virtual, as you can't physically see them. They are the ports that allow users to remotely access the router. If they are enabled then anyone on any of the networks that the router knows about can attempt to login. If you aren't going to be doing remote configurations on the router yourself, the vty ports should be disabled and the console port should be enabled. You can also apply a standard IP access list to the VTY ports.

Router User Interface

0 comments
The Cisco Internetwork Operating System (IOS) is the kernel of Cisco's Routers and most of their switches.
Cisco IOS software is used to :
Carry network protocols and functions
Connect high speed traffic between devices
Add security, control access, and stop unauthorized network access
Promote Scalability for ease of network growth and redundancy
Supply network reliability for connecting to network resources
The IOS can be accessed through the console port, from a modem (auxiliary port), or through the network via telnet. Access to the IOS command line is called an EXEC session.
Console Port
Connect using a RJ-45 port on the back of the router.
Cable is wired straight through but reversed on one side (rolled cable).



Cable connects to RJ-45 to DB9 adapter and the PC uses a Terminal Emulation program set to 9600 baud, 8 bits, N parity, 1 stop bit.
Console port has no password by default.
Auxiliary Port
Same as console port and can be used in same way.
Typically used by having a modem you can use to dial into the router with.
Useful for configuring a remote router you don't have physical access to.
If a remote route stops responding, it can still be accessed if it has a modem on its auxiliary port.
Telnet
Telephone Network - it emulates a dumb terminal and connects over the network.
Can connect from PCs or other routers.
When logging on to the router, be aware that telnet sends and receives passwords and usernames in plain text.
Powering up a Cisco Router
First runs POST (Power On Self Test).
If POST passes, it loads the IOS from flash memory if present (Flash Memory is EEPROM).
IOS will then load the configuration file called startup-configuration, stored in NVRAM by default.
If no configuration file is present, the router will bring up setup mode (a step-by-step process to help you configure a router, it can be run any time by entering setup at the global configuration command line prompt).
SETUP Mode
Setup mode has two modes, Basic Management and Extended Setup.Basic Management
Only gives you enough configurations to allow connectivity to the router.
Configures only enough connectivity for management of the system.
Extended Setup
Allows you to configure some global parameters as well as interface configuration parameters.
Prompts you to configure each interface on the system.
Prompts for
Hostname
Secret Password
Enable Password
VTY Password (used for Telnet Sessions)
SNMP setup
Protocols {DECnet, AppleTalk, IP(IP routing -RIP, IGRP, etc)}
Bridging
IPX protocol
Async Lines
If ISDN BRI interface is present, it prompts for switch type.
Next configures Interfaces, including IP address and network mask.
The running-config is shown after the interfaces are configured.
The last option in setup is a menu of three choices.
1. Discard Configuration and go to command line.
To start setup mode over.
To save setup to NVRAM to be used at boot up (startup -config).
Command Line Interface
If you choose to skip setup mode, you will be taken to the command line and the status of all the interfaces will be shown to the screen.
Logging in to the Router
Depending on the port you're using, you might have to press enter to get the prompt to appear (console port). The first prompt will look like Routername> the greater than sign at the prompt tells you that you are in user mode. In user mode you can only view limited statistics of the router. To change configurations you first need to enter privileged EXEC mode. This is done by typing enable at the Routername> prompt, the prompt then changes to Routername#. This mode supports testing commands, debugging commands, and commands to manage the router configuration files. To go back to user mode type disable at the Routername# prompt. If you want to leave completely, type logout at the user mode prompt. You can also exit from the router while in privileged mode by typing exit or logout at the Routername# prompt.
Global Configuration Mode
Enter this mode from the privileged mode by typing configure terminal or conf t for short, the prompt will change to Routername(config)#. Changes made in this mode change the running-config file in DRAM. Use configure memory to change the startup-config in NVRAM. Using configure network allows you to change the configuration file on a TFTP server. If you change the memory or network config files, the router has to put them into memory (DRAM) in order to work with them, so this will change your router's current running-config file.
Interfaces
While in global configuration mode you can enter interface configuration mode and make changes to individual interfaces with the command Router(config)#interface ethernet 0 or Router(config)#int e0 for short, this enters into the interface configuration mode for Ethernet port 0 and changes the prompt to look likeRouter(config-if)#.
Subinterfaces
In global configuration mode you can create virtual interfaces, so at the prompt Routername(config)# type int e0.1 and the prompt will change to Routername(config-subif)#. For all practical purposes there isn't a limit to the amount of subinterfaces an interface can have.
Lines
In global configuration mode you can enter line [aux, vty, console] to enter commands for the line type. Changes the prompt to Routername(config-line)#. In line mode you can set passwords, inactivity timeout times, and number of available lines (vty).
Routing Protocols
In global configuration mode enter router followed by one of the following protocols: bgp Border Gateway Protocol (BGP) egp Exterior Gateway Protocol (EGP) eigrp Enhanced Interior Gateway Routing Protocol (EIGRP) igrp Interior Gateway Routing Protocol (IGRP) isis ISO IS-IS iso-igrp IGRP for OSI networks mobile Mobile routes odr On Demand stub Routes ospf Open Shortest Path First (OSPF) rip Routing Information Protocol (RIP) static Static routes
This will allow you to set parameters for the selected routing protocol and will change the current prompt to Routername(config-router)#.
Banners
There are four types of banners: exec, incoming, login, and motd. The banners are set in global configuration mode with the command: Router_2(config)#banner motd ! Enter TEXT message. End with the character '!'. Welcome to Router_2 Only authorized personnel may login ! Router_2(config)#
A delimiting character is used to set off the message, in this case the character is the ! symbol.
Adding a Description to an Interface
An interface description is limited to 80 characters and typically describes the function of the interface. Router_2(config)#int serial 1 Router_2(config-if)#description Link to East Office Router_2(config-if)#

Friday, July 4, 2008

OSPF router-id does not change when the interface IP address changes

0 comments
The rules used to establish OSPF router ID on Cisco IOS are well known:
Take the highest IP address of all loopback interfaces configured on the router when the OSPF process is started.
If there is no loopback interface, take the highest IP address of an operating interface.In the old days, when Cisco believed that the router ID had to match an interface address, this also implied that the router ID would have changed if the interface IP address changed (and we told the students that you have to use loopback interfaces to make your network stable, as the OSPF process would restart if the interface giving the router ID went down).Most of these “wisdoms” are no longer true. For recent releases of Cisco IOS, OSPF router ID is a 32-bit value that has to be unique (that's all that the OSPF RFC ever asked for) and just happens to be taken from an interface address at the time the OSPF process is started. Even more, you can configure it to any value you like with the router-id A.B.C.D router configuration command.The new behavior, while definitely making your network more stable, can also bring unexpected side effects: if you don't use the router-id command and misconfigure an interface IP address (resulting in duplicate router IDs), correcting the interface IP address will not fix the problem. You also have to reset the OSPF process with the clear ip ospf pid process command