I have three interfaces on a Debian 9 box. I need to set the default route permanently for the entire system. I have attempted to add it in different ways to the /etc/network/interfaces file, but cant seem to find the right option. I have put the down route on the interfaces section as well as at the bottom of the file, but none seem to work for me. What is the correct syntax? all routes should go out the ens256 and all local routes should go out the other interfaces.
# The primary network interface
allow-hotplug ens192
iface ens192 inet static
address 10.21.30.10
netmask 255.255.255.0
gateway 10.21.30.254
down route del default gw 10.21.30.254
allow-hotplug ens224
iface ens224 inet static
address 10.21.10.10
netmask 255.255.255.0
gateway 10.21.10.254
down route del default gw 10.21.10.254
allow-hotplug ens256
iface ens256 inet static
address 1.2.3.157
netmask 255.255.255.248
gateway 1.2.3.153
dns-nameservers 4.2.2.2 8.8.8.8
up route add default gw 1.2.3.153
If I put the post config at the end of the file. "post-up /bin/ip route add default via 1.2.3.153 dev ens256" This works and I am able to ping go out to the internet, but cant seem to run apt-get. When I run this I get the following error.
Ign:1 http://security.debian.org/debian-security stretch/updates InRelease
Err:2 http://security.debian.org/debian-security stretch/updates Release
Connection failed [IP: 199.232.32.204 80]
Ign:3 http://ftp.us.debian.org/debian stretch InRelease
Ign:4 http://ftp.us.debian.org/debian stretch-updates InRelease
Err:5 http://ftp.us.debian.org/debian stretch Release
Connection failed [IP: 208.80.154.15 80]
Err:6 http://ftp.us.debian.org/debian stretch-updates Release
Connection failed [IP: 64.50.233.100 80]
Reading package lists... Done
E: The repository 'http://security.debian.org/debian-security stretch/updates Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ftp.us.debian.org/debian stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ftp.us.debian.org/debian stretch-updates Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.