I have a Debian Jessie box with 2 interfaces. I want eth1 to route public traffic on public static IP 1.2.3.4, and eth0 to route mgmt traffic on 192.168.0.55, so I edited /etc/network/interfaces to look like:
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth1
iface eth1 inet static
address 1.2.3.4
netmask 255.255.255.0
gateway 1.2.3.1
dns-nameservers 8.8.8.8
post-up route del default gw 192.168.0.1 eth0
post-up route add default gw 1.2.3.1 eth1
# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.55
netmask 255.255.255.0
gateway 192.168.0.1
but when I reboot I have to manually delete the 192.168.0.1 eth0 gateway and add the 1.2.3.1 eth1 one. Why isn't this persisting across a reboot? Is there some other place where the default route/gw is set?