Skip to content

Instantly share code, notes, and snippets.

@NetworkLlama
Created January 3, 2024 17:15
Show Gist options
  • Select an option

  • Save NetworkLlama/8c62d9f9a95f1579cf36e67befabe6bc to your computer and use it in GitHub Desktop.

Select an option

Save NetworkLlama/8c62d9f9a95f1579cf36e67befabe6bc to your computer and use it in GitHub Desktop.
Script to enable 6to4 IPv6 (such as Hurricane Electric's Tunnel Broker) on Ubiquiti Dream Machine
# The following is tested to work on a Ubiquiti Dream Machine running UnifiOS 3.2.9. It may work
# on other versions, other Debian-based platforms, or other Linux platforms.
# In this example, the following documentation addresses based on RFCs 5737 and 3489 are used:
# - 203.0.113.100 is the 6to4 gateway (e.g., HE TunnelBroker gateway)
# - 198.51.100.10 is your external ISP-assigned address (possibly DHCP)
# - 2001:db8:1111:aa::2/64 is your virtual device address assignment from the 6to4 provider
# - 2001:db8:b3a7::/48 is your assigned /48 (subnet mask may differ)
# Swap them out as necessary for your own addresses.
# Assigned /48 is 2001:db8:b3a7::/48
# Uncomment next command to delete previously-existing tunnel. *This does not delete address assignments
# for other interfaces. Remaining configs may interfere with traffic routing.*
# ip tunnel del he-ipv6
ip tunnel add he-ipv6 mode sit remote 203.0.113.100 local 198.51.100.10 ttl 255
ip link set he-ipv6 up
ip addr add 2001:db8:1111:aa::2/64 dev he-ipv6
ip route add ::/0 dev he-ipv6
ip -f inet6 addr
# At this point, you should be able to assign IPv6 subnets (typically /64) from your assigned
# subnet to your interfaces and configure to use SLAAC (the native IPv6 way) or DHCPv6.
# Test by running /ping -6 google.com/ and see if you get a response.
# If it doesn't work after this, use /ip -6 route/ to check that the default GW points to
# he-ipv6 and not eth8. If it does not, then run the following command:
# ip -6 route change default dev he-ipv6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment