-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6 outbound NAT doesn't update translation target when interface address changes #241
Comments
The rule in question is relevant as generated in For some reason I doubt the "deprecation" process because if it's deprecated it should still be usable?! I thought that was the whole point of having it. Cheers, |
You're right, this is probably a kernel / pf issue. According to pf.conf(5), "the rule is automatically updated whenever the interface changes its address". I'd say deprecating an address while simultaneously adding a new non-deprecated one qualifies as an address change, but apparently pf doesn't think so. Not sure whether this is intentional or pf just isn't aware of the deprecation status. There also seems to be an issue with my upstream router. When its LTE modem reconnects, the router sends RAs with both the old (now invalid) and the new prefix. The old prefix is advertised with a zero preferred lifetime (which deprecates it), but both prefixes keep getting advertised with a one hour valid lifetime. This indeed indicates that the old prefix is still usable, which is not the case. I will raise this issue with the vendor of the upstream router. |
@maurice-w Thanks for confirming. I'll take a look but can't make any promises. While I have your attention: https://forum.opnsense.org/index.php?topic=37813.msg197098#msg197098 Would you mind leaving your opinion? Removing the code would be easy, but it should be for the right reason. Cheers, |
Thanks @fichtner. I performed additional testing. It not only affects deprecated addresses, but invalid / removed addresses, too: When the upstream router stops advertising the old prefix, the old autoconf address eventually expires and gets removed. The interface then only has the new, valid address. But pf keeps using the old, non-existing address as the translation target. We might be able to work around this, but since it seems to be a pf bug, I think this is where it should get fixed. Before I raise this issue with the pf folks, do you have any thoughts? I'll respond to the other topic on the forum. Cheers |
This could mean two things:
Don't tell them you found the bug on OPNsense. The pf maintainer is notoriously known for blocking bug reports and even some bugfixes from getting into FreeBSD. Yes, we reached that low point a while ago already. Cheers, |
For reference, a workaround with Monit:
fd01:2345:6789:1::1 is an address of a LAN interface. Can be a GUA or ULA. The service performs a ping test using an internal source address. If the NAT uses the wrong translation target (deprecated IP address), the test will fail and the WAN interface gets reconfigured. |
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
Describe the bug
When an IPv6 outbound NAT rule exists on a SLAAC WAN interface and the interface address changes, the translation target isn't updated. Instead, the outbound NAT rule keeps using the deprecated address. As a result, all NATed connections fail.
Even a "disable - apply - enable - apply" of the outbound NAT rule does not fix this, it keeps using the deprecated address.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
IPv6 outbound NAT rules should update the translation target when the address is deprecated and the interface has a new, valid address.
Describe alternatives you considered
Trigger a link down / up event on the WAN interface.
Relevant log files
(Packet capture shows alle NATed outbound packets have deprecated source address 2001:db8:1:a:212:34ff:fe56:789a.)
Environment
OPNsense 24.1.6 (amd64)
Hyper-V Gen2
The text was updated successfully, but these errors were encountered: