Configure Realm relay on the IPv6 VPS

Preface

I have a Hong Kong VPS with a direct connection to the China Mobile network. However, since my current network environment does not support China Mobile, I want to use a Guangxi Mobile IPv6 VPS, set up with WAP, as a relay node to connect to the Hong Kong VPS.

Install Realm

Since the IPv6 network cannot connect directly to GitHub, the files are downloaded locally and then uploaded to the VPS via SFTP.

Download

https://github.com/zhboner/realm/releases

Configure Realm

Assuming Realm has been uploaded to the VPS and is located in the /root directory

Grant executable (755) permissions to the Realm directory under /root.

1chmod +x realm

Create the Realm configuration file

1nano /root/realm.toml
1[network]
2no_tcp = false
3use_udp = true
4
5[[endpoints]]
6listen = "0.0.0.0:listening port"
7remote = "Hong Kong VPS IPv6 address:Destination Port"

Create a systemd service unit

1nano /etc/systemd/system/realm.service
 1[Unit]
 2Description=realm
 3After=network-online.target
 4Wants=network-online.target systemd-networkd-wait-online.service
 5
 6[Service]
 7Type=simple
 8User=root
 9Restart=on-failure
10RestartSec=5s
11DynamicUser=true
12ExecStart=/root/realm -c /root/realm.toml  #The directory for Realm and its configuration
13[Install]
14WantedBy=multi-user.target

Start the Realm service

1systemctl daemon-reload
2systemctl enable realm && systemctl start realm

This completes the configuration of the Realm relay service on the IPv6 VPS.

Built with Hugo
Theme Stack designed by Jimmy