Firewall4 (fw4) port forwards + Luci + IPv6

Luci interface (OpenWrt 22.03.03) is having troubles understanding option family ipv6 option in /etc/config/firewall. Regardless of family specified it will say 'IPv4'. Also interface part doesn't provide option to choose between IPv6 or IPv4 the way does in 'Traffic Rules'.

Firewall itself works fine.

Are you sure you need Port Forwards for IPv6? What's the use case?

Yes, I'm sure, that CLI and Luci are expected to give the same result. Especially if the case is desrcibed in IPv6 firewall examples.

Adblock support thread - #2389 by timur.davletshin - this is one of use cases.

Does this fix it?

3 Likes

I have no idea how to test it but I don't like if family is any/empty , assume it is ipv4 statement. It is different from Traffic Rules logic where no family specified means both IPv4 and IPv6. Also it changes behavior for those migrating from previous versions of OpenWrt. Logic in all tabs should be the same.

This is based on the logic of firewall4 itself:

This was done to retain backwards compatibility. Suddenly forwarding/exposing IPv6 ports when upgrading to fw4 where they've historically always been IPv4 only with the same configuration could have undesired security implications.

Therefor a user has to explicitly set family: any or family: ipv6 to make an IPv6 capable port forward. Without specifying any family, it will default to IPv4 to mimic the long standing default behavior.

3 Likes

Thank you for the explanation, now it is clear :slightly_smiling_face: