wireguard等依赖Debian
apt update -y && apt install wireguard sudo curl vim openresolv -yArch Linux
yay -S wireguard-tools openresolv wgcf vim dnsutils linux-headers --neededDebian
curl -fsSL git.io/wgcf.sh | sudo bashwgcf registerwgcf generatevim wgcf-profile.conf[Interface]
PrivateKey = 这里会自动生成
Address = 172.16.0.2/32
Address = 这里会自动生成
DNS = 8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844
MTU = 1280
[Peer]
PublicKey = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=
AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
Endpoint = engage.cloudflareclient.com:2408更改engage.cloudflareclient.com为IPV4/6地址(如双栈网络接入忽略)
[root@archlinux ~]# nslookup engage.cloudflareclient.com
Server: 1.1.1.1
Address: 1.1.1.1#53
Non-authoritative answer:
Name: engage.cloudflareclient.com
Address: 162.159.192.1
Name: engage.cloudflareclient.com
Address: 2606:4700:d0::a29f:c001删除配置文件中的AllowedIPs = ::/0
删除配置文件中的AllowedIPs = 0.0.0.0/0
cp wgcf-profile.conf /etc/wireguard/wgcf.confwg-quick up wgcf# IPv4 Only VPS
curl -6 ip.p3terx.com
# IPv6 Only VPS
curl -4 ip.p3terx.comwg-quick down wgcfsystemctl start wg-quick@wgcf
systemctl enable wg-quick@wgcf
]]>