1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| apt update -y && apt install wireguard sudo curl vim openresolv -y
curl -fsSL git.io/wgcf.sh | sudo bash
wgcf register
wgcf generate
vim 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 Endpoint = [2606:4700:d0::a29f:c001]:2408
cp wgcf-profile.conf /etc/wireguard/wgcf.conf
wg-quick up wgcf
ping google.com -4
wg-quick down wgcf
systemctl start wg-quick@wgcf systemctl enable wg-quick@wgcf
|