L3 Loops using RIP (ping source command)

Hi Networklessions ,

I was trying to form a Layer3 loop , basically i was verifying that how the TTL decrements incase of a loop and finally how the packet will be dropped .

My topology is like below:

L0,1.1.1.1 R1 2.2.2.1-------------2.2.2.2 R2 L0,3.3.3.3

In both RIP version 2 is configured .
In R1 , i added default route next hop pointing R2 , then in RIP i am originating default informations (using command “#default-information originate”) , Finally both routing tables are like below ::

R1#show ip route
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback1
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Serial0/0
     3.0.0.0/24 is subnetted, 1 subnets
R       3.3.3.0 [120/1] via 2.2.2.2, 00:00:05, Serial0/0
S*   0.0.0.0/0 [1/0] via 2.2.2.2

R2:

R2#show ip route  
   1.0.0.0/24 is subnetted, 1 subnets
R       1.1.1.0 [120/1] via 2.2.2.1, 00:00:14, Serial0/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Serial0/0
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback1
R*   0.0.0.0/0 [120/1] via 2.2.2.1, 00:00:14, Serial0/0

Ping:

R1#ping 8.8.8.8 source loopback 1

My questions is related to ping , when I am initiating a ping to any unknown network using source interface l0 from R1, then only I am seeing ICMP packets are looping and finally dropped with TTL ==0 .

But why there is no loop happening while i used “ping 8.8.8.8” , without source command . Just curious to know

Regards,
Sameer.

Hello Sameer.

That is indeed interesting. If you don’t specify the source IP, then the interface which is in the same subnet as the destination will be used as the source.
If the destination is not in the same subnet, then it will use the interface that is directly connected to the next hop, which, if you’re initiating the ping from R1, in this case is the 2.2.2.1 interface. The behaviour of RIP should still be the same…

Can you post some of your results so we can take a closer look?

Thanks!

Laz

1 Like

Hi Laz ,
Agreed , Source ip of captured packets are indeed 2.2.2.1 . I think any dynamic protols can be used but the issue is why IP packets are not looping without “source” command .

With source command packets are looped as expected, because we have provided next-hops in a manner that it will redirect towards other routers. Without source also it should loop
as we are expecting .

R1#show ip route
Codes: 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

Gateway of last resort is 2.2.2.2 to network 0.0.0.0

     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Serial0/0
R    3.0.0.0/8 [120/1] via 2.2.2.2, 00:00:01, Serial0/0
S*   0.0.0.0/0 [1/0] via 2.2.2.2

Ping:

R1#ping 8.8.8.8

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

Ping:

 R1#ping 8.8.8.8 source loopback 0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1
.....
Success rate is 0 percent (0/5)

R2:

R2#show ip route
Codes: 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

Gateway of last resort is 2.2.2.1 to network 0.0.0.0

R    1.0.0.0/8 [120/1] via 2.2.2.1, 00:00:24, Serial0/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Serial0/0
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Loopback0
R*   0.0.0.0/0 [120/1] via 2.2.2.1, 00:00:24, Serial0/0

please find the packet captures attached:

.ICMP_Echo_Req_Looping_Without_Source_Command.pcapng (4.5 KB)
ICMP_Echo_Req_Looping_With_Source_Command.pcapng (184.3 KB)

Regards,
Sameer

Hello Sameer,

What happens here is that R2 sends an ICMP redirect to R1. You can see it in your capture file (without source) in packet #8.

The packet gets redirected to 2.2.2.1 (R1) so it doesn’t loop around. You can disable ICMP redirects if you want:

R2(config)#int gi0/1
R2(config-if)#no ip redirects 

And your packet will loop around, even without specifying the source. ICMP redirection only works when the source is on the same subnet, which is why it doesn’t happen when you source it from the loopback.

You can read more about ICMP redirect here:

Hope this helps!

Rene

1 Like

Hi Rene ,
Thank you !! Great catch , i was stuck in this issue.
Regards
Sameer .