1.\" $OpenBSD: gif.4,v 1.29 2016/06/07 20:25:48 sthen 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: June 7 2016 $ 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 for IPv4 and IPv6. 43It can tunnel IPv[46] over IPv[46] with behavior mainly based on 44RFC 4213 IPv6-over-IPv4, for a total of four possible combinations. 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 SIOCSIFPHYADDR 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 3 , 74.Xr etherip 4 , 75.Xr inet 4 , 76.Xr inet6 4 , 77.Xr ipsec 4 , 78.Xr hostname.if 5 , 79.Xr ifconfig 8 , 80.Xr netstart 8 81.Sh STANDARDS 82.Rs 83.%A E. Nordmark 84.%A R. Gilligan 85.%D October 2005 86.%R RFC 4213 87.%T Basic Transition Mechanisms for IPv6 Hosts and Routers 88.Re 89.Sh HISTORY 90The 91.Nm 92device first appeared in WIDE hydrangea IPv6 kit. 93.Pp 94Previously, 95.Nm 96supported RFC 3378 EtherIP tunnels over 97.Xr bridge 4 98interfaces. 99This is now handled by 100.Xr etherip 4 . 101.Sh BUGS 102There are many tunnelling protocol specifications, 103defined differently from each other. 104.Nm 105may not interoperate with peers which are based on different specifications, 106and are picky about outer header fields. 107For example, you cannot usually use 108.Nm 109to talk with IPsec devices that use IPsec tunnel mode. 110.Pp 111The current code does not check if the ingress address 112.Pq outer source address 113configured to 114.Nm 115makes sense. 116Make sure to configure an address which belongs to your node. 117Otherwise, your node will not be able to receive packets from the peer, 118and your node will generate packets with a spoofed source address. 119.Pp 120If the outer protocol is IPv6, path MTU discovery for encapsulated packet 121may affect communication over the interface. 122