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


Related Posts:

About Craig Lotter

South African software architect and developer at Touchwork. Husband to a cupcake baker and father to two little girls. I don't have time for myself any more.