Euserv IPV6 OVZ小鸡安装wireguard教程

100%可行,因为我2只euserv小鸡都成功了

先期工作:先搞一个wg0.conf的配置,(https://github.com/ViRb3/wgcf ),如果现在注册时显示太多用户了,那么你是得不到warp的配置。

正式步骤:

1、给euserv安装go

echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list && printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable && apt update
apt install wireguard-tools --no-install-recommends
cd /tmp && wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz && tar zvxf go1.13.4.linux-amd64.tar.gz &&  mv go /opt/go1.13.4 &&  ln -s /opt/go1.13.4/bin/go /usr/local/bin/go
go version

2、给euserv安装wireguard-go

apt install make
cd /usr/local/src && wget https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-0.0.20191012.tar.xz && tar xvf wireguard-go-0.0.20191012.tar.xz && cd wireguard-go-0.0.20191012
make
cp wireguard-go /usr/local/bin
wireguard-go --version

3、生成wireguard KEY

wg genkey | tee private key | wg pubkey > publickey

4、编辑 /lib/systemd/system/[email protected],在“Environment=WG_ENDPOINT_RESOLUTION_RETRIES=infinity ”这行的下方,插入一行:

Environment=WG_I_PREFER_BUGGY_USERSPACE_TO_POLISHED_KMOD=1

5、执行:

ln -s /usr/bin/resolvectl /usr/local/bin/resolvconf
ln -sf /lib/systemd/system/systemd-resolved.service /etc/systemd/system/dbus-org.freedesktop.resolve1.service

6、放入先期工作的wg0.conf到/etc/wireguard目录下,需要修改,方法参见https://www.hostloc.com/thread-805047-1-1.html,删AllowedIPs = ::/0,并改endpoint=[2606:4700:d0::a29f:c001]:2408

wg-quick up wg0
wg-quick down wg0
systemctl enable [email protected]
systemctl start [email protected]
wg

8、检验,Ping ipv4网站,如下就成功了。。。(对了,记得把你们IPV4隧道,改NAT64都关了!)

[email protected]:~# ping github.com
PING github.com (140.82.121.3) 56(84) bytes of data.
64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=1 ttl=59 time=22.2 ms
64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=2 ttl=59 time=17.1 ms
64 bytes from lb-140-82-121-3-fra.github.com (140.82.121.3): icmp_seq=3 ttl=59 time=15.0 ms

原文地址:https://www.hostloc.com/thread-805155-1-1.html