# 安装wireguard apt update -y && apt install wireguard sudo curl vim openresolv -y
# 安装wgcf curl -fsSL git.io/wgcf.sh | sudo bash
# 注册账户 wgcf register
# 生成配置文件 wgcf generate
# 编辑配置文件 vim wgcf-profile.conf
# 将配置文件的DNS、AllowedIPs、Endpoint,如下 [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
# 复制配置文件到wireguard文件夹 cp wgcf-profile.conf /etc/wireguard/wgcf.conf
# 尝试启动 wireguard wg-quick up wgcf
# 测试 ping google.com -4
# 关闭wgcf接口 wg-quick down wgcf
# 加入开机启动 systemctl start wg-quick@wgcf systemctl enable wg-quick@wgcf
# 默认v6优先级 # 编辑文件 /etc/gai.conf,将 label 2002::/16 2 的注释删除
|