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, and gre
    • IPv6 encapsulation supports ip6ip6, ipip6, ip6gre, vti6, and any
  • 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. N is a number from 1 to 255. 0 is a special value that means the packets just inherit the TTL from the original. the default is inherit for IPv4 tunnels and 64 for 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 (like c0) or a predefined string (like internet). the value inherit copies the field from the original IP header. inherit/STRING or inherit/00..ff set the field to STRING or 00..ff when you're tunneling non-IP packets. the default is 00 โœจ
  • dev NAME โ€” binds the tunnel to the device NAME. 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 fixed ttl doesn'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 key K ๐Ÿ”‘ K is either a number or a dotted quad that looks like an IP address. key sets the key for both directions, while ikey and okey let you set different keys for input and output ๐Ÿซง
  • csum, icsum, ocsum (only GRE tunnels) โ€” generates and/or requires checksums for tunneled packets โœ… ocsum calculates checksums for outgoing packets. icsum requires every input packet to have the correct checksum. csum is the same as using icsum ocsum together ๐Ÿ’–
  • seq, iseq, oseq (only GRE tunnels) โ€” serializes packets ๐Ÿ“ฆ oseq turns on sequencing for outgoing packets. iseq requires all input packets to be serialized. seq is the same as iseq oseq together.
๐Ÿ’€ bestie, seq doesn't work. please don't use it.
  • encaplimit ELIM (only IPv6 tunnels) โ€” sets a fixed encapsulation limit. the default is 4 ๐Ÿ“
  • 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 delete ADDR as 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