Page MenuHomeVyOS Platform

DHCP static mapping and exclude address not working
Closed, ResolvedPublicBUG


I have such DHCP server configuration:

    dhcp-server {
        shared-network-name DMZ {
            subnet {
                lease 28800
                range 0 {
                static-mapping PC {
                    mac-address mac1
                static-mapping PC2 {
                    mac-address mac2
                static-mapping PC15 {
                    mac-address mac15

With this configuration, the server can issue addresses, that is in static-mapping, to random dhcp-client.
(When the static-mapped pc tries to get the address, it will receive it correctly if the address is not issued).
In log i see error (error occurs every time, when dhcp-server try to issue static-mapped ip):

Oct  1 16:51:44 NR dhcpd: Dynamic and static leases present for
Oct  1 16:51:44 NR dhcpd: Remove host declaration DMZ_PC2 or remove
Oct  1 16:51:44 NR dhcpd: from the dynamic address pool for DMZ

The simple solution is to use exclude in configuration, but it is imposible with consecutive addresses.
When i try to commit:


i receive error:

vyos@NR# commit
[ service dhcp-server ]
DHCP range stop address must be greater or equal
to the range start address!

[[service dhcp-server]] failed
Commit failed


Difficulty level
Normal (likely a few hours)
Why the issue appeared?
Design mistake
Is it a breaking change?
Behavior change

Event Timeline

c-po triaged this task as Normal priority.
c-po changed Difficulty level from Unknown (require assessment) to Normal (likely a few hours).
c-po renamed this task from DHCP static mapping work wrong to DHCP static mapping and exclude address not working.Oct 3 2019, 11:23 AM

I can confirm the issue. Actually it boils down to two individual ones.

  • The error message on overlapping DHCP ranges
  • The behavior that multiple exclude addresses work without a problem as long as they are not consecutive

This suxx ... working on a fix already

c-po changed Why the issue appeared? from Will be filled on close to Design mistake.
c-po moved this task from Needs Triage to Finished on the VyOS 1.2 Crux (VyOS 1.2.4) board.
c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.