I handle this in two steps, setting the default gateway instantly and setting the default gateway to be active upon reboot. Otherwise, to only create the /etc/defaultrouter file would require that the system reboot before it becomes active.
To view the current settings use
netstat -nr
To set the gateway to be active immediately:
route add default X.X.X.X
To set the gateway to active upon reboot:
vi /etc/defaultrouter
add a line with the IP address of the default gateway
On SunOS (by default) the gateway is set during run level 2 using the /etc/rc2.d/S69inet script. This script specifically looks for the existence of the /etc/defaultrouter file.
0 comments:
Post a Comment