Configure IPv6 networking for Lavalink across different hosting providers
IPv6 provides a massive address space that’s perfect for IP rotation strategies in Lavalink. Most modern hosting providers offer IPv6 blocks (typically /64 or larger) for free with VPS plans, giving you access to billions of IP addresses for rate limit avoidance.
Under PUBLIC NETWORK → PRIMARY IP, find your IPv6 address
Expected format: 2a01:4f9:xxxx:xxxx::/64
2
Enable Nonlocal Bind
# Enable nonlocal bindingsysctl -w net.ipv6.ip_nonlocal_bind=1# Make it persistent across rebootsecho 'net.ipv6.ip_nonlocal_bind=1' >> /etc/sysctl.conf
3
Configure Routing
Replace 2a01:4f9:xxxx:xxxx::/64 with your actual IPv6 block:
ip -6 route replace local 2a01:4f9:xxxx:xxxx::/64 dev lo
Hetzner setup is complete in just 3 commands! The VPS comes with IPv6 already enabled.
1
Enable IPv6
Contabo includes helpful auto-commands in .bashrc:
# Enable IPv6 (command provided by Contabo)enable_ipv6# Reboot as required by Contabo documentationreboot
2
Find Your IPv6 Address
After reboot:
ip a
Look for output like:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP inet6 2001:db8:1234:5678::1/64 scope global # ← Copy this valid_lft forever preferred_lft forever inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link # ← Ignore this valid_lft forever preferred_lft forever
Copy the address with scope global (not scope link).
3
Enable Nonlocal Bind
# Enable nonlocal bindingsysctl -w net.ipv6.ip_nonlocal_bind=1# Make it persistentecho 'net.ipv6.ip_nonlocal_bind=1' >> /etc/sysctl.conf
4
Configure Routing
Remove the ::1 suffix from your copied address:
# If your address was 2001:db8:1234:5678::1/64# Use 2001:db8:1234:5678::/64 (remove the ::1)ip -6 route replace local 2001:db8:1234:5678::/64 dev lo
Tunnelbroker provides free IPv6 tunnel service, perfect for providers that don’t offer IPv6 or only offer small blocks. You can get a free /48 or /64 block.
Ideal for:
Providers without native IPv6
DigitalOcean users wanting more than 16 addresses
Getting a /48 block for maximum rotation
Some providers (like DigitalOcean) may block Tunnelbroker initially. Contact support to unblock if needed.
Select the Tunnelbroker server with lowest ping to your server
# Test ping to find the best serverping 216.218.142.50
(Optional) Click Assign /48 for a larger block
2
Get Configuration
Go to Example Configurations
Select Linux (netplan 0.103+)
Copy the entire configuration
Example configuration:
network: version: 2 tunnels: he-ipv6: mode: sit remote: 216.218.142.50 local: 195.xxx.xx.xxx addresses: - "2001:470:xxxx:xxx::2/64" routes: - to: default via: "2001:470:xxxx:xxx::1"
3
Configure Netplan
Create netplan configuration:
cd /etc/netplannano 99-he-tunnel.yaml
Paste the configuration from Tunnelbroker.For /64 block:
99-he-tunnel.yaml
network: version: 2 tunnels: he-ipv6: mode: sit remote: 216.218.142.50 local: 195.xxx.xx.xxx addresses: - "2001:470:xxxx:xxx::2/64" routes: - to: default via: "2001:470:xxxx:xxx::1"
For /48 block:
99-he-tunnel.yaml
network: version: 2 tunnels: he-ipv6: mode: sit remote: 216.218.142.50 local: 195.xxx.xx.xxx addresses: - "2001:470:xxxx::2/48" routes: - to: default via: "2001:470:xxxx::1"
4
[Optional] Remove Existing IPv6
If your provider already gives you IPv6 but you want to use Tunnelbroker instead:
nano /etc/netplan/50-cloud-init.yaml
Remove IPv6-related lines:
# Remove these lines:- 2402:xxxx:xxxx::xx/128- 2402:xxxx:xxxx:xxxx::a/56gateway6: 2402:xxxx:xxxx::1# And this route:- scope: link to: 2402:xxxx:xxxx::1 via: ::0
5
Apply Configuration
# Test configuration (safe - will revert if issues)netplan try# Press Enter if no errors appear# Reboot to ensure everything worksreboot
6
Verify Tunnelbroker
# Test basic connectivityping6 google.com# Verify you're using Tunnelbroker IPv6curl -6 https://ifconfig.co# Should return: 2001:470:xxxx:xxx::2 (or 2001:470:xxxx::2 for /48)
7
Configure for Lavalink
# Enable nonlocal bindingsysctl -w net.ipv6.ip_nonlocal_bind=1echo 'net.ipv6.ip_nonlocal_bind=1' >> /etc/sysctl.conf# Configure routing# For /64 block:ip -6 route replace local 2001:470:xxxx:xxx::/64 dev lo# For /48 block:ip -6 route replace local 2001:470:xxxx::/48 dev lo
8
Test Full Range
# For /64:ping6 -I 2001:470:xxxx:xxx:dead::beef google.com# For /48:ping6 -I 2001:470:xxxx:dead::beef google.com
You now have a full /64 or /48 IPv6 block ready for Lavalink Route Planner!
[Unit]Description=IPv6 Route ConfigurationAfter=network.target[Service]Type=oneshotExecStart=/sbin/ip -6 route replace local 2001:xxxx::/64 dev lo[Install]WantedBy=multi-user.target