dhcrelay 4.1.1 IPv6 and multiple prefixes

Marc Haber mh+dhcp-users at zugschlus.de
Fri May 14 07:53:41 UTC 2021


I have a Linux-based IP router that has caters for multiple IPv6
prefixes. If it matters, one of the prefixes comes in via prefix
delegation using systemd-networkd and changes ever 24 hours. The other
prefix comes in via OpenVPN and is statically configured. For the static
prefix, DHCPv6 is in use; the DHCP server does not run on the router
itself. Instead, dhcrelay is used.

The server is on Interface int181; a test client is on Interface int182.
int182 has an IP address from both prefixes while int181 just has one IP
address from the static prefix.

Before the dynamic prefix was added, this was working fine with the
dhcrelay command line

/usr/sbin/dhcrelay -d -6 -u int181 -l int181 -l int182

This stopped working when the dynamic prefix was added, the relay
doesn't forward the requests to the server on int181.

The man page says:
|  -l [address%]ifname[#index]
|         Specifies the ``lower'' network  interface  for  DHCPv6  relay
|         mode:  the  interface  on  which queries will be received from
|         clients or from other relay agents.  At least  one  -l  option
|         must  be  included  in the command line when running in DHCPv6
|         mode.  The interface name ifname  is  a  mandatory  parameter.
|         The  link  address  can be specified by address%; if it isn't,
|         dhcrelay will use the first non-link-local address  configured
|         on the interface.  The optional #index parameter specifies the
|         interface index.

Since the first non-link-local address on int182 is the address from the
DHCP-less dynamic prefix, I suspect this might be the issue here.

And, indeed,

/usr/sbin/dhcrelay -d -6 -u int181 -l int181 -l 2001:db8:42bc:a182::70:100%int182

that is, giving the address for the lower interface explicitly, seems to
make DHCPv6 work again.

However, i have two issues that I am not sure whether things are ok here
or not:

(1) The parameters don't show up properly in the process list:
[5/4996]mh at prom:~ $ pgrep --list-full dhcrelay
363071 /usr/sbin/dhcrelay -d -6 -u int181 -l int181 -l 2001:db8:42bc:a182::70:100 int182 -l int183 -l int188 -l int196 -l unt381 -l unt383
[6/4997]mh at prom:~ $ 

note the missing "%" between the explicitly given IP address and the
interface name. I have checked that the % is present in the execve call
that actually invokes dhcrelay, so that gets lost somewhere inside the
ISC code.

(2) adding the IP address to the upper interface breaks DHCPv6
/usr/sbin/dhcrelay -d -6 -u 2001:db8:42bc:a181::70:100%int181 -l 2001:db8:42bc:a181::70:100%int181 -l 2001:db8:42bc:a182::70:100%int182

with this command line, dhcrelay doesn't relay requests any more. In the
current setup, lucky me doesn't need the IP address explicitly set for
the upper interface, but in the near future, an address from the dynamic
prefix will be added to int181 as well, and this will make it necessary
to add the IP address for the upper interface as well.

Are those two things genuine issues in dhcrelay, or am I doing things


Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

More information about the dhcp-users mailing list