Skip to content

fw4 generates incorrect NAT leakage rule (ct state invalid instead of new) in accept_to_wan #66

@fonoirs

Description

@fonoirs

OpenWrt Version: 24.10.1 (r28597-0425664679)
firewall4 Version: 2024.12.18~18fc0ead-r1
Target: x86_64

Observed behavior:

The default fw4 ruleset in accept_to_wan contains:
meta nfproto ipv4 oifname "eth1" ct state invalid drop comment "!fw4: Prevent NAT leakage"

However, this rule does not drop new outgoing connections that leak private IPs when masquerading is missing.

Expected behavior:

It should insert the following rule instead:
meta nfproto ipv4 oifname "eth1" ct state new drop comment "!fw4: Prevent NAT leakage"

Workaround:

Manually inserting the above ct state new drop rule into the accept_to_wan chain solves the problem and correctly drops un-NATed new traffic.

Please confirm whether this is a regression or a logic oversight in rule generation.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions