Unix/Linux Go Back    

NetBSD 6.1.5 - man page for route.conf (netbsd section 5)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

ROUTE.CONF(5)			     BSD File Formats Manual			    ROUTE.CONF(5)

     route.conf -- static routes config file

     The route.conf file is read by the staticroute rc.d script during system start-up and shut-
     down, and is intended for adding and removing static routes.

     Lines starting with a hash ('#') are comments and ignored.  Lines starting with a plus sign
     ('+') are run during start-up, while lines starting with a minus sign ('-') are run during
     system shutdown.  If a line starts with a '!', the rest of the line will get evaluated as a
     shell script fragment.  All other lines are passed to route(8).  During start-up, they are
     passed behind a ``route add -'' command and during shutdown behind a ``route delete -'' com-

     /etc/route.conf	 The route.conf file resides in /etc.

			 rc.d(8) script that parses route.conf.

     In this example, the interface for the desired routing changes is set, the IP address on
     that interface is determined, and a route is added during startup, or deleted during system

	   # Set interface and determine current IP address for added route.
	   !ipaddr=$(/sbin/ifconfig ${ifname} | awk '$1 == "inet" {print $2}')
	   net 10.10.1 -interface ${ipaddr}

     In this example, IP forwarding is turned on during start-up, and a static route added for  During system shutdown, the route is removed and IP forwarding turned off.

	   # Turn on/off IP forwarding.
	   +sysctl -w net.inet.ip.forwarding=1
	   -sysctl -w net.inet.ip.forwarding=0
	   net -netmask

     rc.conf(5), rc(8), route(8)

BSD					   May 1, 2012					      BSD
Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 11:23 PM.