(Sending to "netbsd-users" since it seems a general NetBSD configuration
and usage issue rather than a -current issue.  See original thread here:

  https://mail-index.netbsd.org/current-users/2025/12/26/msg047180.html
)

Good points raised and perhaps others can shed some light on how to deal
with a multi-homed interface where one address is statically assigned and
the other is dynamic via DHCP.

This is the case with my router (which does ONLY routing, nothing else).
I have a statically-assigned RFC1918 address so systems in my network can
access the ADSL modem/bridge's config/status interface.  It also gets a
dynamically assigned public IP address from my ISP.

I have long used "pf" since it lets me distinguish between primary and
alternate IP addresses on an interface symbolically and have different
rule sets for each network while still tracking the dynamica address.

(The only hiccup is that an address change makes the new public IP the
alternate address and the static IP the primary, but using the
'dhcpcd.exit-hooks' script to delete and re-add the static IP, makes the
dynamic address primary again.)

IIUC, the "inet4()" operator in 'npf' is evaluated once at (re)load of
the ruleset.  The "ifaddr()" operator will track the dynamic address,
but the rules using it will be applied to all addresses returned, which
is inappropriate for my statically-assigned address.

Does anyone else have a similar setup (multi-homed "external" interface
with a mix of static and dynamic addresses) and have an 'npf'-based
solution?

Thanks.

-- 
|/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
|\ / jdbaker[snail]consolidated[flyspeck]net  OpenBSD            FreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

Reply via email to