ブリッジ内のiptables

ブリッジ内のiptables

私が持っているなら:

eth0  (no address)
wlan0 (no address, providing wifi-hotspot by 'hostapd')
br0   (local IP, bridging eth0+wlan0)
eth1  (public IP, providing internet to above by net.ipv4.ip_forward=1)

私の考えでは:

targetPublicIPをeth0のみにブロックします(wlan0クライアントはアクセスできますが、eth0クライアントはアクセスできないように)。

これはうまくいきません:

iptables -A FORWARD -i eth0 -d targetPublicIP -j DROP

おそらく、iptablesがlevel2内のブリッジを妨げることができないからです。私はebtablesを使ったことがありません。おそらくそれが解決策かもしれませんし、IPルールになるでしょうか?

最も簡単な解決策は何ですか?

ベストアンサー1

"physdev"が私が探しているオプションのようです。

iptables -A FORWARD -m physdev --physdev-in eth0 -d targedPublicIp -j DROP

うまくいきます。今はebtablesを学ぶ必要はありません。

おすすめ記事