Dear All,
I would like to ask where the decision is made about which interface will be the output interface where forwarding packets? I don't care about the simple examples, where there is only one interface in a network.
For example, there is a router with interfaces like this (the if_lan and the vrrp_lan2 is connect to the same network):
if_lan1
if_lan2
vrrp_lan2
The ip addresses doesn't matter in the case of question (it matters only when it is an ingress gw address).
So the situation is: a packet comming from lan1 and travels through the router into (or through) the lan2 network. So the router has to push it to the lan2 (or to the lan2 gw). How the router select the output interface (and in the end the source mac address)? It is select the vrrp mac for the source mac, but why and where is the selection point?
However locally generated packets traverse out from the box:
If I ping sg in the lan2 from the router, the output interface will be the if_lan2 interface and the mac its mac. This is clear, the "/ip route print" shows that the source ip address for the route into the lan2 will be use the if_lan2 ip address as the preferred source address, so it will be use that interface mac as source mac.
However it can be change if you specify the vrrp_lan2 ip as the source ip for the ping. I don't care about.
But again, when the packet forward where the decision is made to use the vrrp interface as output interface?
thank you