I am on a ubuntu 12.04 vm
I read https://help.ubuntu.com/12.04/serverguide/network-configuration.html
which says I can set the gateway with a command like:
sudo route add default gw 10.0.2.211 eth0
which works, but clears after a reboot.
I also tried to set the gateway by editing my /etc/network/interface
file:
auto eth0
iface eth0 inet dhcp
gateway 10.0.2.211
pre-up sleep 2
I just added the gateway line.
That doesn't seem to work at all though.
I tried rebooting and running:
sudo /etc/init.d/networking restart