What does "On-link" mean on the result of "route print" command?

67

9

I'm using Windows 7. When I type "route print" under command prompt, I get a IPv4 Route Table with several "On-link" values under the Gateway column. For example, like this one:

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.1      192.168.1.5     25
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      137.132.0.0      255.255.0.0     172.18.180.1    172.18.180.10     31
    137.132.80.16  255.255.255.255      192.168.1.1      192.168.1.5     26
      169.254.0.0      255.255.0.0         On-link     172.18.180.10    306
  169.254.255.255  255.255.255.255         On-link     172.18.180.10    286
       172.18.0.0      255.254.0.0     172.18.180.1    172.18.180.10     31
     172.18.180.0    255.255.255.0         On-link     172.18.180.10    286
    172.18.180.10  255.255.255.255         On-link     172.18.180.10    286
   172.18.180.255  255.255.255.255         On-link     172.18.180.10    286
      172.25.64.0    255.255.240.0     172.18.180.1    172.18.180.10     31
      192.168.1.0    255.255.255.0         On-link       192.168.1.5    281
      192.168.1.5  255.255.255.255         On-link       192.168.1.5    281
    192.168.1.255  255.255.255.255         On-link       192.168.1.5    281
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link     172.18.180.10    286
        224.0.0.0        240.0.0.0         On-link       192.168.1.5    281
      255.254.0.0      255.254.0.0     172.18.180.1    172.18.180.10     31
      255.255.0.0      255.255.0.0     172.18.180.1    172.18.180.10     31
    255.255.240.0    255.255.240.0     172.18.180.1    172.18.180.10     31
    255.255.254.0    255.255.254.0     172.18.180.1    172.18.180.10     31
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link     172.18.180.10    286
  255.255.255.255  255.255.255.255         On-link       192.168.1.5    281
  255.255.255.255  255.255.255.255      192.168.1.1      192.168.1.5     26
===========================================================================

So what does "On-link" mean?

hujunfeng

Posted 2009-10-24T17:10:12.337

Reputation: 805

@user318934 - nDNSResponder is installed by Microsoft, because so many things use Bonjour and Apple's implementation is smaller/faster/better than they cared to re-write. Delete it? Disable it? leave it alone? Your choice, but it is generally not an issue. – Jesse Chisholm – 2015-03-25T18:09:46.133

@hujunfeng, Wow why do you have such a huge table? – Pacerier – 2017-06-17T04:22:55.777

You may want to check if you have the following installed. C:\Program Files\Bonjour it will contain mDNSResponder and a associated dll I deleted the folder and the problem went away. Bonjour is a Apple Service, but no Apple software was install, so not sure how it got installed. It seems the mDNSResponder is what is causing the problem. – None – 2014-04-28T12:49:56.947

Answers

56

They are addresses that can be resolved locally. They don't need a gateway because they don't need to be routed.

MDMarra

Posted 2009-10-24T17:10:12.337

Reputation: 19 580

4Why are the metrics so high if the addresses are directly accessible? Is it something to do with all the local masks getting sorted out? – Erik Reppen – 2016-07-21T17:49:41.987

24

Yep, the other three answers are correct: it's just a route that's directly reachable (the NIC is in direct contact with it; on the same subnet). To explain a little further though: by contrast, the routes that have a gateway IP listed must be contacted through that gateway.

So, in the table you gave above, 192.168.1.255 is contacted by simply putting a packet on the network from 192.168.1.5, marked as going to 192.168.1.255. The destination machine would see the packet, and take it off the network directly.

But to reach 137.132.0.0, the packet would be sent out from 172.18.180.10, to the gateway 172.18.180.1, where the gateway would see that it's to be forwarded on to where it's going.

Note that I haven't bothered looking at the whole routing table to make sure there are no more specific routes overriding these, as it's a little beside the point for this issue.

Lee B

Posted 2009-10-24T17:10:12.337

Reputation: 1 127

In the second last para, what does gateway mean anyway? Does gateway means router? – Pacerier – 2017-06-17T04:29:29.320

4

on-link is a vista thing and it means there is a direct connection meaning “directly reachable”. In general, such record will be generated after establishing a dial-up connection.

harrymc

Posted 2009-10-24T17:10:12.337

Reputation: 306 093

1So before vista it is? – Pacerier – 2017-06-17T04:30:16.320

2

Wild guess: Unrouted subnets that are handled locally.

Joey

Posted 2009-10-24T17:10:12.337

Reputation: 36 381