Page MenuHomeVyOS Platform

DHCP-Server creation for not primary IP address fails
Open, Requires assessmentPublicBUG

Description

Error while declaring more than one IP address on certain interface, and then creating a dhcp-server for one of those IP address (but not for the first declared)
Example:
vyos@vyos# set int eth eth3 address 192.168.200.1/24
vyos@vyos# set int eth eth3 address 10.10.10.1/24
vyos@vyos# commit

vyos@vyos# set service dhcp-server shared-network-name LAN subnet 10.10.10.0/24 default-router 10.10.10.1
vyos@vyos# set service dhcp-server shared-network-name LAN subnet 10.10.10.0/24 dns-server 10.10.10.1
vyos@vyos# set service dhcp-server shared-network-name LAN subnet 10.10.10.0/24 range 0 start 10.10.10.101
vyos@vyos# set service dhcp-server shared-network-name LAN subnet 10.10.10.0/24 range 0 stop 10.10.10.110
vyos@vyos# commit
[ service dhcp-server ]
None of the configured subnets have an appropriate primary IP address on any
broadcast interface configured, nor was there an explicit listen-address
configured for serving DHCP relay packets!

This was tested on:

  • 1.2.7
  • 1.3
  • 1.4

Details

Difficulty level
Unknown (require assessment)
Version
1.2.7 - 1.3 - 1.4
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

@n.fort You can try to replace True with False there (1.3 and 1.4). But it needs more tests. In some cases, it was some bugs with the DHCP server and not the primary address.
https://github.com/vyos/vyos-1x/blob/5d068442cf7b1863724c83168176ce2940a023fe/src/conf_mode/dhcp_server.py#L237

from

if is_subnet_connected(subnet, primary=True)

to

if is_subnet_connected(subnet, primary=False)

At least on simple tests, this modification seems to work.
I have tested on version 1.3, first configuring dhcp server for both addresses: for the one that was defined first, and one for the las IP address defined (of course, one instance of dhcp-server running at a time).
If this needs more testes, let me know what I can do for you.