cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11646
Views
5
Helpful
8
Replies

default interface for ping

Mary
Level 1
Level 1

from router 1, i am ping switch 1. not successful, but if i use source lo1, i am able to ping,

when we use ping command, which default source interface from router 1 is used to ping other host?

8 Replies 8

Jon Marshall
Hall of Fame
Hall of Fame

The interface ping will use as the source interface is the one the routing table says is the interface used to reach the destination IP. 

 

Jon

then why adding souce lo1 succeed and without source command failed?

Don't know without seeing configurations etc. 

 

Jon

I would guess the switch does not have a route for the interface IP but it does for the loopback IP.

 

Jon

Destination device, or device(s) in between (?), might also have ACL that block pings from some IPs.

Hello

 


@Mary wrote:

then why adding souce lo1 succeed and without source command failed?


Because most probably the destination devcie you pinged had a valid route back your lo0.

If you do a trace route back from your destination to the each of the connected interfaces on the source device you may find out the reason reason why?


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Carlos Villagran
Cisco Employee
Cisco Employee
Hi,

his behaviour usually occurs when the destination device does not have a route back to the subnet where it was ping'd from.

So lets say you ping 10.1.1.1 from your source interface VLAN whic is 10.1.2.1.

1. The 10.1.1.1 host does not have a Default Gateway configured (the destination is in another subnet).
2. The 10.1.1.1 is not an end host but a router or a switch and it does not have a route to 10.1.2.0/x subnet.

Regards!

mdrakes
Level 1
Level 1

In Cisco routing, the default source interface is the IP of the connected interface used to exit the source device. Routing must work both ways; R1 must be able to reach SW1, and SW1 must be able to reach R1. Your ping from R1 to SW1 works when using lo0 because SW1 only knows how to reach the IP of R1's lo0, and not the IP of the connected interface used to exit R1.