Wednesday 5 September 2012

Simple Routing Loop


R2 is redistributing RIP routes into OSPF domain.
R3 is redistributing OSPF routes in RIP domain with a metric of 1.
R5 is redistributing connected Loopback0 network which is 192.168.5.0/24 with a metric of 1.

R1 Config

interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.123.1 255.255.255.0
!
router ospf 1
 log-adjacency-changes
 network 1.1.1.1 0.0.0.0 area 0
 network 192.168.123.1 0.0.0.0 area 0

R2 Config

interface FastEthernet0/0
 ip address 192.168.123.2 255.255.255.0
!
interface FastEthernet0/1
 ip address 192.168.234.2 255.255.255.0
!
router ospf 1
 log-adjacency-changes
 redistribute rip subnets
 network 192.168.123.2 0.0.0.0 area 0
!
router rip
 version 2
 network 192.168.234.0
 no auto-summary

R3 Config

interface FastEthernet0/0
 ip address 192.168.123.3 255.255.255.0
 !
interface FastEthernet0/1
 ip address 192.168.234.3 255.255.255.0
!
router ospf 1
 log-adjacency-changes
 network 192.168.123.3 0.0.0.0 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 1
 network 192.168.234.0
 no auto-summary

R4 Config

interface FastEthernet0/0
 ip address 192.168.234.4 255.255.255.0
!
interface FastEthernet0/1
 ip address 192.168.45.4 255.255.255.0
!
router rip
 version 2
 network 192.168.45.0
 network 192.168.234.0
 no auto-summary

R5 Config

interface Loopback0
 ip address 192.168.5.5 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.45.5 255.255.255.0
!
router rip
 version 2
 redistribute connected metric 1
 network 192.168.45.0
 no auto-summary

Verification

-R5 is learning the prefix 1.1.1.1/32.

R5#show ip route

R    192.168.123.0/24 [120/2] via 192.168.45.4, 00:00:26, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/2] via 192.168.45.4, 00:00:26, FastEthernet0/0
C    192.168.45.0/24 is directly connected, FastEthernet0/0
R    192.168.234.0/24 [120/1] via 192.168.45.4, 00:00:26, FastEthernet0/0
C    192.168.5.0/24 is directly connected, Loopback0

-Now R4 is learning the prefix 1.1.1.1/32 from the both R3 and R5 being the metric 1 from both sources.

R4#show  ip route

R    192.168.123.0/24 [120/1] via 192.168.234.3, 00:00:09, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 192.168.234.3, 00:00:09, FastEthernet0/0
C    192.168.45.0/24 is directly connected, FastEthernet0/1
C    192.168.234.0/24 is directly connected, FastEthernet0/0
R    192.168.5.0/24 [120/1] via 192.168.234.3, 00:00:09, FastEthernet0/0
                    [120/1] via 192.168.45.5, 00:00:01, FastEthernet0/1


-From R3 point of view, it takes the route 1.1.1.1/32 learn from R3becasue the metric from R3 is better than R4.

R2#show ip route

C    192.168.123.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/11] via 192.168.123.1, 00:08:38, FastEthernet0/0
R    192.168.45.0/24 [120/1] via 192.168.234.4, 00:00:13, FastEthernet0/1
                     [120/1] via 192.168.234.3, 00:00:22, FastEthernet0/1
C    192.168.234.0/24 is directly connected, FastEthernet0/1
R    192.168.5.0/24 [120/1] via 192.168.234.3, 00:00:22, FastEthernet0/1

-But for R3, it thinks the route learn from R2 is better because the AD of OSPF is better than RIP.

R3#show ip route

C    192.168.123.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
O       1.1.1.1 [110/11] via 192.168.123.1, 00:08:54, FastEthernet0/0
O E2 192.168.45.0/24 [110/20] via 192.168.123.2, 00:08:54, FastEthernet0/0
C    192.168.234.0/24 is directly connected, FastEthernet0/1
O E2 192.168.5.0/24 [110/20] via 192.168.123.2, 00:08:54, FastEthernet0/0

-So when the actual forwarding takes place, the path that the packets taking would be like this.

R5#ping 1.1.1.1 source loopback 0
.....
Success rate is 0 percent (0/5)

Forward path R5>R4>R3>R1>
Return path R1>R2>R3>R2>R3>R2.......

Then the packets will be looping between R2 and R3 till the ttl expired and never be able to get back the source router.




No comments:

Post a Comment