User Tools

Site Tools


Setting up an IPv6 Tunnel using LuCI

The LuCI interface for IPv6-in-IPv4 requires the 6in4 and luci-proto-ipv6 packages. You can install them with opkg update && opkg install 6in4 luci-proto-ipv6. After installing, you may need to reboot your router for the LuCI cache to detect the new protocol.

OpenWrt is fully capable of handling and routing IPv6 traffic. Many ISPs offer native IPv6, but if yours doesn't, here's a quick setup guide for experimenting with IPv6 (and getting used to the peculiar address format).

The procedure below creates a 6in4 tunnel on the WAN6 interface of your router. This automatically wraps (encapsulates) all IPv6 packets inside IPv4 packets, and sends them to a designated tunnel broker server that unwraps them, and forwards them to the destination IPv6 host. Packets from those IPv6 hosts go to the tunnel broker server, where they're wrapped in an IPv4 packet and sent back to your router, which then unwraps them for for use on your local network.

Create a Tunnel Account

Before you can configure your router, you must set up a free account at Hurricane Electric's site, then create up a Regular Tunnel. Be sure to click Assign /48 for the “Routed /48” field. The Hurricane Electric Tunnel Details page (image below) shows the details of your tunnel.

Note: There are detailed instructions for creating the 6in4 tunnel at
Note: Most people have a public IPv4-address. But if you're behind ISP NAT, the 6in4-tunnel from Hurricane Electric is not supported. Tunnel Broker Details

Configure your Router

To complete the OpenWrt configuration, open the router's Network → Interfaces page in a separate tab or window, find the WAN6 interface, and click Edit:

  • Change Protocol to IPv6-in-IPv4 (RFC4213)
  • Click Change Protocol and confirm.

You'll see the WAN6 Common Configuration page (image below). Copy the values from the Tunnel Details page to the corresponding field of the WAN6 Common Configuration page:

  • Leave “Local IPv4 address” empty
  • Set “Remote IPv4 address” to “Server IPv4 Address” from the Tunnel Details page
  • Set “Local IPv6 address” to “Client IPv6 Address”
  • Set “IPv6 routed prefix” to “Routed /48” value“ (click Assign /48 on the Tunnel Details if it's not present)
  • Check the Dynamic tunnel box. This reveals more fields:
  • Set “Tunnel ID” to the “Tunnel ID” field
  • Set “ username” to the user name you used to create the account
  • Set “ password” to the Update Key found on the Advanced tab of Tunnel Details page
  • Keep the default settings of the Advanced and Firewall tabs as-is
  • Click Save and Apply

At this point, your computer should have direct IPv6 connectivity with the rest of the Internet. (You may need to restart the router, or disable and re-enable the network interface of your computer before the 6in4 addressing works.) To test, type ping

Legacy notes:

  • OpenWrt has handled IPv6 since at least Backfire (10.03.1). This procedure should work with 17.01 and newer, and was tested with 18.06.1
  • There is a script over at OpenWrt scripts.. That script is convenient if you need to reconfigure the router frequently. Otherwise, it's just as simple to use the LuCI web GUI.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
docs/guide-user/network/ipv6/ipv6tunnel-luci.txt · Last modified: 2020/09/20 20:31 by vgaetera