« NIS tips | Main | egrep OR »

Static routing entries in Solaris

routing table additions on Solaris can be put in /etc/init.d/inetsvc so they happen at system startup. see bottom of file for examples.

Update - Actually, this is a crap place to put the entries as patches and OS updates can overwrite it (despite that I still see it a lot). A much better way is to add a staticrouting script to /etc/init.d/ looking something like this:

#!/sbin/sh
#
# Script   - staticroutes.sh
#
case "$1" in
'start')
    # Route for XX
   /usr/sbin/route add 10.11.12.0/24 10.11.12.1
   # Route for YY
   /usr/sbin/route add 172.16.0.0 -netmask 255.255.0.0 172.16.0.1
   ;;
'stop')
    # Route for XX
   /usr/sbin/route delete 10.11.12.0/24 10.11.12.1
   # Route for YY
   /usr/sbin/route delete 172.16.0.0 -netmask 255.255.0.0 172.16.0.1
   ;;
*)
   echo "Usage: $0 { start | stop }"
   exit 1
   ;;
esac
exit 0

About

This page contains a single entry from the blog

The previous post in this blog was NIS tips.

The next post in this blog is egrep OR.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33