1

I have found SO question about What does 0.0.0.0 gateway mean in routing table? but this is not exactly what I want to know. I have noticed that in some outputs (e.g. here) of Linux route -n command there are * under Gateway column while in other outputs (e.g. here) there are 0.0.0.0 under Gateway column. From those outputs I can conclude that: * are shown when Iface is physical interface while 0.0.0.0 are shown when Iface is IP address. Can you confirm this?

Can you please also clarify when to use physical interface as Iface and when to use IP address? I suppose physical interface can be only used on links that have two-ends i believe those are known as point-to-point links (in other words it is not suitable e.g. when you have multiple possible hosts on the other site e.g. when you are connected to switch) am I right?

1 Answers1

0

It's the same thing.

Your second example is with the -n option, asking route -n to show IP addresses directly, while the first one lets it translate addresses to names – note how it also shows default in place of 0.0.0.0 for the destination, and so on.

In both cases, it means that there isn't a gateway – the route destination is on-link and the OS will try to reach these hosts directly.

Such routes work just fine on Ethernet/WiFi, too – the sender will use ARP or ND to learn the destination's MAC address. In fact, that's how you and your gateway reach each other! See also https://superuser.com/a/763375/1686.


Generally, on Linux, avoid route & ifconfig and use modern tools like ip route instead.

grawity
  • 501,077