core icon indicating copy to clipboard operation
core copied to clipboard

Cannot assign dhcrelay CARP IPV6

Open drobnymichal opened this issue 2 months ago • 3 comments

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

  • [x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [x] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Describe the bug

I am unable to get DHCPv6 relay working if there is only a CARP IPv6 address on the given interface.

If there is an IP address directly on the given interface, it works.

I have no problem with DHCPv4 relay.

To Reproduce

Steps to reproduce the behavior:

  1. Create CARP VIP (IPv6)
  2. Try to create DHCPv6 Realy on the interface with IPv6 CARP VIP
  3. Created DHCPv6 relay failed on start. (dhcrelay_configure_id() found no suitable IP address for opt2(vlan0.69))

Expected behavior

No errors.

Describe alternatives you considered

I looked at the code and found this function: (/usr/local/etc/inc/interfaces.inc line 4094)

 foreach (interfaces_addresses($interface, false, $ifconfig_details) as $addr) {
     /* XXX consider excluding 'autoconf', but only when it's not in SLAAC mode */
     if ($addr['family'] != 'inet6' || $addr['deprecated'] || $addr['detached'] || $addr['tentative'] || $addr['alias']) {
         continue;                                                           

Here is a filter for IP addresses that are not aliases. When I removed the check on the alias, dhcprelay started normally.

Screenshots

No screenshots.

Relevant log files

opnsense 45373 - [meta sequenceId="108"] /usr/local/sbin/pluginctl: dhcrelay_configure_id() found no suitable IP address for opt2(vlan0.69)

Additional context

No context.

Environment

Software version used and hardware type if relevant, e.g.:

Versions OPNsense 25.10_2-amd64 FreeBSD 14.3-RELEASE-p4 OpenSSL 3.0.18 Licensed until 2026-10-20

Official OPNsense box DEC4240EU.

drobnymichal avatar Nov 08 '25 10:11 drobnymichal

@fichtner can this condition be altered?

Monviech avatar Nov 17 '25 07:11 Monviech

@drobnymichal In the old days a "VIP" was a special entity to select for listening explicitly, but that was not a great concept so it's no longer there. This now seems to revolve around get_interface_ip(v6) functions not being able to cope with ambiguity.

Let me see if I can fix this.

Cheers, Franco

fichtner avatar Nov 19 '25 19:11 fichtner

I haven't tested this yet so beware, but I think the approach in 1af287d is what you were looking for.

fichtner avatar Nov 19 '25 20:11 fichtner