Page MenuHomeVyOS Platform

Configuring and disabling DHCP Server
Closed, ResolvedPublicBUG

Description

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::: Configuring and Disabling DHCP Server :::::::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set int eth eth3 descript "LAN"
set int eth eth3 address 10.100.100.1/24
set service dhcp-server shared-network-name LAN subnet 10.100.100.0/24 default-router 10.100.100.1
set service dhcp-server shared-network-name LAN subnet 10.100.100.0/24 dns-server 8.8.8.8
set service dhcp-server shared-network-name LAN subnet 10.100.100.0/24 range 0 start 10.100.100.100
set service dhcp-server shared-network-name LAN subnet 10.100.100.0/24 range 0 stop 10.100.100.150
commit

  • Until this, everything worked as expected:
    • Commit OK
    • DHCP Server running ok, and I configure a client and gets IP from de server.

set service dhcp-server shared-network-name LAN disable
commit

  • Version 1.2.7 --> NOT OK
    • DHCP server configuration error!
    • None of configured DHCP subnets does not have appropriate primary IP address on any broadcast interface.
    • service dhcp-server failed
    • Commit failed
  • Version 1.3 and 1.4 --> NOT OK
    • 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!
    • service dhcp-server failed
    • Commit failed

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)
Issue type
Unspecified (please specify)

Event Timeline

syncer triaged this task as Normal priority.

Error still present in 1.3.0-epa2 version:

vyos@vyos# set service dhcp-server shared-network-name LAN disable 
[edit]
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!

[[service dhcp-server]] failed
Commit failed

To disable shared-network at least one shared network should be working. The second can be disabled without issues.

So, in a very very simple config like this, user is not able to enable and disable dhcp-server with just a simple command?

set int eth eth3 descript "LAN"
set int eth eth3 address 10.100.100.1/24
set service dhcp-server shared-network-name LAN subnet 10.100.100.0/24 default-router 10.100.100.1
set service dhcp-server shared-network-name LAN subnet 10.100.100.0/24 dns-server 8.8.8.8
set service dhcp-server shared-network-name LAN subnet 10.100.100.0/24 range 0 start 10.100.100.100
set service dhcp-server shared-network-name LAN subnet 10.100.100.0/24 range 0 stop 10.100.100.150

The solution to this scenario would be to delete the config?

Well.. Actually when only one dhcp-server shared network is defined, service can be disbable with global disable for dhcp-server

set service dhcp-server disable

And when multiple dhcp-server are present, it can be disable individually.
Example:

vyos@vyos# run show config comm | grep dhcp
set service dhcp-server shared-network-name LAN-eth2 subnet 192.168.50.0/24 default-router '192.168.50.1'
set service dhcp-server shared-network-name LAN-eth2 subnet 192.168.50.0/24 name-server '8.8.8.8'
set service dhcp-server shared-network-name LAN-eth2 subnet 192.168.50.0/24 range 0 start '192.168.50.100'
set service dhcp-server shared-network-name LAN-eth2 subnet 192.168.50.0/24 range 0 stop '192.168.50.150'
set service dhcp-server shared-network-name LAN-eth3 disable
set service dhcp-server shared-network-name LAN-eth3 subnet 10.100.100.0/24 default-router '10.100.100.1'
set service dhcp-server shared-network-name LAN-eth3 subnet 10.100.100.0/24 name-server '8.8.8.8'
set service dhcp-server shared-network-name LAN-eth3 subnet 10.100.100.0/24 range 0 start '10.100.100.100'
set service dhcp-server shared-network-name LAN-eth3 subnet 10.100.100.0/24 range 0 stop '10.100.100.150'

PR https://github.com/vyos/vyos-1x/pull/1035

vyos@r1-roll# set service dhcp-server shared-network-name LAN-eth2 disable
[edit]
vyos@r1-roll# set service dhcp-server shared-network-name LAN-eth2 subnet 192.168.50.0/24 default-router '192.168.50.1'
[edit]
vyos@r1-roll# set service dhcp-server shared-network-name LAN-eth2 subnet 192.168.50.0/24 name-server '8.8.8.8'
[edit]
vyos@r1-roll# set service dhcp-server shared-network-name LAN-eth2 subnet 192.168.50.0/24 range 0 start '192.168.50.100'
[edit]
vyos@r1-roll# set service dhcp-server shared-network-name LAN-eth2 subnet 192.168.50.0/24 range 0 stop '192.168.50.150'
[edit]
vyos@r1-roll# commit
[ service dhcp-server ]
At least one shared network must be active!

[[service dhcp-server]] failed
Commit failed
[edit]
vyos@r1-roll#
Viacheslav changed the task status from Open to In progress.Oct 21 2021, 5:03 PM
c-po changed the task status from In progress to Needs testing.Oct 21 2021, 5:57 PM
c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus (1.3.0-epa3) board.
c-po moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.
c-po set Issue type to Unspecified (please specify).