Change the default route in Solaris

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: Solaris networking  


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: 192.168.1.1. 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 192.168.254.1, then the command would be:

route delete default 192.168.254.1

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

route add default 192.168.1.1

 

7 Comments -


  1. Anonymous said on November 24, 2008

    Can I add more then one default router in solaris

  2. Adrien HEBRARD said on November 26, 2008

    Faster on Solaris 10:

    route change default 192.168.1.1

    This should be run for permanent modification:

    route -p change default 192.168.1.1

  3. Mike Bell said on December 21, 2008

    Thanks Adrien, your help is appreciated

  4. Rusman said on May 26, 2009

    Thanks for the tip!

  5. DT said on June 4, 2009

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

  6. ZaieN said on February 8, 2010

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

  7. David M said on May 29, 2010

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

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -