Answer the question
In order to leave comments, you need to log in
How to set static routes on Debian 9.6 so they don't get reset after reboot?
There is Debian 9.6 and configured in it /etc/network/interfaces
:
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens192
auto ens192
iface ens192 inet static
address 192.168.72.152
netmask 255.255.255.0
gateway 192.168.72.1
post-up route add -net 192.168.24.0 netmask 255.255.254.0 gw 192.168.72.101
pre-down route del -net 192.168.24.0 netmask 255.255.254.0 gw 192.168.72.101
Answer the question
In order to leave comments, you need to log in
post-up route add -net 192.168.24.0 netmask 255.255.254.0 gw 192.168.72.101
pre-down route del -net 192.168.24.0 netmask 255.255.254.0 gw 192.168.72.101
post-up /sbin/ip r add 192.168.24.0/23 via 192.168.72.101
pre-down /sbin/ip r del 192.168.24.0/23 via 192.168.72.101
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question