Skip to content

Commit e5cb787

Browse files
manybahttopi314
andauthored
Update docs: added how-to setup IPv6 (#1045)
--------- Co-authored-by: topi314 <[email protected]>
1 parent 8a8ff75 commit e5cb787

File tree

7 files changed

+355
-0
lines changed

7 files changed

+355
-0
lines changed

docs/configuration/ipv6/contabo.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
description: How to configure IPv6 on your Contabo VPS.
3+
---
4+
5+
Setting up IPv6 for Lavalink on Contabo VPS is super easy. The VPS comes with a /64 address to use.
6+
7+
This how-to may depend on your system's OS, but it has already been tested on `Ubuntu` and `Debian`.
8+
9+
First, you need to enable IPv6 on your Contabo VPS. It's very easy, as they have already included auto commands in the .bashrc for you.
10+
Enable IPv6 by using this command: `enable_ipv6`
11+
12+
Then reboot your server once, as stated in the Contabo documentation. `reboot`
13+
14+
To see your IPv6 /64 address, simply type: `ip a`
15+
16+
Expected output:
17+
```
18+
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
19+
link/ether 00:50:56:51:fc:62 brd ff:ff:ff:ff:ff:ff
20+
altname enp0s18
21+
altname ens18
22+
inet xxx.xxx.xxx.xxx/22 brd xxx.xxx.xxx.xxx scope global eth0
23+
valid_lft forever preferred_lft forever
24+
inet6 you-want-to-copy-this-one::1/64 scope global <------- copy this ipv6 /64
25+
valid_lft forever preferred_lft forever
26+
inet6 ignore-this-one/64 scope link
27+
valid_lft forever preferred_lft forever
28+
```
29+
30+
Then we need to enable nonlocal bind: `sysctl -w net.ipv6.ip_nonlocal_bind=1`
31+
32+
And `echo 'net.ipv6.ip_nonlocal_bind=1' >> /etc/sysctl.conf` (So you do not need to adjust sysctl settings again when rebooting the server.)
33+
34+
Then `ip -6 route replace local the-ipv6-you-copied::/64 dev lo` (Don't forget to remove the '1' from the address that you copy from, for example 'you-want-to-copy-this-one::1/64', the '1' after '::'.)
35+
36+
Test your IPv6
37+
```
38+
# Replace 1234:1234:1234:: with your IPv6 address.
39+
ping6 -I 1234:1234:1234:: -c 2 google.com
40+
ping6 -I 1234:1234:1234::1 -c 2 google.com
41+
ping6 -I 1234:1234:1234::2 -c 2 google.com
42+
ping6 -I 1234:1234:1234:dead:beef:1234:1234 -c 2 google.com
43+
```
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
description: How to configure IPv6 on your DigitalOcean VPS.
3+
---
4+
5+
As the IPv6 rotation plan suggests, it is recommended to use a block size larger than /64. However, with DigitalOcean, they only provides you with 16 IPv6 addresses. If you prefer to use an IPv6 /64 or /48 block size for your DigitalOcean VPS, consider this alternative instead. [Using Tunnelbroker to make Lavalink balance its requests over many IPv6 addresses](https://blog.arbjerg.dev/2020/3/tunnelbroker-with-lavalink)
6+
7+
As of now, if you want to use Tunnelbroker with DigitalOcean, you might encounter a block when trying to create a tunnel for your DigitalOcean IP. You may need to contact them to unblock your server.
8+
9+
This how-to may depend on your system's OS, but it has already been tested on `Ubuntu` and `Debian`.
10+
11+
### Create DigitalOcean Droplet with IPv6 enabled.
12+
13+
In `Create Droplets` panel -> `Advanced Options` -> Click `Enable IPv6 (free)`
14+
15+
### Enable IPv6 on existed DigitalOcean Droplet.
16+
17+
Go to your Droplet panel -> Turn off your Droplet -> `Networking` -> `PUBLIC IPV6 ADDRESS` -> `Enable` -> Then turn your Droplet on again.
18+
19+
After you enable IPv6 on the existing Droplet, you need to configure it manually. Please refer to your OS System in this link. [https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/](https://docs.digitalocean.com/products/networking/ipv6/how-to/enable/)
20+
21+
After that, reboot your server once: `reboot`
22+
23+
Test your IPv6 connection: `ping6 google.com` or `ping6 2001:4860:4860::8888`
24+
25+
### [Optional] use all 16 IPv6 Addresses
26+
27+
Please refer to your OS System in this link. [How to Enable Additional IPv6 Addresses](https://docs.digitalocean.com/products/networking/ipv6/how-to/configure-additional-addresses/)
28+
29+
Test your IPv6
30+
```
31+
# Don't forgot to replace IPv6 in the example with your IPv6 address.
32+
ping6 -I 2400:6180:0:d0::fa6:2000 -c 2 google.com
33+
ping6 -I 2400:6180:0:d0::fa6:2001 -c 2 google.com
34+
ping6 -I 2400:6180:0:d0::fa6:2002 -c 2 google.com
35+
ping6 -I 2400:6180:0:d0::fa6:2003 -c 2 google.com
36+
ping6 -I 2400:6180:0:d0::fa6:2004 -c 2 google.com
37+
...
38+
ping6 -I 2400:6180:0:d0::fa6:200f -c 2 google.com
39+
```

docs/configuration/ipv6/hetzner.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
description: How to configure IPv6 on your Hetzner VPS.
3+
---
4+
5+
Setting up IPv6 for Lavalink on a Hetzner VPS is just 3 commands. The VPS comes with a /64 address to use and already has IPv6 enabled for you.
6+
7+
This how-to may depend on your system's OS, but it has already been tested on `Ubuntu` and `Debian`.
8+
9+
Look up your IPv6 /64 address on your hetzner cloud panel.
10+
11+
HETZNER Cloud panel -> Your server -> Networking tab -> PUBLIC NETWORK -> PRIMARY IP.
12+
13+
Expected address should be something like this:
14+
`2a01:4f9:xxxx:xxxx::/64`
15+
16+
First, we need to enable nonlocal bind: `sysctl -w net.ipv6.ip_nonlocal_bind=1`
17+
18+
And `echo 'net.ipv6.ip_nonlocal_bind=1' >> /etc/sysctl.conf` (So you do not need to adjust sysctl settings again when rebooting the server.)
19+
20+
Then `ip -6 route replace local 2a01:4f9:xxxx:xxxx::/64 dev lo` (Replace the `2a01:4f9:xxxx:xxxx::/64` with your IPv6 address from panel.)
21+
22+
Test your IPv6
23+
```
24+
# Replace 1234:1234:1234:: with your IPv6 address.
25+
ping6 -I 1234:1234:1234:: -c 2 google.com
26+
ping6 -I 1234:1234:1234::1 -c 2 google.com
27+
ping6 -I 1234:1234:1234::2 -c 2 google.com
28+
ping6 -I 1234:1234:1234:dead:beef:1234:1234 -c 2 google.com
29+
```

docs/configuration/ipv6/index.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
description: IPv6 related information.
3+
---
4+
5+
Nowadays, most server providers will give you an IPv6 `/64` with a VPS for free. You can easily check by `ping6 google.com` or using `ip a` to check for an IPv6 address.
6+
7+
If your hosting provider stated that they provide IPv6 but your server does not have one, kindly ask them about IPv6 and how to configure it. Sometimes, the server provider might require you to open a ticket for providing IPv6 to your server.
8+
9+
For Lavalink use, most IPv6 rotation plans recommend IPv6 with a block size larger than `/64`, but you can still configure it for use with Lavalink even if it's less than `/64`.
10+
11+
Here are some guides for some popular server providers:
12+
- [Contabo](/docs/configuration/ipv6/contabo.md)
13+
- [DigitalOcean](/docs/configuration/ipv6/digitalocean.md)
14+
- [Hetzner](/docs/configuration/ipv6/hetzner.md)
15+
16+
17+
If your server provider is not listed above, you can use you can check out the general [Debian/Ubuntu](/docs/configuration/ipv6/ubuntudebian.md) guide on how to configure IPv6 on your server.
18+
19+
If your server provider does not provide IPv6 or your IPv6 block size is less than `/64`, you can use [Tunnelbroker](/docs/configuration/ipv6/tunnelbroker.md) instead.
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
---
2+
description: How to configure IPv6 using Tunnelbroker on your VPS.
3+
---
4+
5+
This how-to is for super-newbie and may depend on your system's OS, but it has already been tested on `Ubuntu (22, 23 and 24)` with `netplan`.
6+
7+
### Hello Tunnelbroker!
8+
9+
1. Create an account at [Tunnelbroker](https://tunnelbroker.net)
10+
2. Create a new `Create Regular Tunnel`
11+
3. Enter your server IPv4 and select the Tunnelbroker server with the lowest ping to your server. `ping xxx.xxx.xxx.xxx`
12+
4. (Optional) Get IPv6 /48 block by clicking `assign /48`
13+
5. Go to `Example Configurations`
14+
6. Select `Linux (netplan 0.103+)`
15+
7. Copy the whole config
16+
17+
[WARNING] `xxxx` or `xxx` for example: `2001:470:xxxx:xxx::2/64` is just for censoring real information PLEASE REPLACE IT WITH YOUR IPV6
18+
19+
Example configuration generated from tunnelbroker.net
20+
```yml
21+
network:
22+
version: 2
23+
tunnels:
24+
he-ipv6:
25+
mode: sit
26+
remote: 216.218.142.50
27+
local: 195.xxx.xx.xxx
28+
addresses:
29+
- "2001:470:xxxx:xxx::2/64"
30+
routes:
31+
- to: default
32+
via: "2001:470:xxxx:xxx::1"
33+
```
34+
35+
On your server, go to the netplan folder: `cd /etc/netplan`
36+
37+
Create a new file using your choice of text editor, but in this how-to, we will be using nano.
38+
`nano 99-he-tunnel.yaml`
39+
40+
Then paste the whole configuration into that file.
41+
42+
Example configuration of 99-he-tunnel.yaml with /64
43+
```
44+
network:
45+
version: 2
46+
tunnels:
47+
he-ipv6:
48+
mode: sit
49+
remote: 216.218.142.50
50+
local: 195.xxx.xx.xxx
51+
addresses:
52+
- "2001:470:xxxx:xxx::2/64"
53+
routes:
54+
- to: default
55+
via: "2001:470:xxxx:xxx::1"
56+
```
57+
58+
Example configuration of 99-he-tunnel.yaml with /48
59+
```
60+
network:
61+
version: 2
62+
tunnels:
63+
he-ipv6:
64+
mode: sit
65+
remote: 216.218.142.50
66+
local: 195.xxx.xx.xxx
67+
addresses:
68+
- "2001:470:xxxx::2/48"
69+
routes:
70+
- to: default
71+
via: "2001:470:xxxx::1"
72+
```
73+
74+
### [Optional] You already had IPv6 but still want to use Tunnelbroker.
75+
Most hosting providers will have an OS image that is generated configuration called `50-cloud-init.yaml`.
76+
77+
Start edit that file: `nano 50-cloud-init.yaml`
78+
79+
Example configuration from 50-cloud-init.yaml
80+
```
81+
network:
82+
ethernets:
83+
ens3:
84+
addresses:
85+
- 195.xxx.xx.xxx/23
86+
- 2402:xxxx:xxxx::xx/128
87+
- 2402:xxxx:xxxx:xxxx::a/56
88+
gateway4: 195.xxx.xx.x
89+
gateway6: 2402:xxxx:xxxx::1
90+
match:
91+
macaddress: 00:34:a0:e1:de:5d
92+
nameservers:
93+
addresses:
94+
- 8.8.8.8
95+
- 8.8.4.4
96+
- 2001:4860:4860::8888
97+
- 2001:4860:4860::8844
98+
routes:
99+
- scope: link
100+
to: 195.xxx.xx.x
101+
via: 0.0.0.0
102+
- scope: link
103+
to: 2402:xxxx:xxxx::1
104+
via: ::0
105+
version: 2
106+
```
107+
108+
We will be removing
109+
```
110+
addresses:
111+
- 195.xxx.xx.xxx/23
112+
- 2402:xxxx:xxxx::xx/128 <---
113+
- 2402:xxxx:xxxx:xxxx::a/56 <---
114+
gateway4: 195.xxx.xx.x
115+
gateway6: 2402:xxxx:xxxx::1 <---
116+
```
117+
118+
And
119+
```
120+
- scope: link <---
121+
to: 2402:xxxx:xxxx::1 <---
122+
via: ::0 <---
123+
```
124+
125+
Final configuration
126+
```
127+
network:
128+
ethernets:
129+
ens3:
130+
addresses:
131+
- 195.xxx.xx.xxx/23
132+
gateway4: 195.xxx.xx.x
133+
match:
134+
macaddress: 00:34:a0:e1:de:5d
135+
nameservers:
136+
addresses:
137+
- 8.8.8.8
138+
- 8.8.4.4
139+
- 2001:4860:4860::8888
140+
- 2001:4860:4860::8844
141+
routes:
142+
- scope: link
143+
to: 195.xxx.xx.x
144+
via: 0.0.0.0
145+
version: 2
146+
```
147+
148+
### Applying netplan and checking your IPv6
149+
150+
Let try our new configuration: `netplan try`
151+
152+
Ignore the warning and if there is no error then just press enter to accept new configuration.
153+
154+
Reboot server one time: `reboot`
155+
156+
Try your IPv6 from Tunnelbroker: `ping6 google.com`
157+
Try curl to make sure that it is Tunnelbroker IPv6: `curl -6 https://ifconfig.co`
158+
And it should return `2001:470:xxxx:xxx::2` or `2001:470:xxxx::2` if you are using /48
159+
160+
Next, we're going to configure IPv6 for Lavalink.
161+
Enable non local binding
162+
`sysctl -w net.ipv6.ip_nonlocal_bind=1`
163+
And so the next time you don't need to type it again
164+
`echo 'net.ipv6.ip_nonlocal_bind = 1' >> /etc/sysctl.conf`
165+
166+
Now, we replace this command with our IPv6 from Tunnelbroker.
167+
`ip -6 route replace local 2001:470:xxxx:xxx::/64 dev lo`
168+
or if you are using /48
169+
`ip -6 route replace local 2001:470:xxxx::/48 dev lo`
170+
171+
Now test your new configuration
172+
```cmd
173+
ping6 -I 2001:470:xxxx:xxx:dead::beef google.com
174+
```
175+
or if you are using /48
176+
```cmd
177+
ping6 -I 2001:470:xxxx:dead::beef google.com
178+
```
179+
180+
Now you can use your new IPv6 `2001:470:xxxx:xxx::/64` or `2001:470:xxxx::/48` to put in your Lavalink configuration.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
description: How to configure IPv6 on your Ubuntu/Debian VPS.
3+
---
4+
5+
Setting up IPv6 for Lavalink on a Ubuntu/Debian VPS can be challenging depending on how your provider sets up the OS system for you, but most of the time, it is pretty easy.
6+
7+
Mostly, the provider will already set up IPv6 for you. You can find the IPv6 address by using the `ip a` command.
8+
9+
Expected output:
10+
```
11+
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
12+
link/ether 00:50:56:51:fc:62 brd ff:ff:ff:ff:ff:ff
13+
altname enp0s18
14+
altname ens18
15+
inet xxx.xxx.xxx.xxx/22 brd xxx.xxx.xxx.xxx scope global eth0
16+
valid_lft forever preferred_lft forever
17+
inet6 you-want-to-copy-this-one::1/64 scope global <------- this is your ipv6 /64
18+
valid_lft forever preferred_lft forever
19+
inet6 ignore-this-one/64 scope link
20+
valid_lft forever preferred_lft forever
21+
```
22+
23+
If not, kindly ask your provider about providing an IPv6 address for your server and how to configure it.
24+
25+
First, we need to enable nonlocal bind: `sysctl -w net.ipv6.ip_nonlocal_bind=1`
26+
27+
And `echo 'net.ipv6.ip_nonlocal_bind=1' >> /etc/sysctl.conf` (So you do not need to adjust sysctl settings again when rebooting the server.)
28+
29+
Then `ip -6 route replace local 2a01:4f9:xxxx:xxxx::/64 dev lo` (Replace the `2a01:4f9:xxxx:xxxx::/64` with your IPv6 address from `ip a` command.) (Don't forget to remove the '1' from the address that you copy from, for example 'you-want-to-copy-this-one::1/64', the '1' after '::'.)
30+
31+
Test your IPv6
32+
```
33+
# Replace 1234:1234:1234:: with your IPv6 address.
34+
ping6 -I 1234:1234:1234:: -c 2 google.com
35+
ping6 -I 1234:1234:1234::1 -c 2 google.com
36+
ping6 -I 1234:1234:1234::2 -c 2 google.com
37+
ping6 -I 1234:1234:1234:dead:beef:1234:1234 -c 2 google.com
38+
```

docs/mkdocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ nav:
2525
- Systemd: configuration/systemd.md
2626
- Docker: configuration/docker.md
2727
- RoutePlanner: configuration/routeplanner.md
28+
- IPv6:
29+
- configuration/ipv6/index.md
30+
- Tunnelbroker: configuration/ipv6/tunnelbroker.md
31+
- Ubuntu/Debian: configuration/ipv6/ubuntudebian.md
32+
- Hetzner: configuration/ipv6/hetzner.md
33+
- Contabo: configuration/ipv6/contabo.md
34+
- DigitalOcean: configuration/ipv6/digitalocean.md
2835
- Clients: clients.md
2936
- Plugins: plugins.md
3037
- API:

0 commit comments

Comments
 (0)