OpenWRT 作为交换机用,但是 iptables 自定义规则不生效,何解?

2015-11-04 00:24:29 +08:00
 OGC
设备是联想 Y1 刷的是官方 15.05 的固件,设置为交换机,开启无线,工作于 192.168.1.0/24 网段,接入的设备都能上网。

网络设置:
/etc/config/network

config interface 'lan'
option ifname 'eth0'
option force_link '1'
option type 'bridge'
option proto 'static'

config switch
option name 'switch0'
option reset '0'
option enable_vlan '0'

iptables 命令:

iptables -I FORWARD -i eth0 -j ACCEPT
iptables -I FORWARD -o eth0 -j ACCEPT

iptables -I INPUT -d 10.0.0.1 -j DROP
iptables -I OUTPUT -d 10.0.0.1 -j DROP
iptables -I FORWARD -d 10.0.0.1 -j DROP

笔记本使用浏览器访问 10.0.0.1 防火墙计数器的上述规则无任何记录。

因为不想把OpenWRT当路由器用……那么问题来了
352 次点击
所在节点    OpenWrt
1 条回复
skylancer
2015-11-04 15:05:29 +08:00
..交换机哪来的 FORWARD Chain..这些都是 NAT 以后才处理的规则好嘛...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/233411

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX