1

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.

Dave M
  • 4,514
  • 22
  • 31
  • 30
lgekman
  • 121
  • 5

1 Answers1

1

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.

lgekman
  • 121
  • 5