On 11/12/26 18:26, Daniel P. Berrangé wrote:
On Tue, Oct 27, 2026 at 02:02:59PM +0100, Dion Bosschieter wrote:
In ebtables a subchain was created with a default accept
When converted to nftables, this resulted in an "accept" at the
end of each subchain:
chain O-v100562794-mac {
ether daddr 52:54:00:a3:13:87 counter packets 9 bytes 1145 return
ether daddr 33:33:00:00:00:00/16 counter packets 48 bytes 3712 return
ether daddr ff:ff:ff:ff:ff:ff counter packets 22 bytes 924 return
counter packets 3 bytes 384 drop
counter packets 0 bytes 0 accept
}
This example probably isn't the best as it shows the addition
is pointless - nothing will get past the 'drop' statement.
When I updated the libvirt-tck data files to work with this
new patch, I didn't find any rule where this addition makes
a functional difference, as the 'accept' rule always
immediately followed another 'accept' or 'drop' rule.
Do you have an example XML fragment where this makes a
difference to the result ?
With the following should filter definition:
<filter name='custom-icmp6-filter' chain='ipv6' priority='-700'>
<uuid>e97f7946-9292-4131-a1dd-f83055cf67ea</uuid>
<!-- ICMPv6: disallow incoming router solicitations -->
<rule action='drop' direction='in' priority='100'>
<ipv6 protocol='icmpv6' type='133'/>
</rule>
<!-- ICMPv6: accept all other icmp -->
<rule action='accept' direction='inout' priority='101'>
<ipv6 protocol='icmpv6'/>
</rule>
</filter>
<filter name='custom-ipv6' chain='ipv6'>
<uuid>09c21bb9-33fe-4006-ba3b-67c28d616883</uuid>
<!-- accept inbound dhcpv6 traffic -->
<rule action='accept' direction='in' priority='111' statematch='false'>
<tcp-ipv6 dstipaddr='2345::1234:ff:dcba:abcd' dstipmask='128'
dstportstart='2345'/>
</rule>
</filter>
<filter name='firewall-domain-foo' chain='root'>
<uuid>6622d457-9fd3-4504-9356-273c1fd4a4bd</uuid>
<filterref filter='custom-icmp6-filter'/>
<filterref filter='custom-ipv6'/>
<filterref filter='no-other-l2-traffic'/>
<filterref filter='qemu-announce-self'/>
</filter>
On the ebiptables driver [2345::1234:ff:dcba:abcd]:2345 tcp is
reachable, But on the nftables implementation it is not.
no-other-l2-traffic blocks traffic at the end of the root chain on L2
tcp-ipv6 is a L3 (inet) rule, it will see and filter the traffic later,
but the packet is already dropped in nftables in the ethernet table.
The reason that it works on the ebiptables driver is that there was an
implicit accept at the end of the ethernet subchains, in this case in
custom-icmp6-filter.
So in theory it is more logical how it works on the nwfilter nftables
driver. Because it does a return in a subchain whenever there is no
match. In practice however this means that it is harder to migrate from
ebiptables to nftables because the firewalling behavior is different.
With regards,
Dion