]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/gif.4
unfinished sblive driver, playback/mixer only for now - not enabled in
[FreeBSD/FreeBSD.git] / share / man / man4 / gif.4
1 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
2 .\" All rights reserved.
3 .\" 
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the project nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\" 
16 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     $Id: gif.4,v 1.2 1999/09/29 15:36:17 itojun Exp $
29 .\"     $FreeBSD$
30 .\"
31 .Dd April 10, 1999
32 .Dt GIF 4
33 .Os
34 .Sh NAME
35 .Nm gif
36 .Nd
37 .Tn Generic tunnel interface
38 .Sh SYNOPSIS
39 .Cd "pseudo-device gif 4"
40 .Sh DESCRIPTION
41 The
42 .Nm
43 interface is a generic tunnelling pseudo device for IPv4 and IPv6.
44 It can tunnel IPv[46] traffic over IPv[46].
45 Therefore, there can be four possible configurations.
46 The behavior of
47 .Nm
48 is mainly based on RFC1933 IPv6-over-IPv4 configured tunnel.
49 .Pp
50 To use
51 .Nm gif ,
52 administrator needs to configure protocol and addresses used for the outer 
53 header.
54 This can be done by using
55 .Xr gifconfig 8 ,
56 or
57 .Dv SIOCSIFPHYADDR
58 ioctl.
59 Also, administrator needs to configure protocol and addresses used for the
60 inner header, by using
61 .Xr ifconfig 8 .
62 Note that IPv6 link-local address
63 .Pq those start with Li fe80::
64 will be automatically configured whenever possible.
65 You may need to remove IPv6 link-local address manually using
66 .Xr ifconfig 8 ,
67 when you would like to disable the use of IPv6 as inner header
68 .Pq like when you need pure IPv4-over-IPv6 tunnel .
69 Finally, use routing table to route the packets toward
70 .Nm
71 interface.
72 .Pp
73 .Nm
74 interface can be configued to perform bidirectional tunnel, or
75 multi-destination tunnel.
76 This is controlled by
77 .Dv IFF_LINK0
78 interface flag.
79 Also,
80 .Nm
81 can be configured to be ECN friendly.
82 This can be configured by
83 .Dv IFF_LINK1 .
84 .\"
85 .Ss Bidirectional and multi-destination mode
86 Usually,
87 .Nm
88 implements bidirectional tunnel.
89 .Xr gifconfig 8
90 should configure a tunnel ingress point
91 .Pq this node
92 and an egress point
93 .Pq tunnel endpoint ,
94 and
95 one
96 .Nm
97 interface will tunnel to only a single tunnel endpoint,
98 and accept from only a single tunnel endpoint.
99 Source and destination address for outer IP header is always the
100 ingress and the egress point configued by
101 .Xr gifconfig 8 .
102 .Pp
103 With
104 .Dv IFF_LINK0
105 interface flag,
106 .Nm
107 can be configured to implement multi-destination tunnel.
108 With
109 .Dv IFF_LINK0 ,
110 it is able to configure egress point to IPv4 wildcard address
111 .Pq Nm 0.0.0.0
112 or IPv6 unspecified address
113 .Pq Nm 0::0 .
114 In this case, destination address for the outer IP header is
115 determined based on the routing table setup.
116 Therefore, one
117 .Nm
118 interface can tunnel to multiple destinations.
119 Also,
120 .Nm
121 will accept tunneled traffic from any outer source address.
122 .Pp
123 When finding a
124 .Nm gif
125 interface from the inbound tunneled traffic,
126 bidirectional mode interface is preferred than multi-destination mode interface.
127 For example, if you have the following three
128 .Nm
129 interfaces on node A, tunneled traffic from C to A will match the second
130 .Nm
131 interface, not the third one.
132 .Bl -bullet -compact -offset indent
133 .It
134 bidirectional, A to B
135 .It
136 bidirectional, A to C
137 .It
138 multi-destination, A to any
139 .El
140 .Pp
141 Please note that multi-destination mode is far less secure
142 than bidirectional mode.
143 Multi-destination mode
144 .Nm
145 can accept tunneled packet from anybody,
146 and can be attacked from a malicious node.
147 .Pp
148 .Ss ECN friendly behavior
149 .Nm
150 can be configured to be ECN friendly, as described in
151 .Dv draft-ipsec-ecn-00.txt .
152 This is turned off by default, and can be turned on by
153 .Dv IFF_LINK1
154 interface flag.
155 .Pp
156 Without
157 .Dv IFF_LINK1 ,
158 .Nm
159 will show a normal behavior, like described in RFC1933.
160 This can be summarized as follows:
161 .Bl -tag -width "Ingress" -offset indent
162 .It Ingress
163 Set outer TOS bit to
164 .Dv 0 .
165 .It Egress
166 Drop outer TOS bit.
167 .El
168 .Pp
169 With
170 .Dv IFF_LINK1 ,
171 .Nm
172 will copy ECN bits
173 .Po
174 .Dv 0x02
175 and
176 .Dv 0x01
177 on IPv4 TOS byte or IPv6 traffic class byte
178 .Pc
179 on egress and ingress, as follows:
180 .Bl -tag -width "Ingress" -offset indent
181 .It Ingress
182 Copy TOS bits except for ECN CE
183 .Po
184 masked with
185 .Dv 0xfe
186 .Pc
187 from
188 inner to outer.
189 set ECN CE bit to
190 .Dv 0 .
191 .It Egress
192 Use inner TOS bits with some change.
193 If outer ECN CE bit is
194 .Dv 1 ,
195 enable ECN CE bit on the inner.
196 .El
197 .Pp
198 Note that the ECN friendly behavior violates RFC1933.
199 This should be used in mutual agreement with the tunnel endpoint.
200 .Pp
201 .Ss Backward compatibility
202 .Nm
203 interface will capture packets toward IPv4-in-IPv4 tunnel,
204 which has been used by
205 .Xr vif 4 
206 multicast tunnel device
207 .Pq used in MBone community .
208 For compatibility, IPv4-in-IPv4 traffic will be matched to
209 .Nm
210 interfaces first, and then sent to
211 .Xr vif 4
212 if no match is found.
213 .\"
214 .Sh SEE ALSO
215 .Xr inet 4 ,
216 .Xr inet6 4 ,
217 .Xr vif 4 ,
218 .Xr gifconfig 8 ,
219 RFC1933
220 .Rs
221 .%A     Sally Floyd
222 .%A     David L. Black
223 .%A     K. K. Ramakrishnan
224 .%T     "IPsec Interactions with ECN"
225 .%D     February 1999
226 .%O     http://www.aciri.org/floyd/papers/draft-ipsec-ecn-00.txt
227 .Re
228 .\"
229 .Sh HISTORY
230 The
231 .Nm
232 device first appeared in WIDE hydrangea IPv6 kit.