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

1 Answer 1

0

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

3
  • 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, 2021 at 9:48
  • 2
    Don't use the route command. It's depreceated. Update your pre-up to ip route add ...
    – vidarlo
    May 26, 2021 at 9:53
  • Use ifup -v <iface> command to troubleshoot interface configuration issues. May 26, 2021 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .