找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 785|回复: 4

关于ap模式下丢弃某个ip(mac)的数据包的方法的探讨(主备切换)

[复制链接]
本帖最后由 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口 ?



我的恩山、我的无线 The best wifi forum is right here.
AP模式下,

Padavan设备的几个网口都工作在二层数据链路层,
那怎么能从三层网络层去阻断它呢…
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
gaze 发表于 2023-6-29 08:27
AP模式下,

Padavan设备的几个网口都工作在二层数据链路层,

请教下大哥。ebtable不可用用于二层数据包处理吗?我看网上是说可以的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

1569648097 发表于 2023-6-29 09:23
请教下大哥。ebtable不可用用于二层数据包处理吗?我看网上是说可以的

应该是可以的,
但是经由cpu来处理二层数据包会不会慢很多?

还有就是Padavan里有没有这个软件呢?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
gaze 发表于 2023-7-10 11:40
应该是可以的,
但是经由cpu来处理二层数据包会不会慢很多?

有ebtable这个软件,但是似乎不起作用
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-29 01:08

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表