Why does my firewall (iptables) interfere in my bridge (brctl)?

Totor

I set up a bridge br0 "attached" to two interfaces:

  • eth0, my physical interface connected to the real LAN,
  • vnet0, a KVM virtual interface (connected to a Windows VM).

And I have this single firewall rule in the forward chain:

iptables -A FORWARD -j REJECT

Now, the only ping that is working is from the VM to the host.

The br0 interface owns the IP address of my host machine. eth0 and vnet0 do not "own" any IP, from the host point of view. The Windows VM has a static IP configuration.

If change my iptables rule to ACCEPT (or even use a more restrictive iptables -A FORWARD -o br0 -j ACCEPT), everything is working fine! (i.e. I can ping any LAN machine from the VM, and the other way round too).

All IP forwarding kernel options are disabled (like net.ipv4.ip_forward = 0).

So, how can the netfilter firewall block something that is not even enabled?

Furthermore, the VM - LAN traffic should only imply eth0 and vnet0. Yet it looks like allowing FORWARD traffic with -o br0 "works" (I did not check very carefully though).

Mathias Weidner

The comment from Stéphane Chazelas provides the hint to the answer.

According to Bridge-nf Frequently Asked Questions bridge-nf enables iptables, ip6tables or arptables to see bridged traffic.

As of kernel version 2.6.1, there are five sysctl entries for bridge-nf behavioral control:

  • bridge-nf-call-arptables - pass bridged ARP traffic to arptables' FORWARD chain.
  • bridge-nf-call-iptables - pass bridged IPv4 traffic to iptables' chains.
  • bridge-nf-call-ip6tables - pass bridged IPv6 traffic to ip6tables' chains.
  • bridge-nf-filter-vlan-tagged - pass bridged vlan-tagged ARP/IP traffic to arptables/iptables.
  • net.bridge.bridge-nf-filter-pppoe-tagged - pass bridged pppoe-tagged IP/IPv6 traffic to {ip,ip6}tables

You can disable netfilter firewall blocking with:

# sysctl -w net.bridge.bridge-nf-call-iptables=0
# sysctl -w net.bridge.bridge-nf-call-ip6tables=0

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why does my iptables firewall reject connections to port 1531?

From Dev

Why does adding my viewcontroller to a navigationcontroller seem to interfere with my constraints?

From Dev

Why does setting position of my div to fixed interfere with flyout div?

From Dev

Why does my firewall reset upon reboot?

From Dev

Why does iptables still block my samba?

From Dev

Why my bridge cannot be found?

From Dev

Iptables: why my redirection doesn't work?

From Dev

Why did this iptables rule block my webserver?

From Dev

Why doesn't my iptables rule work?

From Dev

Why don't my iptables log?

From Dev

Why does my if is not executing

From Dev

Why does xcode not see my app-bridge-header and tells me the file GIDSignInDelegate is undeclared?

From Dev

Why does xcode not see my app-bridge-header and tells me the file GIDSignInDelegate is undeclared?

From Dev

What does "my.firewall" mean on linux routing table?

From Dev

Why does my MVar freeze my code?

From Dev

Why Does My Image Overlap My Banner

From Dev

Why does my MVar freeze my code?

From Dev

Find my rules in iptables

From Dev

Where are my iptables?

From Dev

Why Am I seeing 'X11' in my iptables?

From Dev

Why is iptables -F kicking me out of my ssh session?

From Dev

Why does "position: relative" interfere with "transform: scale"?

From Dev

Why my printf does not work?

From Dev

Why does my TCS not await?

From Dev

Why does my scanner repeat?

From Dev

Why does my sorting not work?

From Dev

Why does my API return {}

From Dev

Why does my regex do this?

From Dev

Why does my toString() print this?