|
本帖最后由 1569648097 于 2023-6-29 00:26 编辑
需求:
当前组网:
猫lan1(桥接模式) -> openwrt Wan口 (由op进行pppoe)-> openwrt LAN -> newifi D2(padavan ap模式): Lan1
猫LAN4-(路由模式、开启dhcp、可直接上网)>ewifi D2(padavan ap模式): Lan2
这么接线的目的是:当openwrt不可用时(关机),由光猫直接处理上网数据
目前想这么实现:
- newifi D2(padavan ap模式) 上当前已存在一个脚本,(时刻去ping openwrt网关),当ping通openwrt网关(192.168.10.1)时,需要丢弃所有的192.168.1.1(光猫的网关)的包。
即:能通openwrt时只使用openwrt当做网关处理数据,由op进行dhcp分配ip数据,drop光猫的所有数据包。
- newifi D2(padavan ap模式) 当ping不通op网关时,执行相应的命令停止丢弃来自光猫的数据包,由光猫进行处理上网。
当前遇到了一个问题:
无论通过iptable、ebtable禁用光猫的mac、ip, newifi D2(padavan ap模式)下挂的设备仍能收到来子光猫的dhcp报文,导致分配为光猫桥接网段的ip,进而导致无法使用openwrt进行处理上网数据
192.168.1.1、 2c:33:41:4e:11:11是猫ip、mac
[RT-N56U_B1 /home/root]#iptables -L:
Chain INPUT (policy ACCEPT)
target prot opt source destination
DROP all -- 192.168.1.1 anywhere
DROP all -- 192.168.1.1 anywhere
DROP all -- anywhere 192.168.1.1
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DROP all -- 192.168.1.1 anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DROP all -- 192.168.1.1 anywhere
DROP all -- 192.168.1.1 anywhere
Chain BWMON (0 references)
target prot opt source destination
DROP all -- 192.168.1.1 anywhere
RETURN all -- anywhere 192.168.10.188
[RT-N56U_B1 /home/root]# ebtables -L
Bridge table: filter
Bridge chain: INPUT, entries: 3, policy: ACCEPT
-p IPv4 -s 2c:33:41:4e:11:11 -j DROP
-p IPv4 -d 2c:33:41:4e:11:11 -j DROP
-p IPv4 --ip-src 192.168.1.1 -j DROP
Bridge chain: FORWARD, entries: 3, policy: ACCEPT
-p IPv4 -d 2c:33:41:4e:11:11 -j DROP
-p IPv4 -s 2c:33:41:4e:11:11 -j DROP
-p IPv4 --ip-src 192.168.1.1 -j DROP
Bridge chain: OUTPUT, entries: 3, policy: ACCEPT
-p IPv4 -s 2c:33:41:4e:11:11 -j DROP
-p IPv4 -d 2c:33:41:4e:11:11 -j DROP
-p IPv4 --ip-src 192.168.1.1 -j DROP
想请教下大家还有没有方法,在 newifi D2(padavan ap模式) 上去禁用光猫发出来的报文?
或者大家有没有办法通过命令行的方式禁用ewifi D2(padavan ap模式)的 Lan2口 ?
|
|