Ubuntu Server: How to Set the Network Default Route CodeUnit 30 MAY 2011

To view your current network default route on your Ubuntu server box (or Ubuntu desktop for that matter), simply type in:

ip route

This will spit out a whole lot of important information regarding your current network connection on the box, the most important for you in this case being the last part that reads default via xxx. If xxx is not a valid gateway that you want to use, e.g. your router IP address, then you can add a default route with the following command:

sudo ip route add default via

where is the IP address of your router. Alternatively, you can also use this command to achieve the same effect:

sudo route add default gw


About Craig Lotter

Software developer, husband and dad to two little girls. Writer behind An Exploring South African. I don't have time for myself any more.