adding routes in Solaris

Solaris Guru's

What is the proper way to add routes in the routing table so after a node reboot the routes will not be lost.

I understand the /etc/defaultrouter for the default router
and the <route add> command but using this command routes will be removed once the node reboots.

Thanks

add your routes to:

/etc/inet/routes

hth

Thanks for the reply, if this files not exist, do I create a file name routes, and if this is the case will the entries follow this format

10.0.83.5 10.0.97.249

10.0.83.5 is the destination and .249 is the gateway, just asking the proper file layout.

Thanks again.

/etc/defaultrouter normally for putting in the defaulrtouter or default gateway.

if your want to add other routes ...

example the command to add routes is

/usr/sbin/route add net 172.20.10.0 <gateway IP>
/usr/sbin/route add host 192.10.10.10 <gateway IP>

normally we create a file called S99routeadd, chmod 755 to it and place it under /etc/rc3.d so that everytime it reboots and system comes up it will autorun the script and add the routes.

Sorry, maybe my question is silly, but why you don't just use route add default ?

sometimes more routes then one is used :wink:

for more info on routing take a look at:http://www.terminalcult.org/manpages.php?manpage=route&Search=Search

enter the routes in the file /etc/inet/routes like this:

net "network" "router"

example:
net 192.168.0.0/24 192.168.0.254

hth,
DN2