How to set up a 6in4 / 6to4 tunnel server on a Linux gateway

ipv6tunnel

I have native IPv6 connection (/64 prefix), and I've been trying to set up IPv6 connection behind a OpenWrt router. But I discovered that I was unable to use ebtables to pass through all IPv6 traffic (firmware limitation) or use ndppd to proxy all ICMPv6 requests (neighbor solicitation / advertisement, upstream router which I have no control is not accepting them with unknown reason).

It seems that the only option I have now is to tunnel all IPv6 traffic. Below is the network topology:

   Internet  --   Router      --      PC
            wan prefix::/64
            wan 219.242.x.x
            lan 10.224.0.1      10.224.36.223

I'm trying to create a tunnel between two 10.224.x.x addresses to tunnel all IPv6 traffic in order to get IPv6 connection.

I've searched for some tutorials but I can't figure out which address to use as parameters when setting up the tunnel.

The PC is running Windows. It would be better if a configuration example is provided too.

(The gateway is running OpenWrt, but I assume it works almost like a Linux gateway?)

Best Answer

A tunnel is not a solution to the problem you are facing.

You have a direct physical connection between the two machines you would connect by a tunnel, so there is no need for the tunnel in the first place. Any addressing you wanted to perform on the tunnel can be done directly on the Ethernet connection between the two endpoints. And doing it on Ethernet rather than on a tunnel takes away the additional complexity in the configuration as well as the encapsulation overhead.

You do have another problem, which is that you don't have any address to assign to that connection. But using IPv6 over Ethernet or IPv6 over a tunnel doesn't change that. They both need the same number of addresses (except that doing it over Ethernet would allow that prefix to be used by the entire LAN).

If you want to do this correctly, you need a prefix for the LAN, which must be routed to your router. From your description you currently only have a link prefix for the WAN. That is not enough, since you need another link prefix for the LAN, which must be taken from a prefix routed to your router.

I know of one standardized protocol for setting up this routed prefix, that is DHCPv6. The router should be sending a DHCPv6 request on its WAN interface and request a routed prefix. A routed /64 is sufficient for what you want to do now, but you may as well go for a /48, /56, or /60 right away, since you'll probably soon find uses for more than a single /64 on your LAN. The alternative to DHCPv6 with prefix delegation is for your ISP to configure a static route for the prefix routed to your router.

If you find that your ISP does not have any DHCPv6 server, or that it won't even delegate a /60 or a /64, then you should contact your ISP to ask how to get a prefix routed to your router.

If they refuse to route a prefix to your once you have asked for it, then it is time to look for workarounds. The two workarounds I know of are bridging and neighbor discovery proxying. From the ISPs point of view, they will both behave the same, and they will cause memory consumption in their router to go up. They could have avoided that extra memory usage by routing a prefix to you instead.

You say neither workaround is supported by your router firmware. I think that means you will need to upgrade to a firmware that supports it.

You are also asking about 6to4 which is unrelated. I'd rate 6to4 as mostly irrelevant to your setup. Though if you can do so on your router firmware, I'd enable a 6to4 relay on the router, because that will give you more reliable communication when communicating with somebody who is using 6to4. I'd enable a Teredo relay for the exact same reason, that is very convenient if you ever need to connect back home from a laptop on some IPv4-only network.