en conf t hostname R1 int gig0/1 ip addr 172.16.2.1 255.255.255.0 no shut int gig0/2 ip addr 172.16.3.1 255.255.255.0 no shut int gig0/3 ip addr 172.16.1.1 255.255.255.0 no shut end wr
en conf t hostname R2 int gig0/1 ip addr 172.16.2.2 255.255.255.0 no shut int gig0/2 ip addr 172.16.5.2 255.255.255.0 no shut end wr
en conf t hostname R3 int gig0/1 ip addr 172.16.5.3 255.255.255.0 no shut int gig0/2 ip addr 172.16.4.3 255.255.255.0 no shut end wr
en conf t hostname R4 int gig0/1 ip addr 172.16.3.254 255.255.255.0 no shut int gig0/2 ip addr 172.16.4.4 255.255.255.0 no shut end wr
ifconfig eth1 up 10.0.0.10 netmask 255.255.255.252 route add -net 10.0.0.0/16 gw 10.0.0.9 dev eth1 route add -net 192.168.0.0/29 gw 10.0.0.9 dev eth1
sudo ip addr add 172.16.1.5/24 dev eth1 sudo ip route del 0.0.0.0/0 sudo ip route add 0.0.0.0/0 via 172.16.1.5
ifconfig eth1 up 172.16.1.5 netmask 255.255.255.0 route add -net 0.0.0.0/0 gw 172.16.1.5 dev eth1 sudo ip route del 0.0.0.0/0 dev eth0
ifconfig eth1 up 10.0.0.3 netmask 255.255.255.248 route add -net 10.0.0.0/16 gw 10.0.0.1 dev eth1 route add -net 192.168.0.0/29 gw 10.0.0.1 dev eth1 route add -net 10.0.0.0/16 gw 10.0.0.2 dev eth1 route add -net 192.168.0.0/29 gw 10.0.0.2 dev eth1
sudo ip addr add 172.16.4.5/24 dev eth1 sudo ip route del 0.0.0.0/0 sudo ip route add 0.0.0.0/0 via 172.16.4.4
ifconfig eth1 up 172.16.4.5 netmask 255.255.255.0 route add -net 0.0.0.0/0 gw 172.16.4.4 dev eth1 sudo ip route del 0.0.0.0/0 dev eth0
R1-R4
en conf t router rip version 2 network 172.16.0.0 end
Show routing table.
R1#sh ip ro Codes: L - local, C - connected, S - static, 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 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks C 172.16.1.0/24 is directly connected, GigabitEthernet0/3 L 172.16.1.1/32 is directly connected, GigabitEthernet0/3 C 172.16.2.0/24 is directly connected, GigabitEthernet0/1 L 172.16.2.1/32 is directly connected, GigabitEthernet0/1 C 172.16.3.0/24 is directly connected, GigabitEthernet0/2 L 172.16.3.1/32 is directly connected, GigabitEthernet0/2 R 172.16.4.0/24 [120/1] via 172.16.3.254, 00:00:06, GigabitEthernet0/2 R 172.16.5.0/24 [120/1] via 172.16.2.2, 00:00:06, GigabitEthernet0/1 R1#
R2#sh ip ro Codes: L - local, C - connected, S - static, 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 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 7 subnets, 2 masks R 172.16.1.0/24 [120/1] via 172.16.2.1, 00:00:02, GigabitEthernet0/1 C 172.16.2.0/24 is directly connected, GigabitEthernet0/1 L 172.16.2.2/32 is directly connected, GigabitEthernet0/1 R 172.16.3.0/24 [120/1] via 172.16.2.1, 00:00:02, GigabitEthernet0/1 R 172.16.4.0/24 [120/1] via 172.16.5.3, 00:00:02, GigabitEthernet0/2 C 172.16.5.0/24 is directly connected, GigabitEthernet0/2 L 172.16.5.2/32 is directly connected, GigabitEthernet0/2 R2#
Next hop route to 172.16.4.5 is selected 172.16.3.254 interface gig0/2, because of metric value 1 and hop count 1.
cisco@A:~$ ping 172.16.4.5 -c4 PING 172.16.4.5 (172.16.4.5) 56(84) bytes of data. 64 bytes from 172.16.4.5: icmp_seq=1 ttl=62 time=5.25 ms 64 bytes from 172.16.4.5: icmp_seq=2 ttl=62 time=4.91 ms 64 bytes from 172.16.4.5: icmp_seq=3 ttl=62 time=2.37 ms 64 bytes from 172.16.4.5: icmp_seq=4 ttl=62 time=3.33 ms --- 172.16.4.5 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3003ms rtt min/avg/max/mdev = 2.377/3.968/5.255/1.172 ms cisco@A:~$ tracepath -n 172.16.4.5 1?: [LOCALHOST] pmtu 1500 1: 172.16.1.1 1.920ms 1: 172.16.1.1 1.816ms 2: 172.16.3.254 3.188ms 3: 172.16.4.5 3.006ms reached Resume: pmtu 1500 hops 3 back 3 cisco@A:~$
R1-R4
en conf t router ospf 1 network 172.16.0.0 0.0.255.255 area 0 end
R1# *Mar 3 12:25:04.521: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.5.2 on GigabitEthernet0/1 from LOADING to FULL, Loading Done R1# R1# *Mar 3 12:25:09.291: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.4.4 on GigabitEthernet0/2 from LOADING to FULL, Loading Done R1# R1# *Mar 3 12:25:09.291: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.4.4 on GigabitEthernet0/2 from LOADING to FULL, Loading Done R1#sh ip ro Codes: L - local, C - connected, S - static, 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 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks C 172.16.1.0/24 is directly connected, GigabitEthernet0/3 L 172.16.1.1/32 is directly connected, GigabitEthernet0/3 C 172.16.2.0/24 is directly connected, GigabitEthernet0/1 L 172.16.2.1/32 is directly connected, GigabitEthernet0/1 C 172.16.3.0/24 is directly connected, GigabitEthernet0/2 L 172.16.3.1/32 is directly connected, GigabitEthernet0/2 O 172.16.4.0/24 [110/2] via 172.16.3.254, 00:00:26, GigabitEthernet0/2 O 172.16.5.0/24 [110/2] via 172.16.2.2, 00:00:26, GigabitEthernet0/1 R1#
cisco@A:~$ ping 172.16.4.5 -c4 PING 172.16.4.5 (172.16.4.5) 56(84) bytes of data. 64 bytes from 172.16.4.5: icmp_seq=1 ttl=62 time=9.40 ms 64 bytes from 172.16.4.5: icmp_seq=2 ttl=62 time=3.87 ms 64 bytes from 172.16.4.5: icmp_seq=3 ttl=62 time=4.96 ms 64 bytes from 172.16.4.5: icmp_seq=4 ttl=62 time=4.74 ms --- 172.16.4.5 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3005ms rtt min/avg/max/mdev = 3.879/5.749/9.403/2.149 ms cisco@A:~$ tracepath -n 172.16.4.5 1?: [LOCALHOST] pmtu 1500 1: 172.16.1.1 2.760ms 1: 172.16.1.1 1.876ms 2: 172.16.3.254 5.471ms 3: 172.16.4.5 3.960ms reached Resume: pmtu 1500 hops 3 back 3 cisco@A:~$
Currently best next hop route to 172.16.4.5 selected 172.16.3.254 because of accumulated cost is lower than R1-R2-R3 3 > 1.
Now, change link speed 1000 to 10.
R1
en conf t int gig0/2 speed 10 duplex full end
R4
en conf t int gig0/1 speed 10 duplex full end
Then changed route to 172.16.4.5 next hop 172.16.2.2 because of accumulated link cost R1-R4 be a 10 > 3 R1-R2-R3.
R1#sh ip ro Codes: L - local, C - connected, S - static, 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 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is not set 172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks C 172.16.1.0/24 is directly connected, GigabitEthernet0/3 L 172.16.1.1/32 is directly connected, GigabitEthernet0/3 C 172.16.2.0/24 is directly connected, GigabitEthernet0/1 L 172.16.2.1/32 is directly connected, GigabitEthernet0/1 C 172.16.3.0/24 is directly connected, GigabitEthernet0/2 L 172.16.3.1/32 is directly connected, GigabitEthernet0/2 O 172.16.4.0/24 [110/3] via 172.16.2.2, 00:00:53, GigabitEthernet0/1 O 172.16.5.0/24 [110/2] via 172.16.2.2, 00:07:29, GigabitEthernet0/1 R1# R1#sh ip ospf int gig0/2 GigabitEthernet0/2 is up, line protocol is up Internet Address 172.16.3.1/24, Area 0, Attached via Network Statement Process ID 1, Router ID 172.16.3.1, Network Type BROADCAST, Cost: 10 Topology-MTID Cost Disabled Shutdown Topology Name 0 10 no no Base Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) 172.16.4.4, Interface address 172.16.3.254 Backup Designated router (ID) 172.16.3.1, Interface address 172.16.3.1 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:06 Supports Link-local Signaling (LLS) Cisco NSF helper support enabled IETF NSF helper support enabled Index 1/2/2, flood queue length 0 Next 0x0(0)/0x0(0)/0x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 1 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 172.16.4.4 (Designated Router) Suppress hello for 0 neighbor(s) R1#sh ip ospf int gig0/1 GigabitEthernet0/1 is up, line protocol is up Internet Address 172.16.2.1/24, Area 0, Attached via Network Statement Process ID 1, Router ID 172.16.3.1, Network Type BROADCAST, Cost: 1 Topology-MTID Cost Disabled Shutdown Topology Name 0 1 no no Base Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) 172.16.5.2, Interface address 172.16.2.2 Backup Designated router (ID) 172.16.3.1, Interface address 172.16.2.1 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:08 Supports Link-local Signaling (LLS) Cisco NSF helper support enabled IETF NSF helper support enabled Index 1/1/1, flood queue length 0 Next 0x0(0)/0x0(0)/0x0(0) Last flood scan length is 1, maximum is 2 Last flood scan time is 1 msec, maximum is 2 msec Neighbor Count is 1, Adjacent neighbor count is 1 Adjacent with neighbor 172.16.5.2 (Designated Router) Suppress hello for 0 neighbor(s) R1#
cisco@A:~$ ping 172.16.4.5 -c4 PING 172.16.4.5 (172.16.4.5) 56(84) bytes of data. 64 bytes from 172.16.4.5: icmp_seq=1 ttl=62 time=9.28 ms 64 bytes from 172.16.4.5: icmp_seq=2 ttl=62 time=4.87 ms 64 bytes from 172.16.4.5: icmp_seq=3 ttl=62 time=4.31 ms 64 bytes from 172.16.4.5: icmp_seq=4 ttl=62 time=4.67 ms --- 172.16.4.5 ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 4.318/5.787/9.287/2.032 ms cisco@A:~$ tracepath -n 172.16.4.5 1?: [LOCALHOST] pmtu 1500 1: 172.16.1.1 1.969ms 1: 172.16.1.1 2.735ms 2: 172.16.2.2 5.299ms asymm 4 3: 172.16.5.3 9.266ms 4: 172.16.4.5 4.410ms reached Resume: pmtu 1500 hops 4 back 3 cisco@A:~$
Route path changed R1-R2-R3 because R1-R4 cost is 10.