Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I need to add several static routes to a solaris 10 box. On Solaris 9, I've always made these persist across reboots by adding an init script to reapply the route. With solaris 10, adding a service to an SMF seems somewhat overkill. What is best practise on how to add a route that persists across reboot?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

The route command has the -p option, in OpenSolaris and I believe Solaris 10 as well. From man route:

 -p             Make changes to the network route tables per-
                sistent across system restarts. The operation
                is applied  to  the  network  routing  tables
                first  and, if successful, is then applied to
                the list  of  saved  routes  used  at  system
                startup.  In determining whether an operation
                was successful, a failure to add a route that
                already  exists  or to delete a route that is
                not in the routing table is ignored. Particu-
                lar  care  should be taken when using host or
                network  names  in  persistent   routes,   as
                network-based  name  resolution  services are
                not available at the time routes are added at
                startup.

I believe it writes them to the /etc/inet/static_routes file if they are applied successfully.

share|improve this answer
1  
Note that you can also use the old fashioned /etc/defaultrouter file. –  Martin Jul 20 '09 at 22:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.