Skip to content

Instantly share code, notes, and snippets.

@bgrewell
Last active October 27, 2024 19:26
Show Gist options
  • Save bgrewell/591b5ce8809f2bbf0b3999921cecef60 to your computer and use it in GitHub Desktop.
Save bgrewell/591b5ce8809f2bbf0b3999921cecef60 to your computer and use it in GitHub Desktop.
This gist describes how to setup a hurricane electric (TunnelBroker) IPv6 tunnel on a Ubiquiti Unifi Dream Machine Pro

Setup IPv6 Tunnel on Unifi Dream Machine Pro

Enable SSH

TODO

Configure To Dream Machine Over SSH

SSH to your UDM

ssh root@<udm ip address>
<enter the password you set when prompted>

Configure the IPv6 Tunnel - You get the addresses from the Tunnel Details page on TunnelBroker

ip tunnel add he-ipv6 mode sit remote <server ipv4 address> local <client ipv4 address> ttl 255
ip link set he-ipv6 up
ip addr add <client ipv6 address> dev he-ipv6
ip route add ::/0 dev he-ipv6
ip -f inet6 addr

Test Connectivity from UDM

ping 2600::

Setup Address Allocation

TODO

@RoxyBoxxy
Copy link

Does anybody have any wired issues using this?, everytime i use it some websites load and some just dont connect like if i enable this and put ipv6 on my pc tunnelbroker.com will not load but some websites do get a ipv6 connection, i have tried lowering the ttl and mtu but still same issue, doing a ping -6 google.com loses some packets also

@telnetdoogie
Copy link

telnetdoogie commented Jun 5, 2023

Does anybody have any wired issues using this?

You doing any load balancing?

To narrow things down I'd start with the ping packet loss... are you perhaps having an issue with connectivity to tunnelbroker?
ipv6 aside for now, do you have any packet loss on ipv4?

Try PacketLossTest.com - I usually run the "1080P Game Stream" approximation to really exercise things.

You could also test and look for [ipv4] packet loss between your router and the HE <server ipv4 address> in your config.

@RoxyBoxxy
Copy link

RoxyBoxxy commented Jun 5, 2023

Does anybody have any wired issues using this?

You doing any load balancing?

To narrow things down I'd start with the ping packet loss... are you perhaps having an issue with connectivity to tunnelbroker? ipv6 aside for now, do you have any packet loss on ipv4?

Try PacketLossTest.com - I usually run the "1080P Game Stream" approximation to really exercise things.

I dont do any load balancing this is my ping from my udm, i have 0% packet loss on ipv4

PING google.com(lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e)) 56 data bytes
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=1 ttl=120 time=14.4 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=2 ttl=120 time=14.5 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=3 ttl=120 time=58.2 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=4 ttl=120 time=14.4 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=5 ttl=120 time=14.7 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=6 ttl=120 time=14.4 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=7 ttl=120 time=14.2 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=8 ttl=120 time=14.3 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=9 ttl=120 time=14.3 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=10 ttl=120 time=14.3 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=12 ttl=120 time=14.3 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=13 ttl=120 time=14.6 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=14 ttl=120 time=58.7 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=15 ttl=120 time=14.6 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=16 ttl=120 time=14.4 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=17 ttl=120 time=88.2 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=18 ttl=120 time=14.6 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=19 ttl=120 time=14.0 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=20 ttl=120 time=14.4 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=21 ttl=120 time=14.5 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=22 ttl=120 time=14.3 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=23 ttl=120 time=13.9 ms
64 bytes from lhr25s33-in-x0e.1e100.net (2a00:1450:4009:81f::200e): icmp_seq=24 ttl=120 time=15.0 ms
^C
--- google.com ping statistics ---
24 packets transmitted, 23 received, 4.16667% packet loss, time 23035ms
rtt min/avg/max/mdev = 13.914/21.442/88.213/18.864 ms

@telnetdoogie
Copy link

@RoxyBoxxy which tunnel server are you currently using?

@RoxyBoxxy
Copy link

UK London 216.66.88.98

@RoxyBoxxy
Copy link

RoxyBoxxy commented Jun 6, 2023

Okay so i found a fix, this is what i did

Set the he-ipv6 mtu to 1422

ip link set mtu 1422 dev he-ipv6

Delete the route to br0

ip route del <HE IPv6 client address>/64 dev br0

Then re added it using this

ip route add <HE IPv6 client address>/64 dev br0 mtu 1280

http://test-ipv6.com/index.html.en_US gives me 10/10

for some reason the udm set a route with a metric of 256 but the default for the default is 1024 so large packets failed

This is before

<HE IPv6 client address>/64 dev br0 proto kernel metric 256 pref medium
default dev he-ipv6 metric 1024 mtu 1422 pref medium

@telnetdoogie
Copy link

Glad you got that figured out and thanks for sharing!! Are you using pppoe for your WAN?

@RoxyBoxxy
Copy link

Yes i am using ppp0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment