I can find virtually no documentation of the meaning of the column "Netif" in the output of
netstat -rn. Googled for it, searched through the netstat(1) and route(8) man pages and found the following sentence as the clearest bit of information on the meaning of the column:
The interface (Netif column) that this routing table specifies to use for localhost is lo0, also known as the loopback device. This says to keep all traffic for this destination internal, rather than sending it out over the LAN, since it will only end up back where it started.
Found this explanation here: https://www.dragonflybsd.org/~labthug/handbook/network-routing.html
I currently have a pending question on severfault here in which I've got a couple lines from my
netstat -rn output on a FreeBSD machine:
Destination Gateway Flags Netif Expire ... 220.127.116.11 link#1 UHS lo0 18.104.22.168/32 link#1 U vtnet0
My understanding, from the FreeBSD handbook on Gateways and Routes is that
The route indicates that when trying to get to the specified destination, send the packets through the specified gateway...There are also three types of gateways: individual hosts, interfaces, also called links, and Ethernet hardware (MAC) addresses.
link#1 refers to the interface
vtnet0, which is the first to show up when running
ifconfig. That being said, I would think I could read my first route as "When trying to reach 22.214.171.124, use interface vtnet0." But then what the heck does
lo0 mean in the "Netif" column? Also, related to the other question I've got pending right now, if both destinations are identical (the second seems to be an alias), it seems like it might prefer the first one since it comes first, but under what conditions would it skip it and go on to the second one?