1、问题如下:主路由openwrt的LAN口接了一个二级路由Padavan,现在想要实现PC 1访问PC 2,我在openwrt里面配置静态路由去往 192.168.2.0/24 下一跳地址为二级路由WAN口ip 192.168.1.2,pc 1能ping通pc 2的网关,但是pc 1却ping不通pc 2,pc 2能ping通pc 1,只能单向通信,请大佬帮我看看什么问题?
解决思路:
1、ssh登入到openwrt上,输入route命令,查看有去往192.168.2.0/24的路由,,如下红色字段路由;于是我ping了PC 2的网关地址,可以通,那可以肯定主路由没问题
root@OpenWrt:~# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.100.250 0.0.0.0 UG 0 0 0 wan 10.0.0.0 * 255.0.0.0 U 0 0 0 vnt-tun 10.26.0.0 * 255.255.255.0 U 0 0 0 vnt-tun 192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan 192.168.2.0 192.168.1.2 255.255.255.0 UG 0 0 0 br-lan 192.168.100.0 * 255.255.255.0 U 0 0 0 wan 192.168.123.0 * 255.255.255.0 U 0 0 0 vnt-tun 224.0.0.0 * 240.0.0.0 U 0 0 0 vnt-tun 255.255.255.255 * 255.255.255.255 UH 0 0 0 vnt-tun
2、ssh登入Padavan上,输入route命令,192.168.1.0/24和192.168.2.0/24两条直连路由都有,路由表也没问题,再ping下PC 2的ip,能ping通
root@K2P:/etc/config# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth1 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan root@K2P:/etc/config#
3、以上排查结果断定是Padavan从wan口到lan口数据转发的问题,随机查看iptables防火墙配置,因为防火墙的默认配置是拒绝转发
标签:网段,255.255,0.0,pc,192.168,访问,255.0,路由 From: https://www.cnblogs.com/xiykj/p/17705918.html