xref: /openbsd/share/man/man4/gif.4 (revision d415bd75)
1.\"	$OpenBSD: gif.4,v 1.33 2018/07/11 06:16:50 jmc Exp $
2.\"	$KAME: gif.4,v 1.15 2000/04/19 09:39:42 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 $Mdocdate: July 11 2018 $
32.Dt GIF 4
33.Os
34.Sh NAME
35.Nm gif
36.Nd generic tunnel interface
37.Sh SYNOPSIS
38.Cd "pseudo-device gif"
39.Sh DESCRIPTION
40The
41.Nm
42interface is a generic tunnelling pseudo-device.
43It can tunnel IPv4, IPv6, and MPLS over IPv4 and IPv6,
44with behavior mainly based on RFC 4213 IPv6-over-IPv4.
45.Pp
46A
47.Nm
48interface can be created at runtime using the
49.Ic ifconfig gif Ns Ar N Ic create
50command or by setting up a
51.Xr hostname.if 5
52configuration file for
53.Xr netstart 8 .
54.Pp
55The
56.Nm
57interface must be configured with the
58addresses used for the outer header.
59This can be done by using
60.Xr ifconfig 8 Ns 's
61.Ic tunnel
62command (which uses the
63.Dv SIOCSLIFPHYADDR
64ioctl).
65.Pp
66The addresses of the inner header must be configured by using
67.Xr ifconfig 8
68in the normal way.
69The routing table can be used to direct packets toward the
70.Nm
71interface.
72.Sh SEE ALSO
73.Xr sysctl 2 ,
74.Xr etherip 4 ,
75.Xr gre 4 ,
76.Xr inet 4 ,
77.Xr inet6 4 ,
78.Xr ipsec 4 ,
79.Xr hostname.if 5 ,
80.Xr ifconfig 8 ,
81.Xr netstart 8
82.Sh STANDARDS
83.Rs
84.%A E. Nordmark
85.%A R. Gilligan
86.%D October 2005
87.%R RFC 4213
88.%T Basic Transition Mechanisms for IPv6 Hosts and Routers
89.Re
90.Pp
91.Rs
92.%A T. Worster
93.%A Y. Rekhter
94.%A E. Rosen
95.%D March 2005
96.%R RFC 4023
97.%T Encapsulating MPLS in IP or Generic Routing Encapsulation (GRE)
98.Re
99.Sh HISTORY
100The
101.Nm
102device first appeared in WIDE hydrangea IPv6 kit.
103.Pp
104Previously,
105.Nm
106supported RFC 3378 EtherIP tunnels over
107.Xr bridge 4
108interfaces.
109This is now handled by
110.Xr etherip 4 .
111.Sh BUGS
112There are many tunnelling protocol specifications,
113defined differently from each other.
114.Nm
115may not interoperate with peers which are based on different specifications,
116and are picky about outer header fields.
117For example, you cannot usually use
118.Nm
119to talk with IPsec devices that use IPsec tunnel mode.
120.Pp
121The current code does not check if the ingress address
122.Pq outer source address
123configured to
124.Nm
125makes sense.
126Make sure to configure an address which belongs to your node.
127Otherwise, your node will not be able to receive packets from the peer,
128and your node will generate packets with a spoofed source address.
129.Pp
130If the outer protocol is IPv6, path MTU discovery for encapsulated packet
131may affect communication over the interface.
132