route table explanation

I'm a newbie. Recently I used the command ip route ls to print my route table. Here is the content:

111.211.3.192/26 dev wlan0 proto kernel scope link src 111.211.3.205 metric 2

I'm curious about the meaning of proto kernel and scope link.


Solution 1:

I'm partially quoting the man page.

scope type is the scope of the destinations covered by the route prefix. scope link means that within the network segment of the device communication is allowed through this link. Towards other network segments routing should be used.

protocol type is the routing protocol identifier of this route. proto kernel means:

The route was installed by the kernel during autoconfiguration.

For more information, see:

  • The man page that can be read by typing man ip in a terminal window.
  • Several topics on Serverfault. Especially this on scope.

Solution 2:

for proto kernel, it is a route added automatically when you assign an address to an interface which is not /32. Lets say in your case, you assigned an address 111.211.3.193/26 to wlan0 (or some other in same subnet), kernel automatically adds route to whole subnet via this interface during auto-configuration. The only way to avoid this is assigning a /32 address to the interface.