Mar 192008
 

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.

  8 Responses to “How to change Default Gateway/Default Router in Sun Solaris”

  1. thanku this was useful infromation to me.

  2. what is jumpstart inatalation

  3. It helped me a lot

  4. This is helpful.
    Other way is to:
    insert entry into /etc/defaultrouter and execute:
    # svcadm restart physical

  5. best for new to unix

  6. edit this files and reboot

    1. /etc/hosts
    2. /etc/netmask
    3. /etc/defaultrouter
    4.-validate after reboot—–> /etc/inet/ipnodes

    Have a nice day 🙂

  7. THANKS!! Very Helpful..

  8. thanks.. it help a lot…

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)