Answers
A router needs the network address of the destination network and a routing table with valid information about the destination to correctly route a packet.
The three types of routes are static, dynamic, and default.
Static routes are routes that an administrator manually enters into a router. Dynamic routes are routes that a router learns automatically through a routing protocol.
To configure a static route on a Cisco router, enter the ip route destination-network [mask] {next-hop-address | outbound-interface} [distance] [permanent] global command. Here's an example:
RouterB(config)#ip route 172.17.0.0 255.255.0.0 172.16.0.1
This example instructs the router to route to 172.16.0.1 any packets that have a destination of 172.17.0.0 to 172.17.255.255.
Also known as the gateway of last resort, a default route is a special type of static route with an all-0s network and network mask. The default route is used to direct any packets for which a next hop is not specifically listed in the routing table. By default, if a router receives a packet to a destination network that is not in its routing table, it drops the packet. When a default route is specified, the router does not drop the packet. Instead, it forwards the packet to the IP address specified in the default route.
To configure a default route on a Cisco router, enter the following global configuration command:
ip route 0.0.0.0 0.0.0.0 [ip-address-of-the-next-hop-router _ outbound-interface]
For example:
RouterB(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.2
NOTE
All Cisco routers before Cisco IOS software Release 12.0 are classful. They expect a default subnet mask on each interface of the router. If a router receives a packet for a destination subnet not in the routing table, the router forwards the packet to the best available major Class A, B, or C network. If the router does not have specific information about the major network, it drops the packet. When you are using an IOS version before Release 12.0 and are using a default route, you must use the ip classless global command so that the packets go to the default route.
Administrative distance (AD) is an integer from 0 to 255 that rates the trustworthiness of the source of the IP routing information. It is important only when a router learns about a destination route from more than one source. The path with the lower AD is the one given priority.
NOTE
If a routing protocol has multiple paths within the same routing protocol to the same destination, the metric is used as the tiebreaker. The route with the lowest metric is the path taken.
The three classes of routing protocols are
- Distance vector
- Link-state
- Balanced hybrid
Distance vector protocols use a vector of distance and direction to find the best path, where distance is defined in terms of a metric and direction is defined as the next-hop router. Distance vector protocols broadcast the entire routing table at periodic intervals and are slow to converge because of hold-down timers. Examples include RIP and IGRP.
Link-state protocols use a topological database that is created on each router. This database keeps track of directly attached neighbors, the entire network, and the routing table. Link-state updates are typically multicast to all neighbors. (OSPF is a link-state protocol.)
Balanced hybrid protocols combine aspects of distance vector and link-state protocols. An example is EIGRP.
The ADs are as follows:
- Directly connected interface
- Static route
- EIGRP
- IGRP
- OSPF
- RIP
- External EIGRP
- Unknown
0
1
90
100
110
120
170
255Two classful routing protocols are RIP and IGRP. Classful routing protocols require all interfaces to have the same subnet mask. Classful routing protocols do not include the subnet mask in their routing updates. Thus, they assume that all remote networks have the subnet mask of the exiting interface.
To perform inter-VLAN routing, the following must occur:
The router must know how to reach all VLANs being interconnected.
The router must have a separate physical connection on the router for each VLAN, or trunking must be enabled on a single physical connection.
NOTE
Remember that each VLAN is a subnet and that a router is needed to route from one subnet to another.
To route between VLANs using ISL on a Cisco router, you must do the following:
Step 1
Create a subinterface for each VLAN to be routed.
Step 2
Enable ISL encapsulation on each subinterface being configured. (ISL trunking works only on Fast Ethernet and Gigabit Ethernet interfaces.)
Step 3
Assign an IP address to the subinterface.
Step 4
Enable ISL encapsulation for the particular VLAN with the encapsulate isl vlan# subinterface command.
Here's an example:
RouterB(config)#int f0/0.10 RouterB(config-subif)#encapsulate isl 10 RouterB(config-subif)#ip address 172.16.0.1 255.255.0.0
The encapsulation dot1q vlan-id command enables 802.1Q on a Cisco router.
The native VLAN in 802.1Q does not carry a tag; therefore, a trunk's major interface has an IP address. Any other configuration information for the native VLAN subinterfaces is configured with the dot1q encapsulation and IP address. Remember that the major interface of a router using ISL cannot have an IP address. The following example enables 802.1Q encapsulation on a router:
RouterB(config)#int f0/0 RouterB(config-if)#ip address 192.168.10.1 255.255.255.0 RouterB(config-if)#encapsulation dot1q 10 RouterB(config-if)#int f0/0.20 RouterB(config-if)#ip address 192.168.20.1 255.255.255.0 RouterB(config-if)#encapsulation dot1q 20
NOTE
To enable 802.1Q on a Catalyst 1900 interface, use the switchport trunk encapsulation dot1q command. Catalyst 2950 switches support only 802.1Q encapsulation and are enabled with the switchport mode trunk interface command.
Also known as Bellman-Ford algorithms, distance vector routing protocols pass complete routing tables to neighboring routers. Neighboring routers then combine the received routing table with their own routing table. Each router receives a routing table from its directly connected neighbor.
Distance vector routing protocols keep track of an internetwork by periodically broadcasting updates out all active interfaces. This broadcast contains the entire routing table. This method is often called "routing by rumor."
Here are some of the ways distance vector routing protocols prevent routing loops and inconsistent routing tables:
- Maximum hop count (count to infinity)
- Split horizon
- Route poisoning
- Holddowns
- TTL
If a loop is in an internetwork, a packet loops around the internetwork until the TTL in the IP packet reaches 0 and is removed. Maximum hop counts prevent routing loops by defining the maximum number of times a packet loops around the internetwork. RIP uses a hop count of up to 15, so anything that requires 16 hops is unreachable. Anytime a packet passes through a router, it is considered one hop.
The split-horizon rule prohibits a router from advertising a route through an interface that the router itself is using to reach the destination.
Convergence is when all routers have consistent knowledge and correct routing tables.
With route poisoning, when a distance vector routing protocol notices that a route is no longer valid, the route is advertised with an infinite metric, signifying that the route is bad. In RIP, a metric of 16 is used to signify infinity. Route poisoning is used with holddowns.
NOTE
A poison reverse is an update that a router sends to the router it received the route poison from, specifying that all routers on the segment have received the poisoned route information.
Hold-down timers prevent regular update messages from reinstating a route that might have gone bad. Hold-down timers also tell routers to hold for a period of time any changes that might affect routes.
Also known as flash updates, triggered updates are routing updates sent immediately out a router's interface when it notices that a directly connected subnet has changed state.
B and D. Poison reverse and split horizon are used for loop avoidance. OSPF uses link-state advertisements to advertise its links. Route discovery is the process of discovering all available routes.
Link-state routing protocols use link-state advertisements (LSAs), a database describing the entire area, and the shortest path first (SPF) algorithm to maintain routing information within an internetwork
Areas are a grouping of contiguous networks. They are logical subdivisions of an autonomous system.
NOTE
An autonomous system is a collection of networks under a common administration that share a common routing strategy. An autonomous system is sometimes called a domain. It can be logically subdivided into multiple areas to reduce routing updates.
-
Link-state protocols send routing updates only when they detect a topology change.
Fast convergence.
Support for classless addressing.
Networks can be segmented into area hierarchies, limiting where routing updates are flooded to.
-
Significant demands on resources. Because link-state protocols require a topology database of the internetwork, they require a significant amount of memory and CPU cycles to run the SPF algorithm.
Link-state protocol networks are more complex, making them more difficult to troubleshoot than distance vector protocols.
All areas must connect to a backbone area. Therefore, implementing a link-state network requires much planning.
Balanced hybrid routing protocols combine aspects of distance vector and link-state protocols. Balanced hybrid routing protocols use distance vectors, which are more accurate, to determine the best path to a destination network, and they use topology changes to trigger routing updates.
EIGRP is a balanced hybrid protocol that is Cisco-proprietary.
IP RIP is a true distance vector routing protocol that sends its complete routing table out all active interfaces every 30 seconds. IP RIP uses a hop count as its metric to determine the best path to a remote network. The maximum allowable hop count is 15, meaning that 16 is unreachable. RIP has two versions. Version 1 is classful, and version 2 is classless. IP RIP can load-balance over as many as six equal-cost paths.
The four timers that IP RIP uses to regulate its performance are
Route update timerThe time between router updates. The default is 30 seconds.
Route invalid timerThe time that must expire before a route becomes invalid. The default is 180 seconds.
Route hold-down timerIf IP RIP receives an update with a hop count higher than the metric recorded in the routing table, the router goes into holddown for 180 seconds.
Route flush timerThe time from when a route becomes invalid to when it is removed from the routing table. The default is 240 seconds.
The commands to enable RIP on a Cisco router are
- router rip
- network connected-network-address
For example, the following commands enable RIP and advertise networks 192.168.1.0 and 192.168.2.0:
RouterB(config)#router rip RouterB(config-router)#network 192.168.1.0 RouterB(config-router)#network 192.168.2.0
Sometimes you do not want RIP updates to propagate across the WAN, wasting valuable bandwidth or giving out valuable information about your internetwork. The easiest way to stop RIP updates from propagating out an interface is to use the passive-interface router configuration command.
The IOS command show ip protocols displays values associated with routing timers, the administrative distance, and network information associated with the entire router:
RouterB#show ip protocols Routing Protocol is "rip" Sending updates every 30 seconds, next due in 2 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is Incoming update filter list for all interfaces is Redistributing: rip Default version control: send version 1, receive any version Interface Send Recv Key-chain Serial0 1 1 2 Serial1 1 1 2 Routing for Networks: 192.168.1.0 192.168.2.0 Routing Information Sources: Gateway Distance Last Update Distance: (default is 120)
-
router rip network 172.16.0.0
show ip route displays the Cisco routing table's contents:
RouterA#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 192.168.1.1 to network 0.0.0.0 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 R 192.168.0.0/24 [120/1] via 192.168.1.1, 00:00:21, Serial0 C 192.168.1.0/24 is directly connected, Serial0 C 192.168.2.0/24 is directly connected, Ethernet0 R* 0.0.0.0/0 [120/1] via 192.168.1.1, 00:00:21, Serial0
[120/1] indicates that 120 is the AD and 1 is the number of hops to the remote network.
debug ip rip displays routing updates as they are sent and received.
NOTE
Use the no debug all IOS command to turn off all debugging commands.
"RIP:broadcasting general request on Ethernet1" is usually displayed upon startup or if a user manually clears the routing table.
IGRP is a Cisco-proprietary distance vector routing protocol. It has a default hop count of 100 hops, with a maximum hop count of 255. IGRP uses bandwidth and line delay as its default metric, but it can also use reliability, load, and MTU.
The four timers that IGRP uses to regulate its performance are as follows:
Route update timerThe time between router updates. The default is 90 seconds.
Route invalid timerThe time that must expire before a route becomes invalid. The default is 270 seconds.
Route hold-down timerIf a destination becomes unreachable, or if the next-hop router increases the metric recording in the routing table, the router goes into holddown for 280 seconds.
Route flush timerThe time from when a route becomes invalid to when it is removed from the routing table. The default is 630 seconds.
IGRP can support up to six multiple equal or unequal paths. (Four is the default.)
NOTE
For IGRP to support multiple paths, the following rules must apply:
The next-hop router in any of the paths must be closer to the destination than the local router is. This ensures that no routing loops occur.
The alternative path metric must be within the specified variance of the best local metric.
The way you enable IGRP on a Cisco router is similar to the way you enable RIP, except that you specify IGRP as the protocol and add an autonomous system number:
RouterA(config)#router igrp 10 (10 is the AS number) RouterA(config-router)#network 192.168.0.0 RouterA(config-router)#network 192.168.1.0 RouterA(config-router)#network 192.168.2.0
To enable unequal-cost routing in Router A, you use the variance command. It defines a multiplier by which a metric may vary from the metric of the lowest-cost route. Any route whose metric exceeds the metric of the lowest-cost route multiplied by the variance is not used. The variance must be specified in whole numbers.
For example, suppose that Router A's metric through S0 is 8576, and its metric through S1 is 41162. 41162 / 8576 = 4.8. Thus, the S1 metric is 4.8 times larger than S0, so to enable unequal-cost routing on Router A, the variance is 5. The configuration is as follows:
RouterA(config)#router igrp 10 RouterA(config-router)#network 192.168.0.0 RouterA(config-router)#network 192.168.1.0 RouterA(config-router)#variance 5
Here are some of EIGRP's improvements over IGRP:
DUAL
Incremental updates
Loop-free networks
Reduced bandwidth usage
Support for multiple network layer protocols (IP, IPX, AppleTalk)
Support for variable-length subnet masks (VLSMs), discontiguous networks, and classless routing
Advanced distance vector capabilities
Automatic route summarization on major network boundaries
EIGRP uses bandwidth and delay by default to calculate its metric. It can also be configured to use reliability, load, and MTU. EIGRP's metric is the same as IGRP's metric, except that it is multiplied by 256 for improved granularity.
A successor is a route selected as the primary route used to reach a destination. It is the route kept in the routing table.
The feasible successor is the backup route. These routes are selected at the same time the successors are identified, but they are kept only in the topology table, not in the routing table. They are used for fast convergence. If the successor fails, the router can immediately route through the feasible successor. A destination can have multiple feasible successors.
RouterA(config)#router eigrp 100 (100 is the AS number) RouterA(config-router)#network 192.168.3.0 RouterA(config-router)#network 192.168.4.0
The show ip eigrp neighbors command displays EIGRP adjacencies and directly connected neighbors.
You use the debug eigrp neighbors command to check the EIGRP neighbor states. This command displays the contents of the hello packet used in EIGRP as well as the neighbors discovered by EIGRP.
Bandwidth. OSPF's metric is a cost value based on bandwidth or the speed of its connection. The default formula used to calculate OSPF cost is
Cost = 100,000,000 / bandwidth in bps
For example, OSPF assigns the cost of 10 to a 10 MB Ethernet line (100,000,000 / 10,000,000 = 10).
NOTE
This is a tricky question in some ways. For example, with this question, you might have to choose between cost and bandwidth. Bandwidth is the more correct answer, because OSPF metric uses a cost based on bandwidth.
OSPF-speaking routers build adjacencies by sending Hello packets out all OSPF-enabled interfaces. If the routers share a common data link and agree on certain parameters set in their Hello packets, they become neighbors. If these parameters are different, the routers do not become neighbors, and communication stops. OSPF routers form adjacencies with certain routers. These routers are determined by the data link media type. As soon as adjacencies are formed, each router sends LSAs to all adjacent routers. These LSAs describe the state of each of the router's links. Because of the varying types of link-state information, OSPF defines multiple LSA types. Finally, a route that receives an LSA from a neighbor records the LSA in a link-state database and floods a copy of the LSA to all its other neighbors. When all databases are complete, each router uses the SPF algorithm to calculate a loop-free topology and builds its routing table based on this topology.
In OSPF, the Hello protocol ensures that communication between OSPF-speaking routers is bidirectional. It is the means by which neighbors are discovered and acts as keepalives between neighbors. It also establishes and maintains neighbor relationships and elects the designated router (DR) and backup designated router (BDR) to represent the segment on broadcast and nonbroadcast multiaccess (NBMA) networks.
The five network types that OSPF defines are
- Broadcast networks
- NBMA networks
- Point-to-point networks
- Point-to-multipoint networks
- Virtual links
Examples of broadcast networks are Ethernet and Token Ring. OSPF routers on broadcast networks elect a DR and BDR. All the routers form adjacencies with the DR and BDR. On broadcast networks, all OSPF packets are multicast to the DR and BDR.
NBMA networks are Frame Relay, X.25, and ATM. They can connect more than two routers but have no broadcast capability. NBMA networks elect a DR and BDR, and all OSPF packets are unicast.
Point-to-point networks, such as a T1, connect a single pair of routers and always become adjacent.
Point-to-multipoint networks are a special configuration of NBMA networks in which networks are treated as a collection of point-to-point links. Routers on these networks do not elect a DR or BDR, and because all links are seen as point-to-point, all OSPF packets are multicast.
Virtual links are a special configuration that the router interprets as unnumbered point-to-point networks. The administrator creates virtual links.
Hello protocols are periodically sent out each interface using IP multicast address 224.0.0.5 (All SPF Routers). The HelloInterval each router uses to send out the Hello protocol is based on the media type. The default HelloInterval of broadcast, point-to-point, and point-to-multipoint networks is 10 seconds. On NBMA networks, the default is 30 seconds.
14. The formula for figuring out the number of circuits (adjacencies or connections) needed to establish adjacencies on the DR and BDR is 2(n 1), where n is the number of routers in the network. So if you have eight routers in a network, 2(8 1) = 14 adjacencies.
For OSPF to initialize, it must be able to define a router ID for the entire OSPF process. A router can receive its router ID from several sources. The most common and stable source is the IP address set on the loopback interface. The loopback interface is a logical interface that never goes down. If no loopback address is defined, an OSPF-enabled router selects the numerically highest IP address on all its interfaces as its router ID.
The router ID is 192.168.24.1 because it is the numerically highest IP address on all interfaces on the router. If the router had a loopback address configured, it would choose the loopback address as the router ID (even if the loopback IP address was numerically lower than other IP addresses configured on the router).
Link-state advertisements (LSAs) are what OSPF-speaking routers send out all interfaces, describing the state of the router's links. LSAs are also packets that OSPF uses to advertise changes in the condition of a specific link to other OSPF routers.
Six different and distinct link-state packet formats are used in OSPFeach for a different purpose. The ICND exam will test you on only two LSA typesType 1 and Type 2.
Type 1 LSAs are router LSAs and are generated by each router for each area to which it belongs. These LSAs describe the states of the router's links to the area and are flooded within a single area.
Type 2 LSAs are network LSAs and are generated by the DR and BDR. They describe the set of routers attached to a particular network. They are flooded within a single area.
The reasons why you would use OSPF instead of RIP are as follows:
- Support for VLSMs
- Fast convergence
- No reachability limitations
- More efficient use of bandwidth
- Path selection is based on bandwidth rather than hops
The router ospf process-id command enables the OSPF process, and the network address wildcard-mask area area-id command assigns networks to a specific OSPF area. Notice that you must specify the wildcard mask instead of the subnet mask. For example, the following commands enable OSPF process 10 and advertise the network 192.168.10/24 in area 0:
RouterA(config)#router ospf 10 RouterA(config-router)#network 192.168.10.0 0.0.0.255 area 0
NOTE
The process ID is locally significant to the router, because all OSPF routes are assumed to belong to the same OSPF domain.
RouterA(config)#interface loopback number configures a loopback interface. The number option specifies the loopback interface number you are creating.
NOTE
Remember that a loopback interface is a logical interface in the router. If you have a loopback interface created on an OSPF-enabled router, the router ID is the loopback address.
The show ip ospf neighbor command displays OSPF neighbor information on a per-interface basis.