My most common use of bridging is a transparent firewall between
the LAN and the WAN. This requires the ability to filter based on
the outgoing port, which the current physdev match supports.
However, I often also terminate VPN connections on this firewall,
and I want to filter/NAT packets arriving over the VPN based on the
outgoing port, which is no longer possible with the physdev match.
A similar situation is a bridged WAN and DMZ, and non-bridged LAN,
and again I want to filter/NAT packets from the LAN based on the
outgoing port.
So here is an ugly, inefficient, flawed, and barely tested patch
which lets me do this. I have no expectation of this being suitable
for mainline kernels, but maybe someone else is interested in it or
wants to comment on the approach.
The patch digs into the bridge internals too much, causes an extra
bridge fdb lookup, ignores some const attributes, and probably has
broken locking. And if there are no ARP or bridge fdb entries, then
it doesn't match any ports.
On the other hand, the modifications are quite self contained and
only have an effect if you try to use --physdev-out without
--physdev-is-bridged.
the LAN and the WAN. This requires the ability to filter based on
the outgoing port, which the current physdev match supports.
However, I often also terminate VPN connections on this firewall,
and I want to filter/NAT packets arriving over the VPN based on the
outgoing port, which is no longer possible with the physdev match.
A similar situation is a bridged WAN and DMZ, and non-bridged LAN,
and again I want to filter/NAT packets from the LAN based on the
outgoing port.
So here is an ugly, inefficient, flawed, and barely tested patch
which lets me do this. I have no expectation of this being suitable
for mainline kernels, but maybe someone else is interested in it or
wants to comment on the approach.
The patch digs into the bridge internals too much, causes an extra
bridge fdb lookup, ignores some const attributes, and probably has
broken locking. And if there are no ARP or bridge fdb entries, then
it doesn't match any ports.
On the other hand, the modifications are quite self contained and
only have an effect if you try to use --physdev-out without
--physdev-is-bridged.