Hurricane Electric provides an IPv6 tunnel broker via 6in4 for those who don’t have IPv6, but the problem is, 6in4 aka protocol 41 SIT (Simple Internet Transition) does not work behind NAT (or worse CGNAT) so we need to rent a VPS that allows us to get Hurricane Electric IPv6 connectivity and tunnel it though WireGuard that we can pass though NAT.
Get VPS
Get a VPS that is nearest to Hurricane Electric PoP that is nearest to you. In this example, I live in the Philippines, and my nearest Hurricane Electric PoP is Singapore, so I will rent a VPS on Singapore.
VPS should have Ubuntu 22.04 and up with Netplan installed. (Netplan should come preinstalled.)
Setup Hurricane Electric IPv6 tunnel
- Login to tunnelbroker.net.
- Click Create Regular Tunnel under User Functions.
- Set IPv4 Endpoint to your VPS’s IPv4 address.
- Select the location that is nearest to your VPS. In this example, I will select Singapore.
- Click Create Tunnel.
- On Routed /48, click Assign /48. We need
/48
for WireGuard. - Take note of your
/48
prefix, for this example, it is2001:470:eddc::/48
Get Netplan configuration
- Click Example Configurations.
- On Select Your OS dropbox, select Linux (netplan 0.103+).
The Netplan configuration will show like this:
|
|
Setup VPS
Install Netplan configuration on VPS
- Create new Netplan configuration
sudo nano /etc/netplan/he.yaml
- Paste the configuration file from Hurricane Electric, and save and exit by pressing Ctrl + X.
- Apply Netplan configuration.
sudo netplan apply
Setup WireGuard
- Install WireGuard.
sudo apt update && sudo apt install wireguard
- Generate private key.
wg genkey | sudo tee /etc/wireguard/private.key
- Generate public key.
sudo cat /etc/wireguard/private.key | wg pubkey | sudo tee /etc/wireguard/public.key
- Create WireGuard configuration.
sudo nano /etc/wireguard/wg0.conf
Paste this WireGuard configuration and edit.
|
|
- Enable WireGuard server.
sudo systemctl enable wg-quick@wg0.service
- Start WireGuard server.
sudo systemctl start wg-quick@wg0.service
- Check if WireGuard server is running.
sudo systemctl status wg-quick@wg0.service
Setup client
Get IPv6 prefix
Hurricane Electric gives us /48
subnet, which we can divide into 65,536 /64
subnets. Since we got 2001:470:eddc::/48
, I chosen the prefix 2001:470:eddc:4::/64
.
Setup WireGuard
- Install WireGuard on your client.
- Generate private and public key.
- Create WireGuard configuration.
Paste this WireGuard configuration and edit.
|
|