Closed abelbeck closed 10 years ago
Yeah seems reasonable. It just plain stupid the way it is now, I wonder why didn't stumble onto this before actually.
This NAT-trick only applies to router situations, where many (I do) disable dropped WAN packet logging since there is so much of it... so the log does not appear.
I'll fix this later today.
@arnova A confusing issue can up with an AstLinux user, using AIF as a router:
It was desired to NAT port TCP 8443 to port 443 on the "Local" router, so the destination address was set to 192.168.0.1, a LAN gateway interface ...
This worked as expected, but this LOG was always generated:
Normally NAT_FORWARD rewrites the packets to pass through the FORWARD chain, but in this case the IPv4 address "192.168.0.1" is associated with "Local" so it is passed via the INPUT chain. A rule added to the EXT_FORWARD_IN_CHAIN chain to normally allow this rewritten packet is not used.
After some headscratching, the NAT_LOCAL_REDIRECT=1 adds this to the EXT_INPUT_CHAIN chain:
which allows DNAT'ed packets to be allowed in the INPUT chain, but this rule is added after the 'AIF:PRIV TCP packet' log (and others) so even if the DNAT'ed packet is allowed the log is generated.
I'm proposing to move the NAT_LOCAL_REDIRECT=1 conditional up, After "# Handle multicast traffic" and before "# Log packets to privileged TCP ports?"
Seem reasonable ?