NetBSD/share/man/man5/route.conf.5
2004-06-28 13:44:12 +00:00

89 lines
2.8 KiB
Groff

.\" $NetBSD: route.conf.5,v 1.2 2004/06/28 13:44:12 wiz Exp $
.\"
.\" Copyright (c) 2004 Thomas Klausner
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd June 24, 2004
.Dt ROUTE.CONF 5
.Os
.Sh NAME
.Nm route.conf
.Nd static routes config file
.Sh DESCRIPTION
The
.Nm
file is read by the
.Pa staticroute
rc.d script during system start-up and shutdown,
and is intended for adding and removing static routes.
.Ss FILE FORMAT
Lines starting with a hash
.Pq Sq #
are comments and ignored.
Lines starting with a plus sign
.Pq Sq +
are run during start-up,
while lines starting with a minus sign
.Pq Sq \-
are run during system shutdown.
All other lines are passed to
.Xr route 8 .
During start-up, they are passed behind a
.Dq Ic route add \-
command and during shutdown behind a
.Dq Ic route delete \-
command.
.Sh FILES
.Bl -tag -width XXetcXrouteXconfXX
.It Pa /etc/route.conf
The
.Nm
file resides in
.Pa /etc .
.It Pa /etc/rc.d/staticroute
.Xr rc.d 8
script that parses
.Nm .
.El
.Sh EXAMPLES
In this example, if the
.Pa staticroute
script is enabled in
.Xr rc.conf 5 ,
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.
.Bd -literal -offset indent
# 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
.Ed
.Sh SEE ALSO
.Xr rc.conf 5 ,
.Xr rc 8 ,
.Xr route 8