Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

Your Answer


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.