Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

Bronze

source ip address in ping packets

HI everybody

Please consider the following:

R1 can reach 10.0.0.0 via R2 and R3.

R1--s0/0--200.200.200.0/24-s0/0------R2---10.0.0.0

R1--- s0/1-----199.199.199.0/24 s0/1------R3--10.0.0.0

R1 :

R1#show ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

Serial0/0                  200.200.200.1   YES manual up                    up

Serial0/1                  199.199.199.1   YES manual up                    up

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 not set

C    200.200.200.0/24 is directly connected, Serial0/0

C    199.199.199.0/24 is directly connected, Serial0/1

R    10.0.0.0/8 [120/1] via 200.200.200.2, 00:00:16, Serial0/0

                [120/1] via 199.199.199.3, 00:00:11, Serial0/1

===================================================================

My question when I issue the command ping 10.10.10.2 on R1, what ip address R1 will use for source address?

When I performed the above lab, I found R1 was using 200.200.200.1, which is configured on R1's s0/0 as source ip address in ping pack

Below is the debug output:

R1#ping 10.10.10.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/140/316 ms

R1#

*Mar  1 01:09:15.611: IP: tableid=0, s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), routed via FIB

*Mar  1 01:09:15.611: IP: s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), len 100, sending

*Mar  1 01:09:15.923: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), routed via RIB

*Mar  1 01:09:15.927: IP: s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), len 100, rcvd 3

*Mar  1 01:09:15.927: IP: tableid=0, s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), routed via FIB

*Mar  1 01:09:15.931: IP: s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), len 100, sending

*Mar  1 01:09:16.039: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), routed via RIB

*Mar  1 01:09:16.039: IP: s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), len 100, rcvd 3

*Mar  1 01:09:16.043: IP: tableid=0, s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), routed via FIB

*Mar  1 01:09:16.047: IP: s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), len 10

R1#0, sending

*Mar  1 01:09:16.287: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), routed via RIB

*Mar  1 01:09:16.291: IP: s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), len 100, rcvd 3

*Mar  1 01:09:16.291: IP: tableid=0, s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), routed via FIB

*Mar  1 01:09:16.295: IP: s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), len 100, sending

*Mar  1 01:09:16.299: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), routed via RIB

*Mar  1 01:09:16.303: IP: s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), len 100, rcvd 3

*Mar  1 01:09:16.307: IP: tableid=0, s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), routed via FIB

*Mar  1 01:09:16.307: IP: s=200.200.200.1 (local), d=10.10.10.2 (Serial0/0), len 100, sending

*Mar  1 01:09:16.311: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=200.200.200.1 (Serial0/0), routed via RIB

*Mar  1 01:09:16.311: IP: s=10.10.10.2 (Serial0/0), d=200.200.200.1 (

After few minutes, I issued the ping 10.10.10.2 again and this time R1 was using s0/1 ip address 199.199.199.1

Below is the output.

R1#debug ip packet

IP packet debugging is on

R1#ping 10.10.10.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 10.10.10.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/105/332 ms

R1#

*Mar  1 01:23:42.671: IP: tableid=0, s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), routed via FIB

*Mar  1 01:23:42.671: IP: s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), len 100, sending

*Mar  1 01:23:42.775: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=199.199.199.1 (Serial0/1), routed via RIB

*Mar  1 01:23:42.775: IP: s=10.10.10.2 (Serial0/0), d=199.199.199.1, len 100, rcvd 4

*Mar  1 01:23:42.779: IP: tableid=0, s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), routed via FIB

*Mar  1 01:23:42.783: IP: s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), len 100, sending

*Mar  1 01:23:42.807: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=199.199.199.1 (Serial0/1), routed via RIB

*Mar  1 01:23:42.811: IP: s=10.10.10.2 (Serial0/0), d=199.199.199.1, len 100, rcvd 4

*Mar  1 01:23:42.815: IP: tableid=0, s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), routed via FIB

*Mar  1 01:23:42.815: IP: s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), len 100, sending

*Mar  1 01:2

R1#3:43.143: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=199.199.199.1 (Serial0/1), routed via RIB

*Mar  1 01:23:43.147: IP: s=10.10.10.2 (Serial0/0), d=199.199.199.1, len 100, rcvd 4

*Mar  1 01:23:43.151: IP: tableid=0, s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), routed via FIB

*Mar  1 01:23:43.151: IP: s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), len 100, sending

*Mar  1 01:23:43.195: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=199.199.199.1 (Serial0/1), routed via RIB

*Mar  1 01:23:43.195: IP: s=10.10.10.2 (Serial0/0), d=199.199.199.1, len 100, rcvd 4

*Mar  1 01:23:43.199: IP: tableid=0, s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), routed via FIB

*Mar  1 01:23:43.199: IP: s=199.199.199.1 (local), d=10.10.10.2 (Serial0/1), len 100, sending

*Mar  1 01:23:43.207: IP: tableid=0, s=10.10.10.2 (Serial0/0), d=199.199.199.1 (Serial0/1), routed via RIB

*Mar  1 01:23:43.207: IP: s=10.10.10.2 (Serial0/0), d=199.199.199.1, len 100, rcvd 4

R1#undebug all

Could  anyone please explain what is going on ?

Thanks and have a great day.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: source ip address in ping packets

R    10.0.0.0/8 [120/1] via 200.200.200.2, 00:00:16, Serial0/0

                [120/1] via 199.199.199.3, 00:00:11, Serial0/1

R1 is load blanacing between R2 and R3, since they are both equal hops away.

I believe it will load balance up to 4 paths by default.

Remember the metric with RIP is hop count.

Cisco Employee

source ip address in ping packets

Just to add to John's post, for the source IP it could use either of the IP address of the any available interface on the router. Yes the router is doing load-balancing in this case as it has 2 routes to reach to the same destination.

For example, if you have a loopback IP configured on the router, it could use that as a source of the ICMP packets.

Bydefault, the routers does per-destination load-balancing and for the same source it will use the same interface/route as far as it has the ARP entry maintained for that destination. If the entry clear out, it would try to use another interface. This is what happened in your case when you tried to ping the same destination after a few minutes. If you would have tried to ping some other destination IP, you might have seen the router taking a different path/interface.

Hope this helps.

-amit singh

3 REPLIES

Re: source ip address in ping packets

R    10.0.0.0/8 [120/1] via 200.200.200.2, 00:00:16, Serial0/0

                [120/1] via 199.199.199.3, 00:00:11, Serial0/1

R1 is load blanacing between R2 and R3, since they are both equal hops away.

I believe it will load balance up to 4 paths by default.

Remember the metric with RIP is hop count.

Cisco Employee

source ip address in ping packets

Just to add to John's post, for the source IP it could use either of the IP address of the any available interface on the router. Yes the router is doing load-balancing in this case as it has 2 routes to reach to the same destination.

For example, if you have a loopback IP configured on the router, it could use that as a source of the ICMP packets.

Bydefault, the routers does per-destination load-balancing and for the same source it will use the same interface/route as far as it has the ARP entry maintained for that destination. If the entry clear out, it would try to use another interface. This is what happened in your case when you tried to ping the same destination after a few minutes. If you would have tried to ping some other destination IP, you might have seen the router taking a different path/interface.

Hope this helps.

-amit singh

source ip address in ping packets

Hi sarah,

You can see what interfaces they will using to go the destinations.. The * indicates that the router will use that interface to go out.

R1#sh ip route 10.1.1.1

Routing entry for 10.1.1.1/32

  Known via "rip", distance 120, metric 1

  Redistributing via rip

  Last update from 200.200.200.2 on GigabitEthernet1/0, 00:00:00 ago

  Routing Descriptor Blocks:

    200.200.200.2, from 200.200.200.2, 00:00:00 ago, via GigabitEthernet1/0

      Route metric is 1, traffic share count is 1

* 199.199.199.2, from 199.199.199.2, 00:00:15 ago, via GigabitEthernet2/0

      Route metric is 1, traffic share count is 1

R1#sh ip route 3.3.3.3

Routing entry for 3.3.3.3/32

  Known via "rip", distance 120, metric 1

  Redistributing via rip

  Last update from 199.199.199.2 on GigabitEthernet2/0, 00:00:04 ago

  Routing Descriptor Blocks:

* 200.200.200.2, from 200.200.200.2, 00:00:04 ago, via GigabitEthernet1/0

      Route metric is 1, traffic share count is 1

    199.199.199.2, from 199.199.199.2, 00:00:04 ago, via GigabitEthernet2/0

      Route metric is 1, traffic share count is 1

you can also see that its load balancing by doing a traceroute.

R1#traceroute 10.1.1.1

Type escape sequence to abort.

Tracing the route to 10.1.1.1

  1 199.199.199.2 56 msec

    200.200.200.2 60 msec *

R1#traceroute 3.3.3.3

Type escape sequence to abort.

Tracing the route to 3.3.3.3

  1 200.200.200.2 80 msec

    199.199.199.2 76 msec *

HTH

Kishore

294
Views
0
Helpful
3
Replies
CreatePlease to create content