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 192.168.10.253 192.168.1.1

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

netstat -rn

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

route add -host 192.168.10.253 192.168.1.1 -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

/etc/rc2.d/S76static-routes

Then assign execution rights for the root username

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *