GOST流量中转
场景:落地鸡与客户端延迟过高,需要中转鸡进行流量转发。
准备:搭建好代理的落地鸡,中转鸡,客户端。
1.安装gost
安装:
wget https://github.com/ginuerzh/gost/releases/download/v2.11.5/gost-linux-amd64-2.11.5.gz解压并配置
# 解压
gzip -d gost-linux-amd64-2.11.5.gz
# 改名并赋予执行权限
mv gost-linux-amd64-2.11.5 gost
chmod +x gost
# 移动到系统目录方便直接调用
mv gost /usr/bin/2.设置systemd管理
目的:设置开机自启、后台运行。
编辑配置文件:vi /etc/systemd/system/gost.service
[Unit]
Description=Gost Proxy Forwarder
After=network.target
[Service]
Type=simple
User=root
# 示例:ExecStart=/usr/bin/gost -L tcp://:2443/103.214.168.50:1443 -L udp://:2443/103.214.168.50:1443
ExecStart=/usr/bin/gost -L tcp://:中转端口/落地鸡IP:落地鸡端口 -L udp://:中转端口/落地鸡IP:落地鸡端口
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetsystemctl daemon-reload
systemctl enable gost
systemctl start gost