Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / gifconfig / gifconfig.8
1 .\"     $FreeBSD: src/usr.sbin/gifconfig/gifconfig.8,v 1.1.2.11 2003/03/11 21:13:49 trhodes Exp $
2 .\"     $KAME: gifconfig.8,v 1.6 2000/11/22 11:10:09 itojun Exp $
3 .\"
4 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the project nor the names of its contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"    without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .Dd May 17, 1998
32 .Dt GIFCONFIG 8
33 .Os
34 .Sh NAME
35 .Nm gifconfig
36 .Nd configure generic IP tunnel
37 .\"
38 .Sh SYNOPSIS
39 .Nm
40 .Ar interface
41 .Op Ar af
42 .Op Ar physsrc physdest
43 .Nm
44 .Ar interface
45 .Ic delete
46 .Nm
47 .Fl a
48 .Sh DESCRIPTION
49 The
50 .Nm
51 utility configures the physical address for the generic IP tunnel
52 interface, such as "gif0".
53 Argument
54 .Ar physsrc
55 and
56 .Ar physdest
57 are interpreted as the outer source/destination address for
58 encapsulating IPv4/v6 header.
59 Argument
60 .Ar af
61 specifies the address family for
62 .Ar physsrc
63 and
64 .Ar physdest .
65 .Ar af
66 can be
67 .Li inet
68 or
69 .Li inet6 ,
70 and will be treated as
71 .Li inet
72 if ommitted.
73 .Pp
74 If a special argument
75 .Ic delete
76 is specified,
77 .Nm
78 just deletes the existing source and destination addresses on
79 .Ar interface .
80 If no outer addresses are specified, this usage has no effect.
81 .Pp
82 The
83 .Nm
84 utility takes the following optional argument:
85 .Bl -tag -width Ds
86 .It Fl a
87 Display information associated with all
88 .Xr gif 4
89 interfaces.
90 .El
91 .Pp
92 Please note that it is very easy to create infinite routing loop,
93 when you configure tunnel over same address family
94 (e.g. IPv4-over-IPv4).
95 .Pp
96 Each
97 .Xr gif 4
98 interface is created at runtime using interface cloning.
99 This is
100 most easily done with the
101 .Xr ifconfig 8
102 .Cm create
103 command or using the
104 .Va gifconfig_ Ns Aq Ar interface
105 variable in
106 .Xr rc.conf 5 .
107 .Sh EXAMPLES
108 If you would like to configure IPv6 over IPv4
109 (aka IPv6 in IPv4)
110 tunnel between
111 .Li 10.1.1.1
112 and
113 .Li 10.2.3.4 ,
114 you should perform the following command:
115 .Bd -literal -offset
116 # gifconfig gif0 inet 10.1.1.1 10.2.3.4
117 .Ed
118 .Pp
119 .\" To use the
120 .\" .Li 0.0.0.0
121 .\" feature to establish a tunnel from host1 to host3
122 .\" which will encapsulate and carry packets from host2, on host1 do:
123 .\" .Bd -literal -offset
124 .\" # ifconfig gif0 inet host1  127.0.0.2  # assign an address to gif0
125 .\" # gifconfig gif0 inet host1 0.0.0.0    # assign encapsulation addresses
126 .\" # route add host2 host3 -ifp gif0:     # encap host2 packets, send to host3
127 .\" .Ed
128 .\" .Pp
129 .\" Note: the
130 .\" .Fl ifp
131 .\" option to route does not work as documented in
132 .\" most versions of FreeBSD.
133 .\" .Pp
134 .\" On host3 do:
135 .\" .Bd -literal -offset
136 .\" # ifconfig gif0 inet host3  127.0.0.2  # assign an address to gif0
137 .\" # gifconfig gif0 inet host3 0.0.0.0    # assign encapsulation addresses
138 .\" .Ed
139 .\" .Pp
140 .\" Now if you ping host2 from host1, the packets should be encapsulated
141 .\" with outer source address = host1 and outer destination address = host3,
142 .\" and delivered to host3.
143 .\" host3 will decapsulate the packet and deliver it normally to host2.
144 .\" .Pp
145 This is also possible to use IPv6 as outer proto, by replacing
146 .Li inet
147 to
148 .Li inet6 ,
149 and IPv4 addresses to some appropriate IPv6 addresses in above example.
150 .Sh RETURN VALUES
151 The command exits with exit status of 1 on errors, 0 on success.
152 .Sh SEE ALSO
153 .Xr gif 4 ,
154 .Xr ifconfig 8
155 .Sh HISTORY
156 The
157 .Nm
158 utility first appeared in WIDE Hydrangea IPv6 protocol stack kit.
159 .Pp
160 IPv6 and IPsec support based on the KAME Project (http://www.kame.net/) stack
161 was initially integrated into
162 .Fx 4.0