现在一直使用局域网Centos7 + ss server + 科学上网V屁嗯(路子野), 然后ss客户端连接的方式上网, 速度挺稳定, 基本能达到5-8m/s, 看Youtube 4k没什么问题.

实现方式

Centos7安装某V屁嗯, 当然其他收费的也可以

image-20200731110629518

安装ss-server

cd /etc/yum.repos.d/
curl -O https://copr.fedorainfracloud.org/coprs/librehat/shadowsocks/repo/epel-7/librehat-shadowsocks-epel-7.repo
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y shadowsocks-libev

vim /etc/shadowsocks-libev/config.json

systemctl start shadowsocks-server.service
#or systemctl start shadowsocks-libev
systemctl enable shadowsocks-server.service
#or systemctl enable shadowsocks-libev

firewall-cmd --permanent --add-port=8388/tcp
firewall-cmd --permanent --add-port=8388/udp
firewall-cmd --reload

本机安装客户端(略过)

centos7开机自动启动并检测ip变化重启ss-server

cd ~
vim check_ip.sh
#!/bin/sh

ipaddrnew=`curl -s ifconfig.me`
ipaddrold=`cat /root/ip-addr`

if [ "$ipaddrold" != "$ipaddrnew" ]
then
        echo "IP地址变更"
        echo $ipaddrnew  > /root/ip-addr
        echo "["$(date +"%Y-%m-%d %H:%M:%S")"][通知] IP地址变更: "$ipaddrnew | curl -s "http://(服务器通知服务)?text=通知文字&server="
        systemctl restart shadowsocks-libev
        systemctl status shadowsocks-libev
else
        echo "["$(date +"%Y-%m-%d %H:%M:%S")"] IP地址正常"
fi
chmod +x check.sh

定时任务里添加任务, 每n分钟检测一次

crontab -e
# 加入
*/1 * * * * /root/check_ip.sh >> /root/check_ip.log

# 重新加载
systemctl reload crond

还有别忘了自动登录centos

vim /etc/gdm/custom.conf

# [daemon]下面添加

AutomaticLogin=root
AutomaticLoginEnable=True