我得客户端,linxu,配置文件中
AllowedIPs 里面添加了118.184.169.32这个ip
当我执行 wg-quick up wg 以后,路由也自动添加
[#] ip link add hongkong2 type wireguard
[#] wg setconf hongkong2 /dev/fd/63
[#] ip -4 address add 10.10.8.3/24 dev hongkong2
[#] ip link set mtu 1420 up dev hongkong2
[#] ip -4 route add 118.184.169.32/32 dev hongkong2 #添加路由
使用curl,可以获取到ip地址
[root@VM-12-15-centos wireguard]# curl ip.3322.net
34.113.1.31
之后我手动添加了路由,
ip -4 route add 34.160.111.145/32 via 10.10.8.1 dev hongkong2
却提示错误的连接
[root@VM-12-15-centos wireguard]# curl ifconfig.me
curl: (7) Failed connect to ifconfig.me:80; No route to host
wireguard只能通过AllowedIPs配置路由吗
解决了,路由配置的问题