Skip to main content
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.

Why Use IPv6?

Massive Address Space

A /64 block provides 2^64 (18 quintillion) addresses

Free with Most VPS

Most providers include IPv6 at no extra cost

Better Rate Limiting

Rotate through billions of IPs to avoid bans

Future-Proof

IPv6 is the future of internet networking

Quick Check

Verify if your server already has IPv6 configured:
# Test IPv6 connectivity
ping6 google.com

# Or use numeric address
ping6 2001:4860:4860::8888

# Check for IPv6 addresses
ip a
Look for addresses starting with 2 or fd in the output. If you see an IPv6 address with /64 or larger, you’re ready to configure Lavalink!
For Lavalink Route Planner, IPv6 blocks with /64 or larger are recommended. However, you can still use smaller blocks.
Block SizeNumber of AddressesBest StrategyUse Case
/482^80RotatingNanoSwitchProduction (recommended)
/562^72RotatingNanoSwitchHigh-traffic servers
/642^64NanoSwitch or RotatingNanoSwitchStandard deployment
Less than /64VariesRotateOnBanLimited blocks

Provider-Specific Guides

1

Get Your IPv6 Block

  1. Log into Hetzner Cloud panel
  2. Go to your server
  3. Click Networking tab
  4. Under PUBLIC NETWORKPRIMARY IP, find your IPv6 address
Expected format: 2a01:4f9:xxxx:xxxx::/64
2

Enable Nonlocal Bind

# Enable nonlocal binding
sysctl -w net.ipv6.ip_nonlocal_bind=1

# Make it persistent across reboots
echo '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
4

Test Configuration

# Replace with your IPv6 prefix
ping6 -I 2a01:4f9:xxxx:xxxx:: -c 2 google.com
ping6 -I 2a01:4f9:xxxx:xxxx::1 -c 2 google.com
ping6 -I 2a01:4f9:xxxx:xxxx::2 -c 2 google.com
ping6 -I 2a01:4f9:xxxx:xxxx:dead:beef:1234:1234 -c 2 google.com
All tests should succeed!
Hetzner setup is complete in just 3 commands! The VPS comes with IPv6 already enabled.

Tunnelbroker Setup

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.
1

Create Tunnel

  1. Create account at Tunnelbroker.net
  2. Click Create Regular Tunnel
  3. Enter your server’s IPv4 address
  4. Select the Tunnelbroker server with lowest ping to your server
    # Test ping to find the best server
    ping 216.218.142.50
    
  5. (Optional) Click Assign /48 for a larger block
2

Get Configuration

  1. Go to Example Configurations
  2. Select Linux (netplan 0.103+)
  3. 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/netplan
nano 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/56
gateway6: 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 works
reboot
6

Verify Tunnelbroker

# Test basic connectivity
ping6 google.com

# Verify you're using Tunnelbroker IPv6
curl -6 https://ifconfig.co
# Should return: 2001:470:xxxx:xxx::2 (or 2001:470:xxxx::2 for /48)
7

Configure for Lavalink

# Enable nonlocal binding
sysctl -w net.ipv6.ip_nonlocal_bind=1
echo '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!
Once IPv6 is set up on your server, configure Lavalink to use it:
application.yml
lavalink:
  server:
    ratelimit:
      ipBlocks:
        - "2001:470:xxxx::/48"  # Your IPv6 block
      strategy: "RotatingNanoSwitch"
      searchTriggersFail: true
      retryLimit: -1
See the Route Planner documentation for detailed strategy information.

Troubleshooting

  1. Verify your provider offers IPv6:
    • Check your hosting panel
    • Contact support to enable IPv6
  2. Some providers require manual activation
  3. Consider using Tunnelbroker if IPv6 isn’t available
Check:
# Verify IPv6 module is loaded
lsmod | grep ipv6

# Check IPv6 addresses
ip -6 addr show

# Check IPv6 routes
ip -6 route show

# Test with numeric address
ping6 2001:4860:4860::8888
Ensure nonlocal bind is enabled:
# Check current setting
sysctl net.ipv6.ip_nonlocal_bind

# Should return: net.ipv6.ip_nonlocal_bind = 1

# If not, enable it:
sysctl -w net.ipv6.ip_nonlocal_bind=1
echo 'net.ipv6.ip_nonlocal_bind=1' >> /etc/sysctl.conf
Verify the route is configured:
# Check routes
ip -6 route show

# Should see: local 2001:xxxx::/64 dev lo ...

# Re-add if missing:
ip -6 route replace local 2001:xxxx::/64 dev lo
  1. Verify netplan configuration:
    netplan get
    
  2. Check tunnel status:
    ip tunnel show
    
  3. Test remote endpoint:
    ping 216.218.142.50  # Or your endpoint
    
  4. Check for firewall blocking protocol 41 (IPv6-in-IPv4)
  5. Contact provider - they may block Tunnelbroker
Make settings persistent:
  1. Nonlocal bind:
    echo 'net.ipv6.ip_nonlocal_bind=1' >> /etc/sysctl.conf
    
  2. Route configuration - Create a systemd service:
    nano /etc/systemd/system/ipv6-route.service
    
    Add:
    [Unit]
    Description=IPv6 Route Configuration
    After=network.target
    
    [Service]
    Type=oneshot
    ExecStart=/sbin/ip -6 route replace local 2001:xxxx::/64 dev lo
    
    [Install]
    WantedBy=multi-user.target
    
    Enable:
    systemctl enable ipv6-route.service
    systemctl start ipv6-route.service
    

Block Size Reference

Understanding CIDR notation:
CIDRNumber of AddressesNumber of /64 BlocksRecommended For
/12810Single address
/6418,446,744,073,709,551,6161Standard deployment
/564,722,366,482,869,645,213,696256High-traffic
/481,208,925,819,614,629,174,706,17665,536Production (best)
Even a single /64 block gives you more addresses than you’ll ever need. A /48 is recommended for maximum flexibility with RotatingNanoSwitch strategy.

Next Steps

After setting up IPv6:
1

Configure Route Planner

Set up Route Planner in your Lavalink configuration
2

Choose Strategy

Select the best IP rotation strategy for your block size
3

Test Thoroughly

Verify IP rotation is working correctly
4

Monitor

Watch for rate limits and adjust configuration as needed

Additional Resources

Route Planner

Configure IP rotation strategies

application.yml

Complete configuration reference

Tunnelbroker

Free IPv6 tunnel service

CIDR Calculator

Calculate IPv6 block sizes

Build docs developers (and LLMs) love