Default route ( netstat -nrv ) is removed/missing after platform patch

After running a script for Platform Patch, the default route is removed from netstat -nrv.

The machine does not reboot after Platform Patch.

The script does not have any command to remove default route as shown below...
route del default gw <IP>

I am wondering, how is the defaut route is getting removed. Is the script using some other command. But I could not find anything ...what should Is search for:confused:

There are a number of ways for Solaris to be configured for a default router but by far the most common is (by creating) the file:

 
/etc/defaultrouter

This file contains just the ip address of the defaultrouter (and nothing else) eg. file contents

 
10.146.3.126

(If you reboot the system then Solaris will set that as the default route. Note also though that this will stop other config methods eg. inetd from starting.)

It is possible that patching has somehow removed /etc/defaultrouter. It is not unheard of for patching to blow out the default route. All you can do is put it back.

You should also check that /etc/resolv.conf contains details of the DNS server(s).

Actually I'm really confused by what you are seeing. I am guessing that the process ran some compiled code or a shell script and the default gateway was was cleared.

The gateway itself can be updated by the sysadmin and as you say:

route delete .. .. ..
# or
route add .. .. ..
# or
/etc/defaultrouter (file added or changed)

If you are sure the script "did it"

grep route [shell script name]

and also look for invocations of other scripts. If there is an executable file called, try

strings [executable filename] | grep route

It's not unheard of to blow out the default router and other network items during patching......................

Can't ping default router in Solaris 10

Default route is added manually. After reboot again it disappears.......

So you create a /etc/defaultrouter file and after a reboot it is gone?

what changed in the init.d and rc[0-5].d directories? Are you using /etc/defaultrouter?
That should not get blown away.

Just to be clear - this is for a "root" or global zone, right - not a non-global zone?

Don't forget that routes added manually (by CLI) will NOT survive a reboot (in Solaris). Anyone disagree with that??

Create/configure a /etc/defaultrouter file.

Yes, a very good point from jim mcnamara......we're not talking about a non-global zone here are we?

The route command creates data that is kernel persistent only - meaning it does not survive a reboot.

I do. You can set routes that will survive a reboot with at least Solaris 10 and newer:

$ man route
...
    -p  Make changes to the network route tables persistent across system restarts.