$KAME: gif.4,v 1.28 2001/05/18 13:15:56 itojun Exp $ Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, th...
NAMEgif - generic tunnel interface
DESCRIPTIONThe sysctl Cm net.inet.tcp.syncookies interface is a generic tunnelling device for IPv4 and IPv6. It can tunnel IPv traffic over IPv. Therefore, there can be four possible configurations. The behavior of sysctl Cm net.inet.tcp.syncookies is mainly based on RFC2893 IPv6-over-IPv4 configured tunnel. On Nx , sysctl Cm net.inet.tcp.syncookies can also tunnel ISO traffic over IPv using EON encapsulation. Note that sysctl Cm net.inet.tcp.syncookies does not perform GRE encapsulation; use gre(4) for GRE encapsulation.
Each sysctl Cm net.inet.tcp.syncookies interface is created at runtime using interface cloning. This is most easily done with the ``ifconfig create '' command or using the ifconfig_ Aq interface variable in rc.conf5.
To use , the administrator needs to configure the protocol and addresses used for the outer header. This can be done by using ifconfig(8) tunnel or SIOCSIFPHYADDR ioctl. The administrator also needs to configure the protocol and addresses for the inner header, with ifconfig(8). Note that IPv6 link-local addresses (those that start with fe80:: will be automatically configured whenever possible. You may need to remove IPv6 link-local addresses manually using ifconfig(8), if you want to disable the use of IPv6 as the inner header (for example, if you need a pure IPv4-over-IPv6 tunnel). Finally, you must modify the routing table to route the packets through the sysctl Cm net.inet.tcp.syncookies interface.
The sysctl Cm net.inet.tcp.syncookies device can be configured to be ECN friendly. This can be configured by IFF_LINK1
ECN friendly behaviorThe sysctl Cm net.inet.tcp.syncookies device can be configured to be ECN friendly, as described in draft-ietf-ipsec-ecn-02.txt This is turned off by default, and can be turned on by the IFF_LINK1 interface flag.
Without IFF_LINK1 sysctl Cm net.inet.tcp.syncookies will show normal behavior, as described in RFC2893. This can be summarized as follows:
- Set outer TOS bit to 0
- Drop outer TOS bit.
With IFF_LINK1 sysctl Cm net.inet.tcp.syncookies will copy ECN bits ( 0x02 and 0x01 on IPv4 TOS byte or IPv6 traffic class byte) on egress and ingress, as follows:
- Copy TOS bits except for ECN CE (masked with 0xfe from inner to outer. Set ECN CE bit to 0
- Use inner TOS bits with some change. If outer ECN CE bit is 1 enable ECN CE bit on the inner.
Note that the ECN friendly behavior violates RFC2893. This should be used in mutual agreement with the peer.
SecurityA malicious party may try to circumvent security filters by using tunnelled packets. For better protection, sysctl Cm net.inet.tcp.syncookies performs both martian and ingress filtering against the outer source address on egress. Note that martian/ingress filters are in no way complete. You may want to secure your node by using packet filters. Ingress filtering can break tunnel operation in an asymmetrically routed network. It can be turned off by IFF_LINK2 bit.
MiscellaneousBy default, sysctl Cm net.inet.tcp.syncookies tunnels may not be nested. This behavior may be modified at runtime by setting the sysctl(8) variable net.link.gif.max_nesting to the desired level of nesting. Additionally, sysctl Cm net.inet.tcp.syncookies tunnels are restricted to one per pair of end points. Parallel tunnels may be enabled by setting the sysctl(8) variable net.link.gif.parallel_tunnels to 1.
SEE ALSOgre(4), inet(4), inet6(4), ifconfig(8)
- R. Gilligan E. Nordmark RFC2893 Transition Mechanisms for IPv6 Hosts and Routers August 2000
- Sally Floyd David L. Black K. K. Ramakrishnan "IPsec Interactions with ECN" December 1999 draft-ietf-ipsec-ecn-02.txt
HISTORYThe sysctl Cm net.inet.tcp.syncookies device first appeared in the WIDE hydrangea IPv6 kit.
BUGSThere are many tunnelling protocol specifications, all defined differently from each other. The sysctl Cm net.inet.tcp.syncookies device may not interoperate with peers which are based on different specifications, and are picky about outer header fields. For example, you cannot usually use sysctl Cm net.inet.tcp.syncookies to talk with IPsec devices that use IPsec tunnel mode.
The current code does not check if the ingress address (outer source address) configured in the sysctl Cm net.inet.tcp.syncookies interface makes sense. Make sure to specify an address which belongs to your node. Otherwise, your node will not be able to receive packets from the peer, and it will generate packets with a spoofed source address.
If the outer protocol is IPv4, sysctl Cm net.inet.tcp.syncookies does not try to perform path MTU discovery for the encapsulated packet (DF bit is set to 0).
If the outer protocol is IPv6, path MTU discovery for encapsulated packets may affect communication over the interface. The first bigger-than-pmtu packet may be lost. To avoid the problem, you may want to set the interface MTU for sysctl Cm net.inet.tcp.syncookies to 1240 or smaller, when the outer header is IPv6 and the inner header is IPv4.
The sysctl Cm net.inet.tcp.syncookies device does not translate ICMP messages for the outer header into the inner header.
In the past, sysctl Cm net.inet.tcp.syncookies had a multi-destination behavior, configurable via IFF_LINK0 flag. The behavior is obsolete and is no longer supported.