xref: /netbsd-src/share/man/man5/route.conf.5 (revision 23c8222edbfb0f0932d88a8351d3a0cf817dfb9e)
1.\"        $NetBSD: route.conf.5,v 1.2 2004/06/28 13:44:12 wiz Exp $
2.\"
3.\" Copyright (c) 2004 Thomas Klausner
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. The name of the author may not be used to endorse or promote products
15.\"    derived from this software without specific prior written permission
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25.\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27.\"
28.Dd June 24, 2004
29.Dt ROUTE.CONF 5
30.Os
31.Sh NAME
32.Nm route.conf
33.Nd static routes config file
34.Sh DESCRIPTION
35The
36.Nm
37file is read by the
38.Pa staticroute
39rc.d script during system start-up and shutdown,
40and is intended for adding and removing static routes.
41.Ss FILE FORMAT
42Lines starting with a hash
43.Pq Sq #
44are comments and ignored.
45Lines starting with a plus sign
46.Pq Sq +
47are run during start-up,
48while lines starting with a minus sign
49.Pq Sq \-
50are run during system shutdown.
51All other lines are passed to
52.Xr route 8 .
53During start-up, they are passed behind a
54.Dq Ic route add \-
55command and during shutdown behind a
56.Dq Ic route delete \-
57command.
58.Sh FILES
59.Bl -tag -width XXetcXrouteXconfXX
60.It Pa /etc/route.conf
61The
62.Nm
63file resides in
64.Pa /etc .
65.It Pa /etc/rc.d/staticroute
66.Xr rc.d 8
67script that parses
68.Nm .
69.El
70.Sh EXAMPLES
71In this example, if the
72.Pa staticroute
73script is enabled in
74.Xr rc.conf 5 ,
75IP forwarding is turned on during
76start-up, and a static route added for 192.168.2.0.
77During system shutdown, the route is removed
78and IP forwarding turned off.
79.Bd -literal -offset indent
80# Turn on/off IP forwarding.
81+sysctl -w net.inet.ip.forwarding=1
82-sysctl -w net.inet.ip.forwarding=0
83net 192.168.2.0 -netmask 255.255.255.0 192.168.150.2
84.Ed
85.Sh SEE ALSO
86.Xr rc.conf 5 ,
87.Xr rc 8 ,
88.Xr route 8
89