Alpine Linux default gateway on different subnet

As Alpine Linux uses busybox for a lot of its system tools it won’t set up the necessary routing if you have a default gateway on a non-local subnet to the IP. You want /etc/network/interfaces to look something like this:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address IP.ADDR.ADDR.ADDR
netmask 255.255.255.255   # or whatever is netmask
up route add DEFAULT.GW.IP dev eth0
up route add default gw DEFAULT.GW.IP

then run alpine-setup again

Leave a Reply

Your email address will not be published. Required fields are marked *