我这里的模式是让我外网电脑客户端连上 openwrt的wireguad,就能访问openwrt所有网段
刚开始发现只能ping通 openwrt 2.3和 wireguard分配的ip 8.2
首先防火墙必须开启,和window不一样,不是你关闭防火墙就代表默认允许流量端口啥的就是开的,linux是相反的,这是我经过验证发现的实际效果
/etc/init.d/firewall stop
之后我发现就无法ping通hub的主机。
![](https://img.haomeiwen.com/i2815884/7e8a6eaa57fc7bfd.png)
另外也要确保/etc/init.d/firewall restart
不会报错才能代表防火墙是ok的。
root@OpenWrt:~# ip route show
default via 192.168.2.1 dev br-lan proto static src 192.168.2.3
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
172.22.222.0/24 dev safeline-ce proto kernel scope link src 172.22.222.1
192.168.1.0/24 dev WireGuard proto static scope link metric 1
192.168.2.0/24 dev br-lan proto kernel scope link src 192.168.2.3
192.168.2.0/24 dev WireGuard proto static scope link metric 1
192.168.188.0/24 dev WireGuard proto static scope link metric 1
192.168.188.2 dev WireGuard proto static scope link metric 1
192.168.188.4 dev WireGuard proto static scope link metric 1
192.168.188.5 dev WireGuard proto static scope link metric 1
root@OpenWrt:~#
window客户端查路由
route print
![](https://img.haomeiwen.com/i2815884/3fb4e0c8f03c6828.png)
网友评论