Assign multiple IPs via DHCPv4 / DHCPv6 to the same Host/DUID/MAC Address

Started by luckylinux, June 08, 2024, 08:39:18 AM

Previous topic - Next topic
I'm wondering why it's NOT possible to assign multiple IP Addresses to a DHCPv4/DHCPv6 Client using OPNSense (ISC DHCP Server).

For instance, on a Hetzner Server, since a MAC Address is bound to multiple IPs on Hetzner Robot, if everything gets configured via DHCP (Client) on the Server, then the Interface can get as many IPs as it has assigned (in the Rescue System I could get 4 of them). On the Production Server I configure IP Statically (mostly by Choice), so it's not a thing ...

I just wonder why the OPNSense DHCP Server doesn't support this.

Basically:
- Same MAC (DHCPv4 Server) or Same DUID (DHCPv6 Server)
- Different IP Address

Is there a Technical Reason that this is not implemented ?

Use case: I am running Podman (similar to Docker) Containers rootless on a Debian/Fedora Host. The user running the Containers can bind to any Port & IPv6 Address, but the Address must FIRST be assigned to the Host itself (which would be IMHO easier to do via DHCP, rather than having to use `nmcli` in Fedora - `/etc/network/interfaces` in Debian)

If you are looking for a quicker way to assign multiple IP addresses to a host, check out Ansible or NixOS. Those are a better solution for your use case than tinkering with DHCP IMHO.

Bart...

Quote from: bartjsmit on June 08, 2024, 08:58:00 AM
If you are looking for a quicker way to assign multiple IP addresses to a host, check out Ansible or NixOS. Those are a better solution for your use case than tinkering with DHCP IMHO.

Bart...

Well I'd use saltstack if we are talking about going down that path I guess ...

Then use one of those obscure systems podman, hetzner, or eurovision. I won't put my name behind obscure software.

Don't forget both protocols are very different. I'll set static reserved ipv4 addresses. for my very important devices, I'll give them a static ipv6 address. The ipv6 client presents something totally different than a simple Mac address. the ipv6 leases tries to find the ipv4 version but it's not guaranteed. Besides servers, it's not really important what ipv6 a client device has.