Score:1

How to setup tunnel/vxlan using "ip encap" for ipv6 on Linux?

cn flag

Using light-weight tunnels allows the same (tunnel)device to be used for many destinations (among other things). For vxlan/ipv4 it works;

ip link add vxlan4 type vxlan dstport 4789 dev eth1 ttl 4 external
ip link set dev vxlan4 up
ip route replace 220.0.0.0/24 dev vxlan4 encap ip id 100 dst 192.168.2.221

But the same configuration does not work for IPv6;

ip -6 link add vxlan6 type vxlan dstport 4789 dev eth1 ttl 4 external
ip link set dev vxlan6 up
ip -6 route replace 3000::/96 dev vxlan6 encap ip6 id 100 dst 1000::1:c0a8:2dd

The commands are accepted, but no packets to 3000::/96 are sent (tested with tcpdump).

How to setup tunnel/vxlan using "ip encap" for IPv6 on Linux?

My versions:

ip utility, iproute2-5.19.0
Kernel linux-6.0.0

I have similar problems with GRE tunnels.

Score:1
cn flag

This may have been an xyproblem. What I wanted was a way to tunnel both ipv4 and ipv6 to many destination using only one local tunnel interface. I thought vxlan would be best since it seems to be most used, but I found a way using ip6tnl:

ip link add ip6tnl6 type ip6tnl external
ip link set up dev ip6tnl6
ip -6 route replace 3000::/96 dev ip6tnl6 encap ip6 dst 1000::1:192.168.2.221
ip route replace 220.0.0.0/24 dev ip6tnl6 encap ip6 dst 1000::1:192.168.2.221

With this setup both ipv4 to 220.0.0.0/24 and ipv6 to 3000::/96 will be tunneled to the same ipv6 destination, 1000::1:192.168.2.221. And I can add more routes to other destinations using the same tunnel interface.

If anybody knows why the same commands doesn't work for vxlan I am still interrested though.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.