Page MenuHomeVyOS Platform

tunnel: add new encapsulation types ip6tnl and ip6gretap
Closed, ResolvedPublicFEATURE REQUEST

Description

ip6tnl supports modes ip6ip6, ipip6, any.
Mode ipip6 is IPv4 over IPv6, and mode ip6ip6 is IPv6 over IPv6, and mode any supports both IPv4/IPv6 over IPv6.

When the ip6tnl module is loaded, the Linux kernel will create a default device, named ip6tnl0.

Example

ip link add name tun6 type ip6tnl local LOCAL_IPv6_ADDR remote REMOTE_IPv6_ADDR mode any
ip link set dev tun6 up

Suggested syntax:

set interfaces tunnel tun30 encapsulation ip6tnl

https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/ip/link_ip6tnl.c

Details

Difficulty level
Normal (likely a few hours)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Feature (new functionality)

Event Timeline

Example

R1

sudo ip link add name tun6 type ip6tnl local 2001:192:168:122:520d:ff:fe03:2 remote 2001:192:168:122:520d:ff:fe01:2 mode any
sudo ip link set dev tun6 up
sudo ip add add 100.64.0.1/30 dev tun6
sudo ip add add 2001:db8:aa::1/64 dev tun6

R2

sudo ip link add name tun6 type ip6tnl local 2001:192:168:122:520d:ff:fe01:2 remote 2001:192:168:122:520d:ff:fe03:2 mode any
sudo ip link set dev tun6 up
sudo ip add add 100.64.0.2/30 dev tun6
sudo ip add add 2001:db8:aa::2/64 dev tun6

Ping from R1 to R2

[email protected]:~$ ping 100.64.0.2
PING 100.64.0.2 (100.64.0.2) 56(84) bytes of data.
64 bytes from 100.64.0.2: icmp_seq=1 ttl=64 time=0.317 ms
64 bytes from 100.64.0.2: icmp_seq=2 ttl=64 time=1.10 ms
^C
--- 100.64.0.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 28ms
rtt min/avg/max/mdev = 0.317/0.708/1.100/0.392 ms
[email protected]:~$ 
[email protected]:~$ ping 2001:db8:aa::2
PING 2001:db8:aa::2(2001:db8:aa::2) 56 data bytes
64 bytes from 2001:db8:aa::2: icmp_seq=1 ttl=64 time=0.371 ms
64 bytes from 2001:db8:aa::2: icmp_seq=2 ttl=64 time=0.647 ms
^C
--- 2001:db8:aa::2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 12ms
rtt min/avg/max/mdev = 0.371/0.509/0.647/0.138 ms
[email protected]:~$

Dump on R2

[email protected]:~$ sudo tcpdump -ni eth1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
12:16:49.007686 STP 802.1d, Config, Flags [none], bridge-id 8000.52:54:00:fc:41:0b.8003, length 35
12:16:50.713815 IP6 2001:192:168:122:520d:ff:fe03:2 > 2001:192:168:122:520d:ff:fe01:2: DSTOPT IP 100.64.0.1 > 100.64.0.2: ICMP echo request, id 2496, seq 1, length 64
12:16:50.713896 IP6 2001:192:168:122:520d:ff:fe01:2 > 2001:192:168:122:520d:ff:fe03:2: DSTOPT IP 100.64.0.2 > 100.64.0.1: ICMP echo reply, id 2496, seq 1, length 64

[email protected]:~$ sudo tcpdump -ni eth1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
12:17:01.662752 IP6 2001:192:168:122:520d:ff:fe03:2 > 2001:192:168:122:520d:ff:fe01:2: DSTOPT IP6 2001:db8:aa::1 > 2001:db8:aa::2: ICMP6, echo request, seq 4, length 64
12:17:01.662839 IP6 2001:192:168:122:520d:ff:fe01:2 > 2001:192:168:122:520d:ff:fe03:2: DSTOPT IP6 2001:db8:aa::2 > 2001:db8:aa::1: ICMP6, echo reply, seq 4, length 64
c-po renamed this task from Add tunnel type ip6tnl to tunnel: add new encapsulation type ip6tnl.Nov 15 2020, 9:32 AM
c-po triaged this task as Normal priority.
c-po changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).
c-po renamed this task from tunnel: add new encapsulation type ip6tnl to tunnel: add new encapsulation types ip6tnl and ip6gretap.Feb 27 2021, 8:27 AM

@Viacheslav we already have ip6tnl support.

496: [email protected]: <NOARP,UP,LOWER_UP> mtu 1476 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/tunnel6 ::1 brd ::2 permaddr ea42:102:9f96:: promiscuity 0 minmtu 68 maxmtu 65407
    ip6tnl ip6ip6 remote ::2 local ::1 hoplimit 64 encaplimit 4 tclass inherit flowlabel 0x00000 addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

ip6ip6 is e.g. an operation mode of ip6tnl, same goes for ipip6

497: [email protected]: <NOARP,UP,LOWER_UP> mtu 1476 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/tunnel6 ::1 brd ::2 permaddr 7a8a:5733:d365:: promiscuity 0 minmtu 68 maxmtu 65407
    ip6tnl ipip6 remote ::2 local ::1 hoplimit 64 encaplimit 4 tclass inherit flowlabel 0x00000 addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

So I think we do not need an explicit encapsulation for it, or do we?

c-po claimed this task.
erkin set Issue type to Feature (new functionality).Aug 29 2021, 12:41 PM
erkin removed a subscriber: Active contributors.