1.安装singbox ,并开启ip转发(参考官方文档):
sudo curl -fsSL https://sing-box.app/gpg.key -o /etc/apt/keyrings/sagernet.asc
sudo chmod a+r /etc/apt/keyrings/sagernet.asc
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/sagernet.asc] https://deb.sagernet.org/ * *" | \
sudo tee /etc/apt/sources.list.d/sagernet.list > /dev/null
sudo apt-get update
sudo apt-get install sing-box
sudo sed -i '/net.ipv4.ip_forward/s/^#//;/net.ipv6.conf.all.forwarding/s/^#//' /etc/sysctl.conf && sudo sysctl -p
2.更新
sudo apt update
sudo apt upgrade sing-box
3.放入脚本:
https://github.com/qichiyuhub/EasySingbox/tree/master/Linux
4.手动运行
5.添加定时更新,和重启更新
(crontab -l 2>/dev/null; echo "0 6 * * * /root/debian_tproxy.sh"; echo "@reboot /root/debian_tproxy.sh") | crontab -
检查
crontab -l
删除定时
crontab -l | grep -v "debian_tproxy" | crontab -
查看防火墙规则
nft list ruleset
查看日志
sudo journalctl -u sing-box --output cat -f
后端:
docker run -d --name sing-box-subscribe -p 5000:5000 jwy8645/sing-box-subscribe:amd64
docker run -d --name sing-box-subscribe --network host jwy8645/sing-box-subscribe:amd64