Subscribe Subscribe | Subscribe Comments RSS
Subscribe in Bloglines

Add to netvibes
Add to Google Reader or Homepage

The Default Gateway or the Default Router is the IP address (IPv4) to which all the traffic to any target destination(s) which does not have a route in the Routing Table of the server will be forwarded.

This Default Gateway is maintained in the file

/etc/defaultrouter [IPv4 only]

This IP Address should be in the same network or the subnet as that of the server itself.

If you wish to add or edit the Default Gateway or the Default Router in Sun Solaris, edit /etc/defaultrouter file and update the IP Address. One entry per line for one or more default gateways (very unlikely to have muktiple default gateways).

This file is read at the boot time and hence the server needs to be rebooted for the changes to take effect.

Instead of rebooting the server, update the Kernel IP Routing table first by deleting the existing Default Gateway or Default Router (if any) and then adding the new IP address.

To view the existing Kernel IP Routing table,

# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref     Use     Interface
——————– ——————– —– —– ———- ———
192.168.1.0          192.168.1.10         U         1        195 hme0
224.0.0.0            192.168.1.10          U          1          0 hme0
default              192.168.1.1             UG        1        325
127.0.0.1            127.0.0.1               UH        5         92 lo0

Now, remove the dexisting default gateway;

# route delete default 172.1.1.1

Add the new Default Gateway using:

# route add default 192.168.1.1

This should help. For a detailed Man Page for /etc/defaultrouter click here.

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

9 Comments so far »

  1. by rac, on January 28 2008 @ 8:18 pm

     

    nice one
    thanks so much

  2. by Catherine, on February 19 2008 @ 2:09 pm

     

    Thanks. That was a lifesaver.

  3. by ali almakldy, on May 10 2008 @ 11:45 pm

     

    Thnk you in advance. it was really usefull.

  4. by Brian, on April 3 2009 @ 12:14 pm

     

    thanks for the quick help!

  5. by Mushtaq, on August 5 2009 @ 2:11 am

     

    Thanks, its really helpfull..

  6. by george, on November 29 2009 @ 8:41 pm

     

    you are a wonderful, wonderful man

  7. by Justin, on April 29 2010 @ 1:21 pm

     

    Make sure and do this from a local console and not a remote console as it will terminate your networked session.

  8. by Lolo, on May 25 2011 @ 3:13 pm

     

    Hi I have a problem with a machine with Sun Solaris 8. I have 3 computers connected to the same router, with default gateway 192.168.1.254 but the machine with Solaris 8 has 192.9.200.2 as default gateway. How can I change this??….I cant even ping a printer connected to my UNIX machine.

    THX in advance,

    Lolo

  9. by Lolo, on May 25 2011 @ 3:27 pm

     

    Hi I have a problem with a machine with Sun Solaris 8. I have 3 computers connected to the same router, with default gateway 192.168.1.254 but the machine with Solaris 8 has 192.9.200.2 as default gateway. How can I change this??….I cant even ping a printer connected to my UNIX machine.

    THX in advance for your comments,

    Lolo

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: