Answer the question
In order to leave comments, you need to log in
How do I teach Debian to use my routes?
I have a car. It has routes:
[email protected]:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default gw.srv 0.0.0.0 UG 0 0 0 eth0
10.0.1.0 * 255.255.255.0 U 0 0 0 vlan567
10.100.0.0 * 255.255.0.0 U 0 0 0 vlan2567
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
route del default
route add default gw 10.100.0.1 dev vlan2567
route add -net 172.17.17.0 netmask 255.255.255.0 gw [адрес шлюза в 192.168.1.0/24] dev eth0
Answer the question
In order to leave comments, you need to log in
write commands for adding routes to /etc/network/interfaces after describing the desired interface like this:
allow-hotplug eth0
iface eth0 inet static
address 172.20.xx
netmask 255.255.255.0
up ip route add 172.20.70.0/24 via 172.20.71.y dev eth0
up ip route add ...
The key word here is up - i.e. commands will be executed when the interface is brought up.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question