IPv6 with Hurricane Electric

  • This how-to describes the method for setting up 6in4 tunnel on OpenWrt.
  • It relies on Hurricane Electric IPv6 tunnel broker and supports both static and dynamic setup.
  • Follow DDNS client to use IPv6 tunnel broker with dynamic address.
  • Provide IPv6 connectivity for LAN clients.
  • Access your LAN services remotely without port forwarding.

You can find instructions for setting a Hurricane Electric tunnel using the LuCI web interface at ipv6tunnel-luci

Register a free account with Hurricane Electric IPv6 tunnel broker and create a regular tunnel.

Install the required packages. Specify the tunnel configuration parameters. Set up a static IPv6 tunnel.

# Install packages
opkg update
opkg install 6in4
# Configuration parameters
# Fetch WAN IP address
. /lib/functions/network.sh
network_find_wan NET_IF
network_get_ipaddr NET_ADDR "${NET_IF}"
# Configure tunnel
uci -q delete network.wan6
uci set network.wan6="interface"
uci set network.wan6.proto="6in4"
uci set network.wan6.ipaddr="${NET_ADDR}"
uci set network.wan6.peeraddr="${HENET_PEER}"
uci set network.wan6.ip6addr="${HENET_IPV6}"
uci add_list network.wan6.ip6prefix="${HENET_PFX64}"
uci add_list network.wan6.ip6prefix="${HENET_PFX48}"
uci set network.wan6.mtu="${HENET_MTU}"
uci commit network
/etc/init.d/network restart

Use ping6 and traceroute6 to verify you can reach IPv6 services.

ping6 openwrt.org
traceroute6 openwrt.org

Check your internet connectivity.

Collect and analyze the following information.

# Restart services
/etc/init.d/log restart; ifup wan6; sleep 10
# Log and status
logread; ifstatus wan6
# Runtime configuration
ip address show; ip route show table all
ip rule show; iptables-save -c
ip -6 rule show; ip6tables-save -c
# Persistent configuration
uci show network; uci show dhcp; uci show firewall

Reconfigure IPv6 tunnel for dynamic IP address.

# Configuration parameters
# Configure tunnel
uci -q delete network.wan6.ipaddr
uci set network.wan6.tunnelid="${HENET_TUNID}"
uci set network.wan6.username="${HENET_USER}"
uci set network.wan6.updatekey="${HENET_UPKEY}"
uci commit network
/etc/init.d/network restart

Provide the default IPv6 route with source routing disabled.

# Configure network
uci -q delete network.wan6_rt
uci set network.wan6_rt="route6"
uci set network.wan6_rt.interface="wan6"
uci set network.wan6_rt.target="::/0"
uci commit network
/etc/init.d/network restart
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
  • Last modified: 2022/01/18 20:51
  • by atownlede