Ping Question

dppagcdppagc Senior MemberMember Posts: 293
I know this question may sound a little stupid.
Q1 When I do a ping, how do I know what is the default source interface and default source ip address?

I realized that when I am studying bgp and you have to change the source ip to the loopback to make it pingable.
e.g. ping 10.1.1.1 source lo0



Q2. When I ping, can I use a source ip address that doesnt originate from the router itself?
Can I magically conjure up an ip address from somewhere else?
What will happen?

Comments

  • verbhertzverbhertz Member Member Posts: 54 ■■□□□□□□□□
    The default source ip is the address of the interface that the packet exits.

    If you made up a random ip, how would it ever return to the correct device? I haven't tested it, just a thought.
  • dppagcdppagc Senior Member Member Posts: 293
    Hi,

    what I mean is that is there a show command or something like that?
  • networker050184networker050184 Went to the dark side.... Mod Posts: 11,962 Mod
    Use the show commands to find the exit interface and then you know the source. You can manually set the source, but IOS will not allow you set one that is not local to the router.
    An expert is a man who has made all the mistakes which can be made.
  • dppagcdppagc Senior Member Member Posts: 293
    Hi, can you elaborate on "Use the show commands to find the exit interface"
    Do you mean doing traceoute then using sh ip int br?
  • phantasmphantasm Senior Member Member Posts: 995
    Traceroute isn't a show command.

    You could look at 'sh ip int br' and 'sh cdp neigh' to see which interface connects to the upstream device. When performing a ping test from a Router or Multi-layer Switch I prefer to set my source to the source interface for the network I am trouble shooting for. This provides better results.
    "No man ever steps in the same river twice, for it's not the same river and he's not the same man." -Heraclitus
  • networker050184networker050184 Went to the dark side.... Mod Posts: 11,962 Mod
    dppagc wrote: »
    Hi, can you elaborate on "Use the show commands to find the exit interface"
    Do you mean doing traceoute then using sh ip int br?

    What show command do you use when you want to find the way a packet routes?
    An expert is a man who has made all the mistakes which can be made.
  • verbhertzverbhertz Member Member Posts: 54 ■■□□□□□□□□
    I would check the route table. Show up route.
Sign In or Register to comment.