I have a PC which has 192.168.1.1/24 configured to eth0 interface. Now if I try to add routes via 10.10.10.254, the ip utility reports that No such process:root@PC:~# ip neigh add 10.10.10.254 lladdr 00:01:02:03:04:05 dev eth0root@PC:~# ip route add default via 10.10.10.254 dev eth0RTNETLINK answers: No such processroot@PC:~# ip route add 172.16.0.1/32 via 10.10.10.254 dev eth0RTNETLINK answers: No such processroot@PC:~# As long as PC knows the MAC address of 10.10.10.254 it is technically possible to send data via 10.10.10.254 while 10/8 network is not configured to any interface in PC. Based on my example it would use PCs eth0 MAC address as a source MAC, 00:01:02:03:04:05 as a destination MAC, 192.168.1.1 as a source IP address and destination address would be whatever I specify.Is it possible to force Linux to add a route if sub-net, where gateway is situated, is not in configured to an interface?
add route in Linux if sub-net, where gateway is situated, is not configured
ip;routing;iproute
Try this:ip route add 172.16.0.1/32 via 10.10.10.254 dev eth0 onlink