route.conf man page on NetBSD

Man page or keyword search:  
man Server   9087 pages
apropos Keyword Search (all sections)
Output format
NetBSD logo
[printable version]

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

NAME
     route.conf — static routes config file

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

   FILE FORMAT
     Lines starting with a hash (‘#’) are comments and ignored.	 Lines start‐
     ing 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 -” command.

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

     /etc/rc.d/staticroute
			 rc.d(8) script that parses route.conf.

EXAMPLES
     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 dur‐
     ing startup, or deleted during system shutdown.

	   # Set interface and determine current IP address for added route.
	   !ifname=bnx0
	   !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 192.168.2.0.  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 192.168.2.0 -netmask 255.255.255.0 192.168.150.2

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

BSD				  May 1, 2012				   BSD
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server NetBSD

List of man pages available for NetBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net