Open zzlinwq opened 1 year ago
流量少一点(1.5倍流量)适合网络较好的脚本
用法: wget https://github.com/lmc999/WireguardForGame/files/9996797/wg-for-game.zip unzip wg-for-game.zip chmod +x wg-for-game.sh ./wg-for-game.sh
yum install -y wget && wget https://raw.githubusercontent.com/lmc999/WireguardForGame/master/wg-for-game.sh && chmod +x wg-for-game.sh && ./wg-for-game.sh
chmod 600 /etc/wireguard/wg0.conf
修改/etc/wireguard/wg0.conf mtu为1200比较稳定。
启动wg0 wg-quick up wg0
wg-quick down wg0
winpcap,Tunsafe软件包下载链接 [Uploading 20221109.zip…]()
服务端配置例子: [Interface] PrivateKey = 8Dp1EzZb1wQ/ZLvc3tLGFgTt15Reh7cXMJYYRVtSqlE= Address = 10.100.0.1/24 PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -D FORWARD -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE ListenPort = 1195 DNS = 8.8.8.8 MTU = 1200 [Peer] PublicKey = rkMAQ3Il7DtA0ueJbUIMgjfowcsP4l+bE81TJPXASkU= AllowedIPs = 10.100.0.2/32
[Peer] PublicKey = 3DH7o/QlTMzr2n0ljkg+hgQzG69tBXL6j4VN+SE2eTM= AllowedIPs = 10.100.0.3/32
客户端配置 [Interface] PrivateKey = wInyYiytSq8DOsalJ+HYfEKccSby8h+QVbcLDI08BEQ= Address = 10.100.0.2/24 PreUp = start D:\software\TunSafe\bat\start.bat PreUp = ping -n 4 127.1 >nul PostUp = start D:\software\TunSafe\bat\routes-up.bat PostDown = start D:\software\TunSafe\bat\routes-down.bat PostDown = start D:\software\TunSafe\bat\stop.bat DNS = 8.8.8.8 MTU = 1200 [Peer] PublicKey = DqWnFFxDJHnZTkoMJioTBxD6YG9ZBgtm6+/6tsp4tHU= Endpoint = 127.0.0.1:2099 AllowedIPs = 0.0.0.0/0, ::0/0 PersistentKeepalive = 25
[21:49:26] Retrying handshake, attempt 2...
[21:49:32] Retrying handshake, attempt 3...
[21:49:38] Retrying handshake, attempt 4...
[21:49:43] Retrying handshake, attempt 5...
[21:49:48] Retrying handshake, attempt 6...
[21:49:53] Retrying handshake, attempt 7...
[21:49:59] Retrying handshake, attempt 8...
[21:50:05] Retrying handshake, attempt 9...
[21:50:10] Retrying handshake, attempt 10...
[21:50:15] Retrying handshake, attempt 11...
[21:50:21] Retrying handshake, attempt 12...
wireguard握手就不成功。。。估计被屏蔽的太厉害把,但愿是我设置不对。
流量少一点(1.5倍流量)适合网络较好的脚本