0

This is the content of /etc/network/interfaces:

auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug ens18
iface ens18 inet static
        address 10.0.5.108
        netmask 255.255.252.0
        gateway 10.0.4.1
        post-up route add -net 10.0.12.0/24 gw 10.0.4.1
        pre-down route del -net 10.0.12.0/24 gw 10.0.4.1

Any idea what i am doing wrong? Using the command ip route add 10.0.12.0/24 via 10.0.4.1 works fine...

ip r gives this after a reboot:

root@server:~# ip r
default via 10.0.4.1 dev ens18 onlink 
10.0.4.0/22 dev ens18 proto kernel scope link src 10.0.5.108
10.64.0.1 dev tun0 proto static 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
peterge
  • 3
  • 3

1 Answers1

0

Please check that you have installed 'route' binary, looks like it doesn't installed. What's about which route?

Rabban Keyak
  • 116
  • 2
  • Holy shit, you are right. Its not installed, and using ```apt install net-tools``` and a reboot fixed everything... Not thought this could be a problem if the ip route add command works.... (Its a debian netinstall) – peterge May 26 '21 at 09:48
  • 2
    Don't use the `route` command. It's depreceated. Update your pre-up to `ip route add ...` – vidarlo May 26 '21 at 09:53
  • Use `ifup -v ` command to troubleshoot interface configuration issues. – Anton Danilov May 26 '21 at 10:34