Tue Mar 05, 2019 4:08 am
That is right. You can't create manual route with distance 0.
For your observed behavior, there is a simple explanation. Let me give you example, how the network works, when you try to ping for example 1.1.1.1
If you use default route with gateway IP, network works this way:
1) your router sends packet destined to IP 1.1.1.1 but MAC of your gateway (because it is already cached in ARP table)
2) gateway receives the packet and forwards it according to its own routes
3) packet gets forwarded until it reaches target
4) target replies
5) packet gets forwarded back, until it reaches your router
If you use default route without gateway (i.e. with interface, instead of gateway IP), the network behaves slightly differently:
1) Your router sends ARP request to find out, whether there is any device with IP 1.1.1.1 available via L2 (of course it is not)
2) since the ARP request is L2 broadcast, gateway will most likely answer it (if it has enabled proxy-arp or local-proxy-arp) however any other device on the same L2 segment can answer that!
3) your router sends packet destined to IP 1.1.1.1 but MAC of your gateway
4) gateway receives the packet and forwards it according to its own routes
5) packet gets forwarded until it reaches target
6) target replies
7) packet gets forwarded back, until it reaches your router
See the difference? If you don't specify gateway IP, there is extra ARP request and reply for every IP (unless it is already cached)
Even though you can see this approach (use interface instead of IP as a gateway for default route) advised sometime around here, I consider it as a misconfiguration which has both security and performance consequences.
It also may not work with every ISP - If your ISP does not reply to these ARP requests, connection will not work at all.