IP-TUNNEL(8)
๐ NAME ๐
okay bestie, let's talk about ip-tunnel ๐ง it's the manual page for ip-tunnel, and the whole thing is about tunnel configuration โจ
๐ SYNOPSIS ๐
ip tunnel help
ip [ OPTIONS ] tunnel { add | change | del | show | prl | 6rd } [ NAME ]
[ mode MODE ] [ remote ADDR ] [ local ADDR ]
[ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ] ]
[ encaplimit ELIM ] [ ttl|hoplimit TTL ]
[ tos TOS ] [ flowlabel FLOWLABEL ]
[ prl-default ADDR ] [ prl-nodefault ADDR ] [ prl-delete ADDR ]
[ 6rd-prefix ADDR ] [ 6rd-relay_prefix ADDR ] [ 6rd-reset ]
[ [no]pmtudisc ] [ [no]ignore-df ] [ [no]allow-localremote ]
[ dev PHYS_DEV ]
MODE := { ipip | gre | sit | isatap | vti | ip6ip6 | ipip6 | ip6gre |
vti6 | any }
ADDR := { IP_ADDRESS | any }
TOS := { STRING | 00..ff | inherit | inherit/STRING | inherit/00..ff }
ELIM := { none | 0..255 }
TTL := { 1..255 | inherit }
KEY := { DOTTED_QUAD | NUMBER }
๐ฆ DESCRIPTION ๐ฆ
okay so tunnel objects are tunnels ๐ they wrap up your packets inside other IP packets and then ship them off over the IP infrastructure. the encapsulating (aka outer) address family is picked with the -f option, and it's IPv4 by default, so you don't have to do anything if you're happy with that ๐
๐ธ Commands ๐ธ
ip tunnel addโ add a new tunnel โจip tunnel changeโ change an existing tunnel ๐ฅip tunnel deleteโ destroy a tunnel ๐
๐ Attributes ๐
these are the bits you can set on a tunnel. they're all part of the add, change, and delete flow ๐ซถ
name NAME(default) โ pick the tunnel device name, so your tunnel gets a cute little identity ๐งmode MODEโ sets the tunnel mode ๐ which modes you can use depends on the encapsulating address family:- IPv4 encapsulation supports
ipip,sit,isatap,vti, andgre - IPv6 encapsulation supports
ip6ip6,ipip6,ip6gre,vti6, andany
- IPv4 encapsulation supports
remote ADDRESSโ sets the remote endpoint of the tunnel ๐ฆlocal ADDRESSโ sets a fixed local address for tunneled packets. it has to be an address that lives on another interface of this host, so no sneaking in a random one ๐ttl N/hoplimit Nโ sets a fixed TTL (IPv4) or hoplimit (IPv6) on your tunneled packets.Nis a number from1to255.0is a special value that means the packets just inherit the TTL from the original. the default isinheritfor IPv4 tunnels and64for IPv6 tunnels ๐ธtos T/dsfield T/tclass Tโ sets the type of service (IPv4) or traffic class (IPv6) field on your tunneled packets ๐ you can give it as a two-digit hex value (likec0) or a predefined string (likeinternet). the valueinheritcopies the field from the original IP header.inherit/STRINGorinherit/00..ffset the field toSTRINGor00..ffwhen you're tunneling non-IP packets. the default is00โจdev NAMEโ binds the tunnel to the deviceNAME. this keeps your tunneled packets routed only through that device, so they can't escape to another one when the route to the endpoint changes ๐nopmtudiscโ disables Path MTU Discovery on this tunnel. it's enabled by default. heads up, a fixedttldoesn't play nicely with this option: tunneling with a fixed ttl always does pmtu discovery anyway ๐ignore-dfโ enables IPv4 DF suppression on this tunnel. normally, datagrams that are bigger than the MTU get fragmented. the DF flag stops that, and instead you get an ICMP Unreachable (Fragmentation Required) message back. turning this on makes the DF flag get ignored ๐key K/ikey K/okey K(only GRE tunnels) โ uses keyed GRE with keyK๐Kis either a number or a dotted quad that looks like an IP address.keysets the key for both directions, whileikeyandokeylet you set different keys for input and output ๐ซงcsum,icsum,ocsum(only GRE tunnels) โ generates and/or requires checksums for tunneled packets โocsumcalculates checksums for outgoing packets.icsumrequires every input packet to have the correct checksum.csumis the same as usingicsum ocsumtogether ๐seq,iseq,oseq(only GRE tunnels) โ serializes packets ๐ฆoseqturns on sequencing for outgoing packets.iseqrequires all input packets to be serialized.seqis the same asiseq oseqtogether.
๐ bestie, seq doesn't work. please don't use it.
encaplimit ELIM(only IPv6 tunnels) โ sets a fixed encapsulation limit. the default is4๐flowlabel FLOWLABEL(only IPv6 tunnels) โ sets a fixed flowlabel ๐งallow-localremote(only IPv6 tunnels) โ lets the remote endpoint be on the local host too ๐
๐ prl ๐
ip tunnel prl is the potential router list. it's for ISATAP only ๐ซถ
dev NAMEโ the device name. this one is mandatory, no skipping it ๐prl-default ADDR,prl-nodefault ADDR,prl-delete ADDRโ add or deleteADDRas a potential router or default router ๐
๐ฅ show ๐ฅ
ip tunnel showโ lists tunnels. this command has no arguments, so just type it and go โจ
๐ท SEE ALSO ๐ท
ip(8) is where you'll want to look next ๐ง
๐ซถ AUTHOR ๐ซถ
Original Manpage by Michail Litvak <mci@owl.openwall.com> ๐
bestie, you're all caught up now ๐ this page is from iproute2, last touched 20 Dec 2011, and it's IP-TUNNEL(8) all the way ๐โจ
๐ฆ where this page comes from
- alpine 3.22: iproute2-doc 6.15.0-r0 ยท GPL-2.0-or-later
- alpine 3.23: iproute2-doc 6.17.0-r0 ยท GPL-2.0-or-later
- alpine 3.24: iproute2-doc 7.0.0-r0 ยท GPL-2.0-or-later
- arch rolling: iproute2 7.2.0-1
- arch rolling: iproute2 7.3.0-1 ยท GPL-2.0-or-later
- centos-stream 10: iproute 7.0.0-2.el10 ยท GPL-2.0-or-later AND NIST-PD
- centos-stream 9: iproute 6.17.0-3.el9 ยท GPL-2.0-or-later AND NIST-PD
- debian bookworm: iproute2 6.1.0-3 ยท GPL-2.0-only
- debian trixie: iproute2 6.15.0-1 ยท GPL-2.0-only
- fedora 43: iproute 6.14.0-2.fc43 ยท GPL-2.0-or-later AND NIST-PD
- fedora 44: iproute 6.17.0-2.fc44 ยท GPL-2.0-or-later AND NIST-PD
- nixos 26.05: iproute2 7.0.0
- nixpkgs unstable: iproute2 7.2.0
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- ubuntu jammy: iproute2 5.15.0-1ubuntu2 ยท GPL-2.0-only
- ubuntu jammy: iproute2 5.15.0-1ubuntu2.2 ยท GPL-2.0-only
- ubuntu noble: iproute2 6.1.0-1ubuntu6 ยท GPL-2.0-only
- ubuntu noble: iproute2 6.1.0-1ubuntu6.4 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2
- ubuntu questing: iproute2 6.16.0-1ubuntu2.1 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2.2
- ubuntu resolute: iproute2 6.19.0-1ubuntu1 ยท GPL-2.0-only
- ubuntu resolute: iproute2 6.19.0-1ubuntu1.1 ยท GPL-2.0-only
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms