I have a following up question to an question I found answered on unix.stackexchange.com (see link below).
What is the difference between the following two routing table entries:
default E.F.G.H UGSc 0 0 en1 default E.F.G.H UGScI 25 0 en1
(Where E.F.G.H is some gateway IP address.) Specifically what effect does the RTF_IFSCOPE flag have on the routing table entry?
The accepted answer then is that the second route is "bound to a specific interface" and this can be used to "create multiple routes that point to the same destination, differentiated only by which interface is in play"
OK, but what does that mean? Let's say I have the following (as I really do, only changed the IPs):
default 192.168.1.1 UGSc 14 0 en2 default 192.168.0.1 UGScI 1 0 en0
Under what circumstances will the second route be used? Or more generally when will the "
I" route be used? The "real" default route seems to be the one without the "
$ route get 184.108.40.206 route to: google-public-dns-a.google.com destination: default mask: default gateway: 192.168.1.1 interface: en2 flags: <UP,GATEWAY,DONE,STATIC,PRCLONING> recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 1500 0
Btw: I know about the following from
I RTF_IFSCOPE Route is associated with an interface scope
But I do not understand it :(
Any hints are much appreciated!