Change the default route in Solaris

Step 1: edit /etc/defaultrouter

Using the editor of your choice, edit the file /etc/defaultrouter — the only line in the file should be the default route of the system, for example: This change will not take effect until the system is rebooted.

Step 2: Delete the current default route

To make the route change take effect immediately, you must first delete the default route. If the current default route is, then the command would be:

route delete default

Step 3: Assign the current default route

To implement the new default route without rebooting the system, use the following command substituting your default route for

route add default


About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.

7 Responses to “Change the default route in Solaris”

  1. November 24, 2008 at 12:39 am, Anonymous said:

    Can I add more then one default router in solaris


  2. November 26, 2008 at 2:29 pm, Adrien HEBRARD said:

    Faster on Solaris 10:

    route change default

    This should be run for permanent modification:

    route -p change default


    • December 21, 2008 at 9:30 am, Mike Bell said:

      Thanks Adrien, your help is appreciated


  3. May 26, 2009 at 8:52 pm, Rusman said:

    Thanks for the tip!


  4. June 04, 2009 at 12:33 pm, DT said:

    If you want to make the route persistent, use this:
    route -p add default


  5. February 08, 2010 at 4:39 am, ZaieN said:

    Hi… When i issue command ‘netstat -rn’ why my default route always disappear when my server restarted?


    • May 29, 2010 at 1:28 am, David M said:

      Make sure your setting is in /etc/defaultrouter and /etc/hosts as the “router” entry


Leave a Reply