我已经设置了以太网桥br0,它包含两个接口eth0和tap0
brctl addbr br0 brctl addif eth0 brctl addif tap0 ifconfig eth0 0.0.0.0 promisc up ifconfig tap0 0.0.0.0 promisc up ifconfig br0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255
我的默认FORWARD链策略是DROP@H_502_5@
iptables -P FORWARD DROP
iptables -A FORWARD -p all -i br0 -j ACCEPT
据我所知,iptables只负责IP层.@H_502_5@
ebtables应负责过滤以太网桥上的流量.@H_502_5@
解决方法
由于br-nf代码可用作linux 2.4的补丁并在linux 2.6中使用:
The br-nf code makes bridged IP
frames/packets go through the iptables
chains. Ebtables filters on the
Ethernet layer,while iptables only
filters IP packets.@H_502_5@
由于你正在使用的流量是ip,iptables规则仍然适用,因为br-nf将桥接数据包传递给iptables.@H_502_5@
This是阅读有关交互的一个很好的资源,this one详细介绍了br-nf代码的功能,包括如何禁用所有或部分功能(即不将桥接流量传递给iptables).@H_502_5@