Alvis 发表于 2024-10-2 02:51:03

1分钟快速手搓Realm

本帖最后由 Alvis 于 2024-10-2 02:53 编辑

本贴仅讨论Realm转发,不要歪楼讨论代理相关内容!!遵守国家法律法规
1️⃣ 下载运行文件(自行去下面代码网址替换适合自己机器架构的版本):
wget -O realm.tar.gz https://github.com/zhboner/realm/releases/download/v2.4.6/realm-x86_64-unknown-linux-gnu.tar.gz && tar -xvf realm.tar.gz && chmod +x
Github被屏蔽的试试下面这个:

-O realm.tar.gz https://mirror.ghproxy.com/https://github.com/zhboner/realm/releases/download/v2.4.6/realm-x86_64-unknown-linux-gnu.tar.gz && tar -xvf realm.tar.gz && chmod +x
2️⃣ 去/root文件夹下新建config.toml文件,并写入(具体远程IP和端口,本机端口自己改):

[]
listen = "0.0.0.0:5000"
remote = "8.8.8.8:443"

[]
listen = "0.0.0.0:6000"
remote = ":443"
3️⃣ 去/etc/systemd/system文件夹下新建realm.service文件,并写入:


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


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


WantedBy=multi-user.target

4️⃣ 启动服务:

systemctl daemon-reload
systemctl enable realm
systemctl restart realm
systemctl status realm


更新:改了个一句话命令
cd /tmp; \
wget -O realm.tar.gz https://github.com/zhboner/realm/releases/download/v2.4.6/realm-x86_64-unknown-linux-gnu.tar.gz; \
tar -xvf realm.tar.gz; \
chmod +x realm; \
cat > /root/config.toml <<EOF
[]
listen = "0.0.0.0:5000"
remote = "8.8.8.8:443"

[]
listen = "0.0.0.0:6000"
remote = ":443"
EOF
cat /etc/systemd/system/realm.service <<EOF

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


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


WantedBy=multi-user.target
EOF
systemctl daemon-reload; \
systemctl enable realm; \
systemctl restart realm; \
systemctl status realm

Godtokoo 发表于 2024-10-2 12:48:55

我以为你教手搓这个程序,结果就是配置

nyarime 发表于 2024-10-3 01:17:02

Godtokoo 发表于 2024-10-2 12:48
我以为你教手搓这个程序,结果就是配置

除非是开发隧道,明文转发不如iptables

Alvis 发表于 2024-10-3 01:56:35

Godtokoo 发表于 2024-10-2 12:48
我以为你教手搓这个程序,结果就是配置

怎么搓,要不你来一个
页: [1]
查看完整版本: 1分钟快速手搓Realm