Setting the default gateway in Solaris

Solaris isn’t always clear as to how to configure things. This is one of these times. Setting the default gateway in solaris requires modifying a file. The file you will need to modify is the “/etc/defaultrouter”. If this file does not exist it will need to be created:

vi /etc/defaultrouter

After this you will need to restart the network for the settings to take effect. You can verify the default gateway by using netstat:

netstat -nrv

This will display your routing table. Notice the gateway you set in /etc/defaultrouter is the default in the routing table. Solaris is very flexible when it comes to networking, as long as you keep in mind how to modify things.