CCNP Route Lab 4-3, Manipulating Administrative Distances
Topology
Objectives
- Configure RIP on a router.
- Configure OSPF on a router.
- Manipulate administrative distances.
- Compare routing protocol behavior.
Background
In this lab, you will compare the RIP and OSPF routing protocols based on how efficient they are at selecting routes, as well as what happens when you manipulate administrative distances in the routing table.
Note: This lab uses Cisco 1841 routers with Cisco IOS Release 12.4(24)T1 and the Advanced IP Services image c1841 -advipservicesk9-mz.124-24.T1 .bin. The switch is a Cisco WS-C2960-24TT-L with the Cisco IOS image c2960-lanbasek9-mz.122-46.SE.bin. You can use other routers (such as a 2801 or 2811), switches (such as 2950), and Cisco IOS Software versions if they have comparable capabilities and features. Depending on the router or switch model and Cisco IOS Software version, the commands available and output produced might vary from what is shown in this lab.
Required Resources
- 3 routers (Cisco 1841 with Cisco IOS Release 12.4(24)T1 Advanced IP Services or comparable)
- 1 switch (Cisco 2960 with the Cisco IOS Release 12.2(46)SE C2960-LANBASEK9-M image or comparable)
- Serial and Ethernet cables
Step 1 : Review default administrative distances.
Fill in the following table with all the administrative distances you can recall from your reading.
Protocol | Administrative Distance |
Connected | 0 |
Static | 1 |
EIGRP Summary Route | 5 |
External BGP | 20 |
EIGRP | 90 |
IGRP | 100 |
OSPF | 110 |
IS-IS | 115 |
RIP | 120 |
EGP | 140 |
On-Demand Routing (ODR) | 160 |
External EIGRP | 170 |
Internal BGP | 200 |
Unknown | 255 |
Of the interior gateway protocols (IGPs) that you have studied, which one is considered the most trusted on a
Cisco router and why?
Currently, EIGRP is considered the most trusted IGP on Cisco routers with an administrative distance of 90.
Step 2: Configure router loopbacks and addressing.
Configure all loopback interfaces on the three routers in the diagram. Configure the serial interface with the IP addresses, bring them up, and set a clock rate where appropriate.
R1# conf t R1(config)# interface loopback 1 R1(config-if)# ip address 172.16.1.1 255.255.255.0 R1(config-if)# interface loopback 101 R1(config-if)# ip address 192.168.101.1 255.255.255.0 R1(config-if)# interface fastethernet 0/0 R1(config-if)# ip address 172.16.12.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# interface serial 0/0/1 R1(config-if)# bandwidth 64 R1(config-if)# ip address 172.16.13.1 255.255.255.0 R1(config-if)# no shutdown R2# conf t R2(config)# interface loopback 2 R2(config-if)# ip address 172.16.2.1 255.255.255.0 R2(config-if)# interface loopback 102 R2(config-if)# ip address 192.168.102.1 255.255.255.0 R2(config-if)# interface fastethernet 0/0 R2(config-if)# ip address 172.16.12.2 255.255.255.0 R2(config-if)# no shutdown R2(config-if)# interface fastethernet 0/1 R2(config-if)# ip address 172.16.23.2 255.255.255.0 R2(config-if)# no shutdown R3# conf t R3(config)# interface loopback 3 R3(config-if)# ip address 172.16.3.1 255.255.255.0 R3(config-if)# interface loopback 103 R3(config-if)# ip address 192.168.103.1 255.255.255.0 R3(config-if)# interface fastethernet 0/0 R3(config-if)# ip address 172.16.23.3 255.255.255.0 R3(config-if)# no shutdown R3(config-if) # interface serial 0/0/0 R3(config-if)# bandwidth 64 R3(config-if)# ip address 172.16.13.3 255.255.255.0 R3(config-if)# clock rate 64000 R3(config-if)# no shutdown
Step 3: Configure switch VLANs.
a. Configure the switch VLANs, and place the correct access ports in each VLAN.
Note: The switch ports used are not important as long as the ports connecting to R1 Fa0/0 and R2 Fa0/0 are in VLAN 12 and the ports connecting to R3 Fa0/0 and R2 Fa0/1 are in VLAN 23.
Switch(config)# vlan 12 Switch(config-vlan)# name R1-R2 Switch(config-vlan)# vlan 23 Switch(config-vlan)# name R2-R3 Switch(config-vlan)# exit Switch(config)# interface fastEthernet 0/1 Switch(config-if)# description To R1 Fa0/0 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 12 Switch(config-if)# interface fastEthernet 0/2 Switch(config-if)# description To R2 Fa0/0 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 12 Switch(config-if)# interface fastEthernet 0/3 Switch(config-if)# description To R3 Fa0/0 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 23 Switch(config-if)# interface fastEthernet 0/4 Switch(config-if)# description To R2 Fa0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 23
b. Verify that you can ping across the local subnets.
Step 4: Configure RIP.
a. Configure RIPv2 on all three routers for the major networks. Disable automatic summarization.
R1(config)# router rip R1(config-router)# version 2 R1(config-router)# no auto-summary R1(config-router)# network 172.16.0.0 R1(config-router)# network 192.168.101.0 R2(config)# router rip R2(config-router)# version 2 R2(config-router)# no auto-summary R2(config-router)# network 172.16.0.0 R2(config-router)# network 192.168.102.0 R3(config)# router rip R3(config-router)# version 2 R3(config-router)# no auto-summary R3(config-router)# network 172.16.0.0 R3(config-router)# network 192.168.103.0
b. Verify the configuration using the show ip route rip command on each router.
R1# show ip route rip 172.16.0.0/24 is subnetted, 6 subnets R 172.16.23.0 [120/1] via 172.16.13.3, 00:02:29, Serial0/0/1 [120/1] via 172.16.12.2, 00:02:15, FastEthernet0/0 R 172.16.2.0 [120/1] via 172.16.12.2, 00:02: 15, FastEthernet0/0 R 172.16.3.0 [120/1] via 172.16.13.3, 00:02:29, Serial0/0/1 R 192.168.102.0/24 [120/1] via 172.16.12.2, 00:02:15, FastEthernet0/0 R 192.168.103.0/24 [120/1] via 172.16.13.3, 00:02:29, Serial0/0/1 R2# show ip route rip 172.16.0.0/24 is subnetted, 6 subnets R 172.16.13.0 [120/1] via 172.16.23.3, 00:02:18, FastEthernet0/1 [120/1] via 172.16.12.1, 00:02:20, FastEthernet0/0 R 172.16.1.0 [120/1] via 172.16.12.1, 00:02:20, FastEthernet0/0 R 172.16.3.0 [120/1] via 172.16.23.3, 00:02:18, FastEthernet0/1 R 192.168.103.0/24 [120/1] via 172.16.23.3, 00:02:18, FastEthernet0/1 R 192.168.101.0/24 [120/1] via 172.16.12.1, 00:02:20, FastEthernet0/0 R3# show ip route rip 172.16.0.0/24 is subnetted, 6 subnets R 172.16.12.0 [120/1] via 172.16.23.2, 00:02:32, FastEthernet0/0 [120/1] via 172.16.13.1, 00:02:47, Serial0/0/0 R 172.16.1.0 [120/1] via 172.16.13.1, 00:02:47, Serial0/0/0 R 172.16.2.0 [120/1] via 172.16.23.2, 00:02:32, FastEthernet0/0 R 192.168.102.0/24 [120/1] via 172.16.23.2, 00:02:32, FastEthernet0/0 R 192.168.101.0/24 [120/1] via 172.16.13.1, 00:02:47, Serial0/0/0 Notice that on R1, RIP chooses the serial interface as the best next hop for the R3 loopback interface.
c. Verify that each router is receiving RIP routes from other routers using the show ip protocols command.
R1# show ip protocols Routing Protocol is "rip" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Sending updates every 30 seconds, next due in 26 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Redistributing: rip Default version control: send version 2, receive version 2 Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 2 2 Serial0/0/1 2 2 Loopback1 2 2 Loopback101 2 2 Automatic network summarization is not in effect Maximum path: 4 Routing for Networks: 172.16.0.0 192.168.101.0 Routing Information Sources: Gateway Distance Last Update 172.16.12.2 120 00:00:21 172.16.13.3 120 00:00:03 Distance: (default is 120) R2# show ip protocols Routing Protocol is "rip" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Sending updates every 30 seconds, next due in 23 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Redistributing: rip Default version control: send version 2, receive version 2 Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 2 2 FastEthernet0/1 2 2 Loopback2 2 2 Loopback102 2 2 Automatic network summarization is not in effect Maximum path: 4 Routing for Networks: 172.16.0.0 192.168.102.0 Routing Information Sources: Gateway Distance Last Update 172.16.23.3 120 00:00:02 172.16.12.1 120 00:00:24 Distance: (default is 120) R3# show ip protocols Routing Protocol is "rip" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Sending updates every 30 seconds, next due in 22 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Redistributing: rip Default version control: send version 2, receive version 2 Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 2 2 Serial0/0/0 2 2 Loopback3 2 2 Loopback103 2 2 Automatic network summarization is not in effect Maximum path: 4 Routing for Networks: 172.16.0.0 192.168.103.0 Routing Information Sources: Gateway Distance Last Update 172.16.23.2 120 00:00:06 172.16.13.1 120 00:00:17 Distance: (default is 120)
Step 5: Configure OSPF.
a. Configure OSPF on all routers. Include the entire major network in area 0 on all three routers. Remember to change the network type on the loopback interfaces.
R1(config)# interface loopback 1 R1(config-if)# ip ospf network point-to-point R1(config-if)# interface loopback 101 R1(config-if)# ip ospf network point-to-point R1(config-if)# router ospf 1 R1(config-router)# network 172.16.0.0 0.0.255.255 area 0 R1(config-router)# network 192.168.101.0 0.0.0.255 area 0 R2(config)# interface loopback 2 R2(config-if)# ip ospf network point-to-point R2(config-if)# interface loopback 102 R2(config-if)# ip ospf network point-to-point R2(config-if)# router ospf 1 R2(config-router)# network 172.16.0.0 0.0.255.255 area 0 R2(config-router)# network 192.168.102.0 0.0.0.255 area 0 R3(config)# interface loopback 3 R3(config-if)# ip ospf network point-to-point R3(config-if)# interface loopback 103 R3(config-if)# ip ospf network point-to-point R3(config-if)# router ospf 1 R3(config-router)# network 172. 16.0.0 0.0.255.255 area 0 R3(config-router)# network 192.168.103.0 0.0.0.255 area 0
b. Verify the configuration using the show ip ospf neighbors and show ip route commands on each router.
R1# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.103.1 0 FULL/ - 00:00:39 172.16.13.3 Serial0/0/1 192.168.102.1 1 FULL/DR 00:00:39 172.16.12.2 FastEthernet0/0 R1# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets O 172.16.23.0 [110/2] via 172.16.12.2, 00:00:48, FastEthernet0/0 C 172.16.12.0 is directly connected, FastEthernet0/0 C 172.16.13.0 is directly connected, Serial0/0/1 C 172.16.1.0 is directly connected, Loopback1 O 172.16.2.0 [110/2] via 172.16.12.2, 00:00:48, FastEthernet0/0 O 172.16.3.0 [110/3] via 172.16.12.2, 00:00:48, FastEthernet0/0 O 192.168.102.0/24 [110/2] via 172.16.12.2, 00:00:48, FastEthernet0/0 O 192.168.103.0/24 [110/3] via 172.16.12.2, 00:00:49, FastEthernet0/0 C 192.168.101.0/24 is directly connected, Loopback101 R2# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.103.1 1 FULL/DR 00:00:31 172.16.23.3 FastEthernet0/1 192.168.101.1 1 FULL/BDR 00:00:34 172.16.12.1 FastEthernet0/0 R2# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets C 172.16.23.0 is directly connected, FastEthernet0/1 C 172.16.12.0 is directly connected, FastEthernet0/0 O 172.16.13.0 [110/1563] via 172.16.23.3, 00:01:19, FastEthernet0/1 [110/1563] via 172.16.12.1, 00:01:19, FastEthernet0/0 O 172.16.1.0 [110/2] via 172.16.12.1, 00:01:19, FastEthernet0/0 C 172.16.2.0 is directly connected, Loopback2 O 172.16.3.0 [110/2] via 172.16.23.3, 00:01:19, FastEthernet0/1 C 192.168.102.0/24 is directly connected, Loopback102 O 192.168.103.0/24 [110/2] via 172.16.23.3, 00:01:20, FastEthernet0/1 O 192.168.101.0/24 [110/2] via 172.16.12.1, 00:01:20, FastEthernet0/0 R3# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 192.168.101.1 0 FULL/ - 00:00:36 172.16.13.1 Serial0/0/0 192.168.102.1 1 FULL/BDR 00:00:33 172.16.23.2 FastEthernet0/0 R3# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets C 172.16.23.0 is directly connected, FastEthernet0/0 O 172.16.12.0 [110/2] via 172.16.23.2, 00:02:10, FastEthernet0/0 C 172.16.13.0 is directly connected, Serial0/0/0 O 172.16.1.0 [110/3] via 172.16.23.2, 00:02:10, FastEthernet0/0 O 172.16.2.0 [110/2] via 172.16.23.2, 00:02:10, FastEthernet0/0 C 172.16.3.0 is directly connected, Loopback3 O 192.168.102.0/24 [110/2] via 172.16.23.2, 00:02:10, FastEthernet0/0 C 192.168.103.0/24 is directly connected, Loopback103 O 192.168.101.0/24 [110/3] via 172.16.23.2, 00:02:11, FastEthernet0/0 Notice that all the OSPF routes have replaced the RIP routes in the routing table. This is because OSPF has an administrative distance of 110, and RIP has an administrative distance of 120.
What is the best next hop on R1 for 172.16.3.1 with only RIP running?
On R1, the best next hop to 172.16.3.1 is the R3 serial 0/0/0 interface with an IP address of 172.16.13.3.
What is the best next hop on R1 for 172.16.3.1 with OSPF running?
On R1, the best next hop to 172.16.3.1 is the R2 Fast Ethernet 0/0 interface with an IP address of 172.16.12.2. On R1, the best next hop for the R3 loopback is now through the VLAN between R1 and R2. This is because the sum of the costs for the two Ethernet links is still less than that of the single low-bandwidth (64 kb/s) serial link. This is one of the reasons why RIP’s metric of a hop count is not very effective.
Which metric does R1 use to make routing decisions about whether to cross the serial link to R3 to reach R3’s 172.16.3.1?
The metric R1 receives for the loopback 3 network on R3 via the serial link is 1562, which is not preferred by
R1.
Use the following information for your answer.
R1# show ip ospf database router adv-router 192.168.103.1 OSPF Router with ID (192.168.101.1) (Process ID 1) Router Link States (Area 0) LS age: 433 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 192.168.103.1 Advertising Router: 192.168.103.1 LS Seq Number: 80000003 Checksum: 0xE87F Length: 84 Number of Links: 5 Link connected to: a Stub Network (Link ID) Network/subnet number: 192.168.103.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: a Stub Network (Link ID) Network/subnet number: 172.16.3.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 192.168.101.1 (Link Data) Router Interface address: 172.16.13.3 Number of TOS metrics: 0 TOS 0 Metrics: 1562 Link connected to: a Stub Network (Link ID) Network/subnet number: 172.16.13.0 (Link Data) Network Mask: 255.255.255.0 Number of TOS metrics: 0 TOS 0 Metrics: 1562 Link connected to: a Transit Network (Link ID) Designated Router address: 172.16.23.3 (Link Data) Router Interface address: 172.16.23.3 Number of TOS metrics: 0 TOS 0 Metrics: 1
Step 6: Modify the routing protocol distance.
The distance command is a protocol-independent way to manipulate routing protocol distances. This command is different from the routing protocol-specific commands such as distance ospf and distance eigrp. This command lets you globally change a routing protocol’s distances, change only routes from a certain neighbor or those matching an access list, or a combination of any two of these three options.
Try applying the distance distance command, which changes the distance of every route. The previous output of the show ip route command shows that OSPF marks routes it injects into the routing table with a default administrative distance of 110. RIP injects routes into the routing table with a default administrative
distance of 120.
What would happen if the administrative distance on each router for RIP were set to 100?
All RIP routes would be preferred in the routing tables over OSPF routes.
a. On all three routers, change the distance of RIP to 100.
R1(config)# router rip R1(config-router)# distance 100 R2(config)# router rip R2(config-router)# distance 100 R3(config)# router rip R3(config-router)# distance 100
b. Examine the output of the show ip route command. Notice that all the routes have become RIP routes because RIP now has a lower distance than OSPF.
R1# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets R 172.16.23.0 [100/1] via 172.16.13.3, 00:00:17, Serial0/0/1 [100/1] via 172.16.12.2, 00:00:09, FastEthernet0/0 C 172.16.12.0 is directly connected, FastEthernet0/0 C 172.16.13.0 is directly connected, Serial0/0/1 C 172.16.1.0 is directly connected, Loopback1 R 172.16.2.0 [100/1] via 172.16.12.2, 00:00:09, FastEthernet0/0 R 172.16.3.0 [100/1] via 172.16.13.3, 00:00:17, Serial0/0/1 R 192.168.102.0/24 [100/1] via 172.16.12.2, 00:00:10, FastEthernet0/0 R 192.168.103.0/24 [100/1] via 172.16.13.3, 00:00:18, Serial0/0/1 C 192.168.101.0/24 is directly connected, Loopback101 R2# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets C 172.16.23.0 is directly connected, FastEthernet0/1 C 172.16.12.0 is directly connected, FastEthernet0/0 R 172.16.13.0 [100/1] via 172.16.23.3, 00:00:07, FastEthernet0/1 [100/1] via 172.16.12.1, 00:00:07, FastEthernet0/0 R 172.16.1.0 [100/1] via 172.16.12.1, 00:00:07, FastEthernet0/0 C 172.16.2.0 is directly connected, Loopback2 R 172.16.3.0 [100/1] via 172.16.23.3, 00:00:07, FastEthernet0/1 C 192.168.102.0/24 is directly connected, Loopback102 R 192.168.103.0/24 [100/1] via 172.16.23.3, 00:00: 08, FastEthernet0/1 R 192.168.101.0/24 [100/1] via 172.16.12.1, 00:00:08, FastEthernet0/0 R3# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets C 172.16.23.0 is directly connected, FastEthernet0/0 R 172.16.12.0 [100/1] via 172.16.23.2, 00:00:07, FastEthernet0/0 [100/1] via 172.16.13.1, 00:00:02, Serial0/0/0 C 172.16.13.0 is directly connected, Serial0/0/0 R 172.16.1.0 [100/1] via 172.16.13.1, 00:00:02, Serial0/0/0 R 172.16.2.0 [100/1] via 172.16.23.2, 00:00:07, FastEthernet0/0 C 172.16.3.0 is directly connected, Loopback3 R 192.168.102.0/24 [100/1] via 172.16.23.2, 00:00:08, FastEthernet0/0 C 192.168.103.0/24 is directly connected, Loopback103 R 192.168.101.0/24 [100/1] via 172.16.13.1, 00:00:03, Serial0/0/0
c. You can display the new default distance for RIP using the show ip protocols command.
R1# show ip protocols Routing Protocol is "rip" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Sending updates every 30 seconds, next due in 11 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Redistributing: rip Default version control: send version 2, receive version 2 Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 2 2 Serial0/0/1 2 2 Loopback1 2 2 Loopback101 2 2 Automatic network summarization is not in effect Maximum path: 4 Routing for Networks: 172.16.0.0 192.168.101.0 Routing Information Sources: Gateway Distance Last Update 172.16.13.3 100 00:00:14 172.16.12.2 100 00:00:22 Distance: (default is 100) <output omitted>
Step 7: Modify distance based on route source.
You can also modify administrative distance based on route source using the distance distance address wildcard command, where address and wildcard represent the peer advertising the route. For OSPF, the address is the router ID.
a. On all three routers, change the OSPF administrative distance to 85 for any routes being advertised from routers with IDs in the range of 192.168.100.0/21.
R1(config)# router ospf 1 R1(config-router)# distance 85 192.168.100.0 0.0.3.255 R2(config)# router ospf 1 R2(config-router)# distance 85 192.168.100.0 0.0.3.255 R3(config)# router ospf 1 R3(config-router)# distance 85 192.168.100.0 0.0.3.255
b. Verify the change with the show ip protocols and show ip route commands.
R1# show ip route <output omitted> Gateway of last resort is not set 172.16.0.0/24 is subnetted, 6 subnets O 172.16.23.0 [85/2] via 172.16.12.2, 00:00:31, FastEthernet0/0 C 172.16.12.0 is directly connected, FastEthernet0/0 C 172.16.13.0 is directly connected, Serial0/0/1 C 172.16.1.0 is directly connected, Loopback1 O 172.16.2.0 [85/2] via 172.16.12.2, 00:00:31, FastEthernet0/0 O 172.16.3.0 [85/3] via 172.16.12.2, 00:00:31, FastEthernet0/0 O 192.168.102.0/24 [85/2] via 172.16.12.2, 00:00:31, FastEthernet0/0 O 192.168.103.0/24 [85/3] via 172.16.12.2, 00:00:32, FastEthernet0/0 C 192.168.101.0/24 is directly connected, Loopback101 R2# show ip route <output omitted> Gateway of last resort is not set 172.16.0.0/24 is subnetted, 6 subnets C 172.16.23.0 is directly connected, FastEthernet0/1 C 172.16.12.0 is directly connected, FastEthernet0/0 O 172.16.13.0 [85/1563] via 172.16.23.3, 00:00:53, FastEthernet0/1 [ 85/1563] via 172.16.12.1, 00:00:53, FastEthernet0/0 O 172.16.1.0 [85/2] via 172.16.12.1, 00:00:53, FastEthernet0/0 C 172.16.2.0 is directly connected, Loopback2 O 172.16.3.0 [85/2] via 172.16.23.3, 00:00:53, FastEthernet0/1 C 192.168.102.0/24 is directly connected, Loopback102 O 192.168.103.0/24 [85/2] via 172.16.23.3, 00:00:54, FastEthernet0/1 O 192.168.101.0/24 [85/2] via 172.16.12.1, 00:00:54, FastEthernet0/0 R3# show ip route <output omitted> Gateway of last resort is not set 172.16.0.0/24 is subnetted, 6 subnets C 172.16.23.0 is directly connected, FastEthernet0/0 O 172.16.12.0 [85/2] via 172.16.23.2, 00:01:15, FastEthernet0/0 C 172.16.13.0 is directly connected, Serial0/0/0 O 172.16.1.0 [85/3] via 172.16.23.2, 00:01:15, FastEthernet0/0 O 172.16.2.0 [85/2] via 172.16.23.2, 00:01:15, FastEthernet0/0 C 172.16.3.0 is directly connected, Loopback3 O 192.168.102.0/24 [85/2] via 172.16.23.2, 00:01:15, FastEthernet0/0 C 192.168.103.0/24 is directly connected, Loopback103 O 192.168.101.0/24 [85/3] via 172.16.23.2, 00:01:16, FastEthernet0/0 R1# show ip protocols Routing Protocol is "ospf 1" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Router ID 192.168.101.1 Number of areas in this router is 1. 1 normal 0 stub 0 nssa Maximum path: 4 Routing for Networks: 172.16.0.0 0.0.255.255 area 0 192.168.101.0 0.0.0.255 area 0 Reference bandwidth unit is 100 mbps Routing Information Sources: Gateway Distance Last Update 192.168.103.1 85 00:05:47 192.168.102.1 85 00:05:47 Distance: (default is 110) Address Wild mask Distance List 192.168.100.0 0.0.3.255 85 Each of the routers should have an entry similar to the one highlighted above.
Step 8: Modify distance based on an access list
You can also modify administrative distance based on which routes match an access list using the distance distance address wildcard acl command. The way you list routes in an access list which will be used to modify distance is similar to how you list them when the access list is used to filter routes. For this lab, create an access list containing all the subnets of 172.16.0.0/16. Then associate the access list with the distance command, setting the address and wildcard to be any IP address (i.e., any route source).
a. On all three routers, change the distances of the affected routes to 65.
R1(config)# access-list 1 permit 172.16.0.0 0.0.255.255 R1(config)# router rip R1(config-router)# distance 65 0.0.0.0 255.255.255.255 1 R2(config)# access-list 1 permit 172.16.0.0 0.0.255.255 R2(config)# router rip R2(config-router)# distance 65 0.0.0.0 255.255.255.255 1 R3(config)# access-list 1 permit 172.16.0.0 0.0.255.255 R3(config)# router rip R3(config-router)# distance 65 0.0.0.0 255.255.255.255 1
b. Verify the change with the show ip protocols and show ip route commands.
R1# show ip protocols <output omitted> Routing Protocol is "rip" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Sending updates every 30 seconds, next due in 22 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Redistributing: rip Default version control: send version 2, receive version 2 Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 2 2 Serial0/0/1 2 2 Loopback1 2 2 Loopback101 2 2 Automatic network summarization is not in effect Maximum path: 4 Routing for Networks: 172.16.0.0 192.168.101.0 Routing Information Sources: Gateway Distance Last Update 172.16.12.2 64 00:00:11 172.16.13.3 64 00:00:12 Distance: (default is 100) Address Wild mask Distance List 0.0.0.0 255.255.255.255 65 1 R1# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets R 172.16.23.0 [65/1] via 172.16.13.3, 00:00:20, Serial0/0/1 [ 65/1] via 172.16.12.2, 00:00:19, FastEthernet0/0 C 172.16.12.0 is directly connected, FastEthernet0/0 C 172.16.13.0 is directly connected, Serial0/0/1 C 172.16.1.0 is directly connected, Loopback1 R 172.16.2.0 [65/1] via 172.16.12.2, 00:00:19, FastEthernet0/0 R 172.16.3.0 [65/1] via 172.16.13.3, 00:00:20, Serial0/0/1 O 192.168.102.0/24 [85/2] via 172.16.12.2, 00:09:09, FastEthernet0/0 O 192.168.103.0/24 [85/3] via 172.16.12.2, 00:09:09, FastEthernet0/0 C 192.168.101.0/24 is directly connected, Loopback101 R2# show ip protocols <output omitted> Routing Protocol is "rip" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Sending updates every 30 seconds, next due in 27 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Redistributing: rip Default version control: send version 2, receive version 2 Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 2 2 FastEthernet0/1 2 2 Loopback2 2 2 Loopback102 2 2 Automatic network summarization is not in effect Maximum path: 4 Routing for Networks: 172.16.0.0 192.168.102.0 Routing Information Sources: Gateway Distance Last Update 172.16.23.3 65 00:00:06 172.16.12.1 65 00:00:22 Distance: (default is 100) Address Wild mask Distance List 0.0.0.0 255.255.255.255 65 1 R2# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets C 172.16.23.0 is directly connected, FastEthernet0/1 C 172.16.12.0 is directly connected, FastEthernet0/0 R 172.16.13.0 [65/1] via 172.16.23.3, 00:00:10, FastEthernet0/1 [ 65/1] via 172.16.12.1, 00:00:00, FastEthernet0/0 R 172.16.1.0 [65/1] via 172.16.12.1, 00:00:00, FastEthernet0/0 C 172.16.2.0 is directly connected, Loopback2 R 172.16.3.0 [65/1] via 172.16.23.3, 00:00:10, FastEthernet0/1 C 192.168.102.0/24 is directly connected, Loopback102 O 192.168.103.0/24 [85/2] via 172.16.23.3, 00:09:35, FastEthernet0/1 O 192.168.101.0/24 [85/2] via 172.16.12.1, 00:09:35, FastEthernet0/0 R3# show ip protocols <output omitted> Routing Protocol is "rip" Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Sending updates every 30 seconds, next due in 15 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Redistributing: rip Default version control: send version 2, receive version 2 Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 2 2 Serial0/0/0 2 2 Loopback3 2 2 Loopback103 2 2 Automatic network summarization is not in effect Maximum path: 4 Routing for Networks: 172.16.0.0 192.168.103.0 Routing Information Sources: Gateway Distance Last Update 172.16.23.2 65 00:00:24 172.16.13.1 65 00:00:16 Distance: (default is 100) Address Wild mask Distance List 0.0.0.0 255.255.255.255 65 1 R3# show ip route <output omitted> 172.16.0.0/24 is subnetted, 6 subnets C 172.16.23.0 is directly connected, FastEthernet0/1 R 172.16.12.0 [65/1] via 172.16.23.2, 00:00:00, FastEthernet0/1 [ 65/1] via 172.16.13.1, 00:00:19, Serial0/0/0 C 172.16.13.0 is directly connected, Serial0/0/0 R 172.16.1.0 [65/1] via 172.16.13.1, 00:00:19, Serial0/0/0 R 172.16.2.0 [65/1] via 172.16.23.2, 00:00:00, FastEthernet0/1 C 172.16.3.0 is directly connected, Loopback3 O 192.168.102.0/24 [85/2] via 172.16.23.2, 00:09:43, FastEthernet0/1 C 192.168.103.0/24 is directly connected, Loopback103 O 192.168.101.0/24 [85/3] via 172.16.23.2, 00:09:43, FastEthernet0/1
c. Verify full connectivity with the following Tcl script.
R1# tclsh foreach address { 172.16.1.1 172.16.2.1 172.16.3.1 172.16.12.1 172.16.12.2 172.16.13.1 172.16.13.3 172.16.23.2 172.16.23.3 192.168. 101.1 192.168.102.1 192.168.103.1 } { ping $address }
Challenge
Attempt this exercise based on what you know about OSPF, Dijkstra’s algorithm, and the distance command. Using only the distance command, write out the commands necessary to confuse the routers in this topology
so that packets destined for 172.16.3.1 would continually bounce between R1 to R2?
A permanent routing loop between R1 and R2 can be created by leaving the administrative distances at their default values on R1 and, on R2, by setting the administrative distance of RIP-discovered routes from R1 to a value lower than 110 to favor them more than OSPF-discovered routes.
Because it is possible to intentionally break routing in this way, what degree of caution should be exercised when manipulating administrative distances in a production network?
Extreme caution should be used when manipulating administrative distances.
Router Interface Summary Table
Router Interface Summary | ||||
Router Model | Ethernet Interface #1 |
Ethernet Interface #2 |
Serial Interface #1 |
Serial Interface #2 |
1700 | Fast Ethernet 0 (Fa0) |
Fast Ethernet 1 (Fa1) |
Serial 0 (S0) | Serial 0/0/1 (S0/0/1) |
1800 | Fast Ethernet 0/0 (Fa0/0) |
Fast Ethernet 0/1 (Fa0/1) |
Serial 0/0/0 (S0/0/0) |
Serial 0/0/1 (S0/0/1) |
2600 | Fast Ethernet 0/0 (Fa0/0) |
Fast Ethernet 0/1 (Fa0/1) |
Serial 0/0 (S0/0) | Serial 0/1 (S0/1) |
2800 | Fast Ethernet 0/0 (Fa0/0) |
Fast Ethernet 0/1 (Fa0/1) |
Serial 0/0/0 (S0/0/0) |
Serial 0/0/1 (S0/0/1) |
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many interfaces the router has. Rather than list all combinations of configurations for each router class, this table includes identifiers for the possible combinations of Ethernet and serial interfaces in the device. The table does not include any other type of interface, even though a specific router might contain one. For example, for an ISDN BRI interface, the string in parenthesis is the legal abbreviation that can be used in Cisco IOS commands to represent the interface. |
Device Configurations (Instructor version)
Router R1
hostname R1 ! interface Loopback1 ip address 172.16.1.1 255.255.255.0 ip ospf network point-to-point ! interface Loopback101 ip address 192.168.101.1 255.255.255.0 ip ospf network point-to-point ! interface FastEthernet0/0 ip address 172.16.12.1 255.255.255.0 no shutdown ! interface Serial0/0/1 bandwidth 64 ip address 172.16.13.1 255.255.255.0 no shutdown ! router ospf 1 network 172.16.0.0 0.0.255.255 area 0 network 192.168.101.0 0.0.0.255 area 0 distance 85 192.168.100.0 0.0.3.255 ! router rip version 2 network 172.16.0.0 network 192.168.101.0 distance 100 distance 65 0.0.0.0 255.255.255.255 1 no auto-summary ! access-list 1 permit 172.16.0.0 0.0.255.255 ! end
Router R2
hostname R2 ! interface Loopback2 ip address 172.16.2.1 255.255.255.0 ip ospf network point-to-point ! interface Loopback102 ip address 192.168.102.1 255.255.255.0 ip ospf network point-to-point ! interface FastEthernet0/0 ip address 172.16.12.2 255.255.255.0 no shutdown ! interface FastEthernet0/1 ip address 172.16.23.2 255.255.255.0 no shutdown ! router ospf 1 network 172.16.0.0 0.0.255.255 area 0 network 192.168.102.0 0.0.0.255 area 0 distance 85 192.168.100.0 0.0.3.255 ! router rip version 2 network 172.16.0.0 network 192.168.102.0 distance 100 distance 65 0.0.0.0 255.255.255.255 1 no auto-summary ! access-list 1 permit 172.16.0.0 0.0.255.255 ! end
Router R3
hostname R3 ! interface Loopback3 ip address 172.16.3.1 255.255.255.0 ip ospf network point-to-point ! interface Loopback103 ip address 192.168.103.1 255.255.255.0 ip ospf network point-to-point ! interface FastEthernet0/0 ip address 172.16.23.3 255.255.255.0 no shutdown ! interface Serial0/0/0 bandwidth 64 ip address 172.16.13.3 255.255.255.0 clock rate 64000 no shutdown ! router ospf 1 network 172.16.0.0 0.0.255.255 area 0 network 192.168.103.0 0.0.0.255 area 0 distance 85 192.168.100.0 0.0.3.255 ! router rip version 2 network 172.16.0.0 network 192.168.103.0 distance 100 distance 65 0.0.0. 0 255.255.255.255 1 no auto-summary ! access-list 1 permit 172.16.0.0 0.0.255.255 ! end
More Resources