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 static/dynamic setup.
  • Follow DDNS client to use IPv6 tunnel broker with dynamic address.
  • Follow IPv6 with Hurricane Electric using LuCI for web interface instructions.
  • Provide IPv6 connectivity for LAN clients.
  • Access your LAN services remotely without port forwarding.

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

Install the required packages. Specify configuration parameters for the tunnel. 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 commit network
service 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
service 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; ip -6 rule show; nft list ruleset
# 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
service network restart

Provide IPv6 default route with source filter 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
service network restart

Process IPv6 traffic as separate flows when using cake SQM.

# Configure network
uci set network.wan6.tos="inherit"
uci commit network
service 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: 2023/10/28 14:58
  • by vgaetera