Adding Static Route and Making it Permanent in Solaris

Added some static route because my machine was using another interface to communicate with the destination server. Adding the route was simple and if you have zones, you will need to add them on the physical server.

route add -host

for example, the command above is asking to reach the destination of  through the gateway To verify, you can do

netstat -rn

Or if you need to specify a particular interface as well you can add

route add -host -ifp bge2

After this you perform your test and once everything is tested, you would want to make this configuration permanently, so that you do not lose this setting after a reboot of the Solaris box.

First you need to add the above lines to


Then assign execution rights for the root username

chmod 777 /etc/rc2.d/S76static-routes


Leave a Reply