Tutorial for setting up local IPv6 for Relay server
In some relay servers, IPv6 may not be provided, and you can create a local IPv6 using this method in your tunnels.
Relay server
To create local IPv6, you need to first install the iproute2 service on relay server with the following command.
After installing the above service, create the tunnel.yaml
file in the netplan
folder with nano
editor.
Then copy the following code in the file.
network:
version: 2
tunnels:
tunnel98:
mode: sit
local: IPv4-RELAY
remote: IPv4-MAIN
addresses:
- 2001:db9:900::1/64
-
Instead of
IPv4-RELAY
put your relay server IP and instead ofIPv4-MAIN
put your main server IP. -
After making the changes, save the file by pressing the
Ctrl+s
button and exit the editor by pressing theCtrl+x
button. -
At the end, apply the changes made in
netplan
with the following command.
Main server
To create local IPv6 on the main server, you need to install the iproute2
service.
After installing the above service, create the tunnel.yaml
file in the netplan
folder with nano
editor.
Then copy the following code into the file.
network:
version: 2
tunnels:
tunnel98:
mode: sit
local: IPv4-MAIN
remote: IPv4-RELAY
addresses:
- 2001:db9:900::2/64
- Put the relay server IP instead of
IPv4-RELAY
and put your main server IP instead ofIPv4-MAIN
. - After making changes, save the file by pressing the
Ctrl+s
button and exit the editor by pressing the `Ctrl+x' button. - At the end, apply the changes made in netplan with the following command.
- The work is finished.
In this method, local IPv6s are as follows.
Your relay server:
Your main server:
Connection test
To test the connection, just ping the IPv6 local relay server from your main server:
Tip!
Please note that if the firewall is on on any of the servers, it is not possible to test through ping and it is necessary to turn off the firewall temporarily. Firewall setup
How to use
You can use Dokodemo-Door
or use GOST
on your relay server and instead of IP or domain, use the local IPv6 that you created for the main server.
Example Dokodemo-Door
:
{
"inbounds": [
{
"listen": "127.0.0.1",
"port": 62789,
"protocol": "dokodemo-Door",
"settings": {
"address": "127.0.0.1"
},
"tag": "api"
},
{
"listen": null,
"port": 443,
"protocol": "dokodemo-Door",
"settings": {
"address": "2001:db9:900::2",
"followRedirect": false,
"network": "tcp,udp",
"port": 443
},
"tag": "inbound-IPv6-local"
}
],
"outbounds": [
{
"protocol": "freedom"
},
{
"protocol": "blackhole",
"tag": "blocked"
}
]
}
If you pay attention, in the example above, the local IPv6 value created for the main server is placed in the address
field, and 443 is entered in the port
field, which you can change the port
to the tunneled port.
To learn how to add a relay server (domain) to HiddifyManager, read this article do it