Realm端口转发工具安装教程

Realm 是Rust语言开发的流量转发工具,Realm 比 Gost占用资源更小。

支持多组服务器转发,同时也支持tcp和udp,还有域名解析便捷。

1、下载最新的可执行文件到本地:

Github 以最新版本为主,根据自己的系统版本下载即可,

比如我的是64位Debian系统,则需下载 realm-x86_64-unknown-linux-gnu.tar.gz

下载好后在本地电脑上解压,得到 realm 无后缀名的可执行程序,使用FinalShell等ssh工具传输到远程VPS的 /root 目录

2、赋予程序可执行权限:

使用ssh工具连接到VPS后,赋予 /root 目录下的 realm 可执行755权限

chmod +x realm

3、创建realm配置文件:

realm 最新版的配置文件为 toml 结尾的文本文件,使用nano命令创建:

nano /root/realm.toml

具体的配置文件规则很简单,只需要在 listen 里填入vps上的带转发端口号,remote 中填入目的地的vps的ip和端口号即可:

[network]
no_tcp = false
use_udp = true

[[endpoints]]
listen = "0.0.0.0:23456"
remote = "test.cloudflare.com:23456"

[[endpoints]]
listen = "0.0.0.0:54321"
remote = "1.1.1.1:443"

配置文件支持各种协议,以及域名解析等操作,更多规则可以查看项目Github主页

4、创建自启动服务项:

因为手动每次运行很麻烦,我们需要创建Linux的服务项来实现自启动转发通道。

下面以最新的 Debian 11 来举例创建service服务项,首先使用nano编辑服务项内容:

nano /etc/systemd/system/realm.service

如果你的 realm 主程序和配置文件都和我一样在 /root 目录里的话直接使用下面的内容即可

[Unit]
Description=realm
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service

[Service]
Type=simple
User=root
Restart=on-failure
RestartSec=5s
DynamicUser=true
ExecStart=/root/realm -c /root/realm.toml

[Install]
WantedBy=multi-user.target

然后使用ctrl+o保存文件,再使用ctrl+x退出编辑器,service文件就生成了。

5、开启服务配置自启:

ssh路径回到 /root 后,即可执行重载系统服务和启动realm服务:

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

如需禁用realm自启并停止realm的运行进程执行下面的命令:

systemctl stop realm && systemctl disable realm

如果你的落地服务器使用的是动态IP,或者DDNS服务,可以在 crontab 计划任务里来设置定时重启realm服务:

cronteb -e

#填写内容为时间和重启的服务名称:

00 01 * * * systemctl restart realm
00 05 * * * systemctl restart realm
00 09 * * * systemctl restart realm
00 13 * * * systemctl restart realm
00 17 * * * systemctl restart realm
00 21 * * * systemctl restart realm

6、查看realm日志log

cat /var/log/realm.log

免责声明:

本站提供的一切软件、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。

本站信息来自网络收集整理,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容。

如果您喜欢该程序和内容,请支持正版,购买注册,得到更好的正版服务。我们非常重视版权问题,如有侵权请邮件与我们联系处理。敬请谅解!

发表评论:

抱歉,检测到您未登录,需要评论,请先

评论:

Juliusfiz
1个月前 (01-20)
Buy Casino GramBit script

GramBit implements a casino script.
Our development team help you run his online casino.
Our games written on HTML5 and work on all platforms, on smartphones, and on PCs!
Our CMS  can be run as an online casino as well as a club casino.
Our casino has over 2,500 games!
We do not restrict casinos by ip and Domains.
Adding any payment systems.
Our web developers develop unique casino design.
We'll help you pick up and set up the server, casino script, payment systems, and API.
After you purchase the casino, you get our aid, and upgrades.
If you still have questions, our support team is available 24/7 to answer them.
С уважением, ваш GramBit.

Contacts:
Telegram: https://t.me/grambitmaster
mail: support@grambit.pro

P.S.: It is possible to sell the source code.
TimothycoaGe
1个月前 (01-08)
Hello. . <a href=https://servis-grant.ru/>fuck off xxx porno video </a>
<a href=https://servis-grant.ru/>fuck off xxx porno video</a>
<a href=https://servis-grant.ru/>шлюхи , бляди</a>
<a href=https://servis-grant.ru/>шлюхи, ебаные бляди</a>
zwz4967494
DonremNow
4个月前 (10-26)
Hello. . <a href=https://don-rem.ru>don-rem.ru</a>
<a href=https://don-rem.ru/>https://don-rem.ru</a>
https://don-rem.ru  zwz4967494