I run a Ubuntu server in VirtualBox with 3 network interfaces. How can I make sure the default gateway is always the on from eth0.
eth0 -> NAT, DHCP
eth1 -> bridged, DHCP
eth2 -> host only adapter, static ip
I know how to do it manually...
$ sudo route del default
$ sudo route add default gw 10.0.2.2
/etc/network/interfaces
auto lo
iface lo inet loopback
# The NAT network interface
auto eth0
iface eth0 inet dhcp
# The bridged network interface
auto eth1
iface eth1 inet dhcp
# The host-only network interface
auto eth2
iface eth2 inet static
address 192.168.56.2
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255
Thanks, Stefan
network
andbroadcast
in astatic
setup. That will be calculated by the OS. So adding them only makes it possible that you get it wrong, and then your net will not work.