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)

Related Objects

Mentioned In
1.2.9

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).

Yeah, that new nightly release has fixed the issue, thanks. Strangely now getting some weird message in my show commands (WARNING: terminal is not fully functional). This message wasn't there on the previous nightly.

:narey@vyos:~$ show nat destination rules

WARNING: terminal is not fully functional - (press RETURN)Rule Source Destination Proto In-Int Translation ------ --------- ------------- ------- -------- ------------- 100 0.0.0.0/0 0.0.0.0/0 TCP pppoe0 192.168.0.10 sport any dport 80,443 101 0.0.0.0/0 0.0.0.0/0 any pppoe0 192.168.0.10 sport any dport 80 port 80 120 0.0.0.0/0 0.0.0.0/0 any pppoe0 192.168.0.100 sport any dport 65301 port 65301 130 0.0.0.0/0 0.0.0.0/0 any pppoe0 192.168.0.100 sport any dport 65302 port 65302 140 0.0.0.0/0 0.0.0.0/0 any pppoe0 192.168.0.10 sport any dport 9443 port 9443 200 0.0.0.0/0 84.64.75.217 TCP eth1 192.168.0.10 sport any dport 80,443

Sorted out the WARNING: terminal is not fully functional message with adding the following export command: -

export TERM=xterm