What does the command "ip route" show

These are my outputs from the command ip route

10.1.40.0/24 via 10.255.115.1 dev eth1
10.255.114.0/23 dev eth1  proto kernel  scope link  src 10.255.115.18
default via 10.1.1.1 dev eth0  metric 100

Am I understanding correctly?

  1. packet goes to 10.1.40.0/24 will be sent to next hop router(10.255.115.1) via eth1 ?
  2. 10.255.114.0/23 will be sent via eth1 which ip is 10.255.115.18 , NOT via a router???
  3. others will be sent to next hop router(10.1.1.1) via eth0 ?

What does proto kernel scope link src mean?


Your assumption is accurate:

  • 10.255.114.0/23 is directly connected as it is in the same subnet as 10.255.115.18 (i.e. /23 is 10.255.114.0 to 10.255.115.255 ).
  • scope link means the packet is just dropped on the link and sent straight to interface as the destination is in the subnet will "hear" the packet so no gateway needed.

I made a small schema to make it easier to understand

enter image description here