- Pricing &
Second Gateway on Ubuntu
Written by: Will Kruss on 02 March 2017 02:36 PM
If you have a DHCP based second NIC on Ubuntu, it will have two gateways. You may find when you reboot the server sometimes it takes the incorrect gateway and makes it default meaning that your system has no internet access.
You can find out what the default route is by typing:
ip r s
To make your system delete any incorrect route and add a specific default route you need to edit your interfaces file at
Add the following to the bottom of the file
Of course you need to specify the correct gateway for your IP address (which is also listed earlier in the file) and ensure you specify the correct NIC (e.g. eth0).
To test you will need to reboot the server as restarting networking may not work properly.