目前在 VPS 部署了一个 Wireguard 服务,姑且称之为服务端,10.88.88.1/24 。
Openwrt 的 peer 设置为 VPS ,为 Openwrt 分配到 10.88.88.3/24 。
此时 OP 和 VPS 都能互相 ping 通 Wireguard 的 IP 。
Openwrt 的 Lan 是 192.168.1.0/24 ,通过配置静态路由和防火墙,实现了 Lan 下的内网可以访问 10.88.88.1
静态路由
10.88.88.0/24 via 10.88.88.1 dev Wireguard proto static
防火墙
config zone
option name 'WG'
option input 'ACCEPT'
option output 'ACCEPT'
option network 'Wireguard'
option forward 'ACCEPT'
option masq '1'
现在问题就是 VPS 和 Wireguard 的其他 peer 无法访问 192.168.1.0/24 的设备。
尝试在 VPS 上添加路由,无效。
ip route add 192.168.1.0/24 via 10.88.88.3 dev wg0
应该如何解决这个问题呢?