19a4365d0SYoshinobu Inoue.\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 29a4365d0SYoshinobu Inoue.\" All rights reserved. 39a4365d0SYoshinobu Inoue.\" 49a4365d0SYoshinobu Inoue.\" Redistribution and use in source and binary forms, with or without 59a4365d0SYoshinobu Inoue.\" modification, are permitted provided that the following conditions 69a4365d0SYoshinobu Inoue.\" are met: 79a4365d0SYoshinobu Inoue.\" 1. Redistributions of source code must retain the above copyright 89a4365d0SYoshinobu Inoue.\" notice, this list of conditions and the following disclaimer. 99a4365d0SYoshinobu Inoue.\" 2. Redistributions in binary form must reproduce the above copyright 109a4365d0SYoshinobu Inoue.\" notice, this list of conditions and the following disclaimer in the 119a4365d0SYoshinobu Inoue.\" documentation and/or other materials provided with the distribution. 129a4365d0SYoshinobu Inoue.\" 3. Neither the name of the project nor the names of its contributors 139a4365d0SYoshinobu Inoue.\" may be used to endorse or promote products derived from this software 149a4365d0SYoshinobu Inoue.\" without specific prior written permission. 159a4365d0SYoshinobu Inoue.\" 169a4365d0SYoshinobu Inoue.\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 179a4365d0SYoshinobu Inoue.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 189a4365d0SYoshinobu Inoue.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 199a4365d0SYoshinobu Inoue.\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 209a4365d0SYoshinobu Inoue.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 219a4365d0SYoshinobu Inoue.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 229a4365d0SYoshinobu Inoue.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 239a4365d0SYoshinobu Inoue.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 249a4365d0SYoshinobu Inoue.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 259a4365d0SYoshinobu Inoue.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 269a4365d0SYoshinobu Inoue.\" SUCH DAMAGE. 279a4365d0SYoshinobu Inoue.\" 289a4365d0SYoshinobu Inoue.\" $Id: gif.4,v 1.2 1999/09/29 15:36:17 itojun Exp $ 299a4365d0SYoshinobu Inoue.\" $FreeBSD$ 309a4365d0SYoshinobu Inoue.\" 319a4365d0SYoshinobu Inoue.Dd April 10, 1999 329a4365d0SYoshinobu Inoue.Dt GIF 4 3312900fe3SJeroen Ruigrok van der Werven.Os 349a4365d0SYoshinobu Inoue.Sh NAME 359a4365d0SYoshinobu Inoue.Nm gif 369a4365d0SYoshinobu Inoue.Nd 379a4365d0SYoshinobu Inoue.Tn Generic tunnel interface 389a4365d0SYoshinobu Inoue.Sh SYNOPSIS 399a4365d0SYoshinobu Inoue.Cd "pseudo-device gif 4" 409a4365d0SYoshinobu Inoue.Sh DESCRIPTION 419a4365d0SYoshinobu InoueThe 429a4365d0SYoshinobu Inoue.Nm 439a4365d0SYoshinobu Inoueinterface is a generic tunnelling pseudo device for IPv4 and IPv6. 449a4365d0SYoshinobu InoueIt can tunnel IPv[46] traffic over IPv[46]. 459a4365d0SYoshinobu InoueTherefore, there can be four possible configurations. 469a4365d0SYoshinobu InoueThe behavior of 479a4365d0SYoshinobu Inoue.Nm 489a4365d0SYoshinobu Inoueis mainly based on RFC1933 IPv6-over-IPv4 configured tunnel. 499a4365d0SYoshinobu Inoue.Pp 509a4365d0SYoshinobu InoueTo use 519a4365d0SYoshinobu Inoue.Nm gif , 529a4365d0SYoshinobu Inoueadministrator needs to configure protocol and addresses used for the outer 539a4365d0SYoshinobu Inoueheader. 549a4365d0SYoshinobu InoueThis can be done by using 559a4365d0SYoshinobu Inoue.Xr gifconfig 8 , 569a4365d0SYoshinobu Inoueor 579a4365d0SYoshinobu Inoue.Dv SIOCSIFPHYADDR 589a4365d0SYoshinobu Inoueioctl. 599a4365d0SYoshinobu InoueAlso, administrator needs to configure protocol and addresses used for the 609a4365d0SYoshinobu Inoueinner header, by using 619a4365d0SYoshinobu Inoue.Xr ifconfig 8 . 629a4365d0SYoshinobu InoueNote that IPv6 link-local address 639a4365d0SYoshinobu Inoue.Pq those start with Li fe80:: 649a4365d0SYoshinobu Inouewill be automatically configured whenever possible. 659a4365d0SYoshinobu InoueYou may need to remove IPv6 link-local address manually using 669a4365d0SYoshinobu Inoue.Xr ifconfig 8 , 679a4365d0SYoshinobu Inouewhen you would like to disable the use of IPv6 as inner header 689a4365d0SYoshinobu Inoue.Pq like when you need pure IPv4-over-IPv6 tunnel . 699a4365d0SYoshinobu InoueFinally, use routing table to route the packets toward 709a4365d0SYoshinobu Inoue.Nm 719a4365d0SYoshinobu Inoueinterface. 729a4365d0SYoshinobu Inoue.Pp 739a4365d0SYoshinobu Inoue.Nm 749a4365d0SYoshinobu Inoueinterface can be configued to perform bidirectional tunnel, or 759a4365d0SYoshinobu Inouemulti-destination tunnel. 769a4365d0SYoshinobu InoueThis is controlled by 779a4365d0SYoshinobu Inoue.Dv IFF_LINK0 789a4365d0SYoshinobu Inoueinterface flag. 799a4365d0SYoshinobu InoueAlso, 809a4365d0SYoshinobu Inoue.Nm 819a4365d0SYoshinobu Inouecan be configured to be ECN friendly. 829a4365d0SYoshinobu InoueThis can be configured by 839a4365d0SYoshinobu Inoue.Dv IFF_LINK1 . 849a4365d0SYoshinobu Inoue.\" 859a4365d0SYoshinobu Inoue.Ss Bidirectional and multi-destination mode 869a4365d0SYoshinobu InoueUsually, 879a4365d0SYoshinobu Inoue.Nm 889a4365d0SYoshinobu Inoueimplements bidirectional tunnel. 899a4365d0SYoshinobu Inoue.Xr gifconfig 8 909a4365d0SYoshinobu Inoueshould configure a tunnel ingress point 919a4365d0SYoshinobu Inoue.Pq this node 929a4365d0SYoshinobu Inoueand an egress point 939a4365d0SYoshinobu Inoue.Pq tunnel endpoint , 949a4365d0SYoshinobu Inoueand 959a4365d0SYoshinobu Inoueone 969a4365d0SYoshinobu Inoue.Nm 979a4365d0SYoshinobu Inoueinterface will tunnel to only a single tunnel endpoint, 989a4365d0SYoshinobu Inoueand accept from only a single tunnel endpoint. 999a4365d0SYoshinobu InoueSource and destination address for outer IP header is always the 1009a4365d0SYoshinobu Inoueingress and the egress point configued by 1019a4365d0SYoshinobu Inoue.Xr gifconfig 8 . 1029a4365d0SYoshinobu Inoue.Pp 1039a4365d0SYoshinobu InoueWith 1049a4365d0SYoshinobu Inoue.Dv IFF_LINK0 1059a4365d0SYoshinobu Inoueinterface flag, 1069a4365d0SYoshinobu Inoue.Nm 1079a4365d0SYoshinobu Inouecan be configured to implement multi-destination tunnel. 1089a4365d0SYoshinobu InoueWith 1099a4365d0SYoshinobu Inoue.Dv IFF_LINK0 , 1109a4365d0SYoshinobu Inoueit is able to configure egress point to IPv4 wildcard address 1119a4365d0SYoshinobu Inoue.Pq Nm 0.0.0.0 1129a4365d0SYoshinobu Inoueor IPv6 unspecified address 1139a4365d0SYoshinobu Inoue.Pq Nm 0::0 . 1149a4365d0SYoshinobu InoueIn this case, destination address for the outer IP header is 1159a4365d0SYoshinobu Inouedetermined based on the routing table setup. 1169a4365d0SYoshinobu InoueTherefore, one 1179a4365d0SYoshinobu Inoue.Nm 1189a4365d0SYoshinobu Inoueinterface can tunnel to multiple destinations. 1199a4365d0SYoshinobu InoueAlso, 1209a4365d0SYoshinobu Inoue.Nm 1219a4365d0SYoshinobu Inouewill accept tunneled traffic from any outer source address. 1229a4365d0SYoshinobu Inoue.Pp 1239a4365d0SYoshinobu InoueWhen finding a 1249a4365d0SYoshinobu Inoue.Nm gif 1259a4365d0SYoshinobu Inoueinterface from the inbound tunneled traffic, 1269a4365d0SYoshinobu Inouebidirectional mode interface is preferred than multi-destination mode interface. 1279a4365d0SYoshinobu InoueFor example, if you have the following three 1289a4365d0SYoshinobu Inoue.Nm 1299a4365d0SYoshinobu Inoueinterfaces on node A, tunneled traffic from C to A will match the second 1309a4365d0SYoshinobu Inoue.Nm 1319a4365d0SYoshinobu Inoueinterface, not the third one. 1329a4365d0SYoshinobu Inoue.Bl -bullet -compact -offset indent 1339a4365d0SYoshinobu Inoue.It 1349a4365d0SYoshinobu Inouebidirectional, A to B 1359a4365d0SYoshinobu Inoue.It 1369a4365d0SYoshinobu Inouebidirectional, A to C 1379a4365d0SYoshinobu Inoue.It 1389a4365d0SYoshinobu Inouemulti-destination, A to any 1399a4365d0SYoshinobu Inoue.El 1409a4365d0SYoshinobu Inoue.Pp 1419a4365d0SYoshinobu InouePlease note that multi-destination mode is far less secure 1429a4365d0SYoshinobu Inouethan bidirectional mode. 1439a4365d0SYoshinobu InoueMulti-destination mode 1449a4365d0SYoshinobu Inoue.Nm 1459a4365d0SYoshinobu Inouecan accept tunneled packet from anybody, 1469a4365d0SYoshinobu Inoueand can be attacked from a malicious node. 1479a4365d0SYoshinobu Inoue.Pp 1489a4365d0SYoshinobu Inoue.Ss ECN friendly behavior 1499a4365d0SYoshinobu Inoue.Nm 1509a4365d0SYoshinobu Inouecan be configured to be ECN friendly, as described in 1519a4365d0SYoshinobu Inoue.Dv draft-ipsec-ecn-00.txt . 1529a4365d0SYoshinobu InoueThis is turned off by default, and can be turned on by 1539a4365d0SYoshinobu Inoue.Dv IFF_LINK1 1549a4365d0SYoshinobu Inoueinterface flag. 1559a4365d0SYoshinobu Inoue.Pp 1569a4365d0SYoshinobu InoueWithout 1579a4365d0SYoshinobu Inoue.Dv IFF_LINK1 , 1589a4365d0SYoshinobu Inoue.Nm 1599a4365d0SYoshinobu Inouewill show a normal behavior, like described in RFC1933. 1609a4365d0SYoshinobu InoueThis can be summarized as follows: 1619a4365d0SYoshinobu Inoue.Bl -tag -width "Ingress" -offset indent 1629a4365d0SYoshinobu Inoue.It Ingress 1639a4365d0SYoshinobu InoueSet outer TOS bit to 1649a4365d0SYoshinobu Inoue.Dv 0 . 1659a4365d0SYoshinobu Inoue.It Egress 1669a4365d0SYoshinobu InoueDrop outer TOS bit. 1679a4365d0SYoshinobu Inoue.El 1689a4365d0SYoshinobu Inoue.Pp 1699a4365d0SYoshinobu InoueWith 1709a4365d0SYoshinobu Inoue.Dv IFF_LINK1 , 1719a4365d0SYoshinobu Inoue.Nm 1729a4365d0SYoshinobu Inouewill copy ECN bits 1739a4365d0SYoshinobu Inoue.Po 1749a4365d0SYoshinobu Inoue.Dv 0x02 1759a4365d0SYoshinobu Inoueand 1769a4365d0SYoshinobu Inoue.Dv 0x01 1779a4365d0SYoshinobu Inoueon IPv4 TOS byte or IPv6 traffic class byte 1789a4365d0SYoshinobu Inoue.Pc 1799a4365d0SYoshinobu Inoueon egress and ingress, as follows: 1809a4365d0SYoshinobu Inoue.Bl -tag -width "Ingress" -offset indent 1819a4365d0SYoshinobu Inoue.It Ingress 1829a4365d0SYoshinobu InoueCopy TOS bits except for ECN CE 1839a4365d0SYoshinobu Inoue.Po 1849a4365d0SYoshinobu Inouemasked with 1859a4365d0SYoshinobu Inoue.Dv 0xfe 1869a4365d0SYoshinobu Inoue.Pc 1879a4365d0SYoshinobu Inouefrom 1889a4365d0SYoshinobu Inoueinner to outer. 1899a4365d0SYoshinobu Inoueset ECN CE bit to 1909a4365d0SYoshinobu Inoue.Dv 0 . 1919a4365d0SYoshinobu Inoue.It Egress 1929a4365d0SYoshinobu InoueUse inner TOS bits with some change. 1939a4365d0SYoshinobu InoueIf outer ECN CE bit is 1949a4365d0SYoshinobu Inoue.Dv 1 , 1959a4365d0SYoshinobu Inoueenable ECN CE bit on the inner. 1969a4365d0SYoshinobu Inoue.El 1979a4365d0SYoshinobu Inoue.Pp 1989a4365d0SYoshinobu InoueNote that the ECN friendly behavior violates RFC1933. 1999a4365d0SYoshinobu InoueThis should be used in mutual agreement with the tunnel endpoint. 2009a4365d0SYoshinobu Inoue.Pp 2019a4365d0SYoshinobu Inoue.Ss Backward compatibility 2029a4365d0SYoshinobu Inoue.Nm 2039a4365d0SYoshinobu Inoueinterface will capture packets toward IPv4-in-IPv4 tunnel, 2049a4365d0SYoshinobu Inouewhich has been used by 2059a4365d0SYoshinobu Inoue.Xr vif 4 2069a4365d0SYoshinobu Inouemulticast tunnel device 2079a4365d0SYoshinobu Inoue.Pq used in MBone community . 2089a4365d0SYoshinobu InoueFor compatibility, IPv4-in-IPv4 traffic will be matched to 2099a4365d0SYoshinobu Inoue.Nm 2109a4365d0SYoshinobu Inoueinterfaces first, and then sent to 2119a4365d0SYoshinobu Inoue.Xr vif 4 2129a4365d0SYoshinobu Inoueif no match is found. 2139a4365d0SYoshinobu Inoue.\" 2149a4365d0SYoshinobu Inoue.Sh SEE ALSO 2159a4365d0SYoshinobu Inoue.Xr inet 4 , 2169a4365d0SYoshinobu Inoue.Xr inet6 4 , 2179a4365d0SYoshinobu Inoue.Xr vif 4 , 2189a4365d0SYoshinobu Inoue.Xr gifconfig 8 , 2199a4365d0SYoshinobu InoueRFC1933 2209a4365d0SYoshinobu Inoue.Rs 2219a4365d0SYoshinobu Inoue.%A Sally Floyd 2229a4365d0SYoshinobu Inoue.%A David L. Black 2239a4365d0SYoshinobu Inoue.%A K. K. Ramakrishnan 2249a4365d0SYoshinobu Inoue.%T "IPsec Interactions with ECN" 2259a4365d0SYoshinobu Inoue.%D February 1999 2269a4365d0SYoshinobu Inoue.%O http://www.aciri.org/floyd/papers/draft-ipsec-ecn-00.txt 2279a4365d0SYoshinobu Inoue.Re 2289a4365d0SYoshinobu Inoue.\" 2299a4365d0SYoshinobu Inoue.Sh HISTORY 2309a4365d0SYoshinobu InoueThe 2319a4365d0SYoshinobu Inoue.Nm 2329a4365d0SYoshinobu Inouedevice first appeared in WIDE hydrangea IPv6 kit. 233