03-26-2015 02:03 AM - edited 03-05-2019 01:05 AM
If i have 5 interfaces on a router..
When a packet is coming through gig 0/0 and going out through another interface..
which IP address of which interface will be used as source address?
Interfaces available are:-
Gig 0/0
Gig 0/1
Loopback
etc etc
Sorry if this was very basic question..
03-26-2015 03:11 AM
Hi
That is a very basic question ;-)
So ask yourself: As a packet travels the network between your PC, and (for example) google.com, what is the source and destination IP address in the packet after each hop?
When it leaves your PC, the source address is your PC. The destination IP is google's.
When it reaches google, the source address is your PC (or your internet NAT router, more likely) and the destination IP is google's.
In other words, it doesn't change as it traverses a router.
The IPs stay the same, unless something performs NAT on the packet.
Only the L2 MAC address changes at each hop typically (plus TTL etc, but that's beside the point).
So in relation to 'source-address' - typically when you configure a source-address, it's for something the router itself communicates with. E.g. tftp, ftp, ntp - you configure the interface used for traffic originating FROM the router itself, NOT for traffic passing through the router.
Aaron
03-26-2015 09:24 AM
I ask this because I faced a scenario were there was two interfaces on a router
one was a fastethernet the other was loopback..
this was a voice gateway.. And I did not give media binding command..
for some reason router decided to use loopback's IP address as source instead of fast Ethernet ...
do you know why?
03-27-2015 04:02 AM
Usually a router will use the 'closest' IP to the destination.
Processes may bind themselves to a particular NIC, and if that NIC resets for whatever reason may rebind to another. I guess it bound to the loopback as the loopback was up when whatever process (MGCP, or whatever) started up .
It's best practice to bind it to what you want it to be.
Regards
Aaron
Please remember to rate useful responses, and mark questions 'answered' when appropriate to highlight useful content.
03-28-2015 01:11 AM
Do you have any Cisco document that talks about this?
that router will pick closes interface..
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide