Set the Default Route on Solaris

Setting the default route on Solaris is easy. If you are trying to just set the route temporarily you can use the route command:

route add default <ipaddress>


route add default

If you want the route to be persisted when you reboot the system, you will need to set the route in the /etc/defaultrouter file.



echo > /etc/defaultrouter

Note that Solaris 10 includes “zones” that can also configure this same behavior. There will be more articles covering this in the future.

Lowell Heddings is the founder and Editor-in-Chief of How-To Geek. He spends all his free time making sure this site can bring you fresh geekery on a daily basis, and has been doing so for over eleven years.