Page MenuHomeVyOS Platform

DHCP server client-prefix-length parameter results in non-functional leases
Closed, ResolvedPublicBUG

Description

Tested in VyOS 1.4-rolling-202201060842 & VyOS 1.3.0

DHCP server parameter "client-prefix-length '24'" results in a mask of 0.0.0.24 on the client, instead of 255.255.255.0

To reproduce:
Server:

set interfaces ethernet eth0 address '10.1.1.1/24'
set service dhcp-server shared-network-name DHCP_SCOPE subnet 10.1.1.0/24 client-prefix-length '24'
set service dhcp-server shared-network-name DHCP_SCOPE subnet 10.1.1.0/24 default-router '10.1.1.1'
set service dhcp-server shared-network-name DHCP_SCOPE subnet 10.1.1.0/24 range CLIENT_RANGE start '10.1.1.50'
set service dhcp-server shared-network-name DHCP_SCOPE subnet 10.1.1.0/24 range CLIENT_RANGE stop '10.1.1.250'

Client:

set interfaces ethernet eth0 address 'dhcp'

Result on client:

vyos@vyos:~$ show dhcp client lease
interface  : eth0
ip address : 10.1.1.50  [Inactive]
subnet mask: 0.0.0.24
router     : 10.1.1.1
dhcp server: 10.1.1.1
lease time : 85809
last update: Thu Jan 20 03:21:47 UTC 2022
expiry     : Fri Jan 21 03:11:56 UTC 2022
reason     : BOUND

As a workaround the "client-prefix-length 24" command can be removed:

set interfaces ethernet eth0 address '10.1.1.1/24'
set service dhcp-server shared-network-name DHCP_SCOPE subnet 10.1.1.0/24 default-router '10.1.1.1'
set service dhcp-server shared-network-name DHCP_SCOPE subnet 10.1.1.0/24 range CLIENT_RANGE start '10.1.1.50'
set service dhcp-server shared-network-name DHCP_SCOPE subnet 10.1.1.0/24 range CLIENT_RANGE stop '10.1.1.250'

With this configuration the client gets the correct leases

Details

Difficulty level
Unknown (require assessment)
Version
1.3.0, 1.4-rolling-202201060842
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Related Objects

Mentioned In
1.3.3
1.3.1

Event Timeline

Unknown Object (User) created this task.Jan 20 2022, 4:11 AM
Unknown Object (User) created this object in space S1 VyOS Public.
Unknown Object (User) updated the task description. (Show Details)Jan 20 2022, 4:22 AM
Unknown Object (User) added a project: VyOS 1.4 Sagitta.
Unknown Object (User) changed Version from 1.3.0 to 1.3.0, 1.4-rolling-202201060842.
Unknown Object (User) added a comment.Jan 20 2022, 4:38 AM

From ISC-DHCP manual pages:
https://kb.isc.org/docs/isc-dhcp-44-manual-pages-dhcp-options

option subnet-mask ip-address;
The subnet mask option specifies the client’s subnet mask as per RFC 950. If no subnet mask option is provided anywhere in scope, as a last resort dhcpd will use the subnet mask from the subnet declaration for the network on which an address is being assigned. However, any subnet-mask option declaration that is in scope for the address being assigned will override the subnet mask specified in the subnet declaration.

Subnet mask should be in the form A.B.C.D, not prefix-length

Viacheslav changed the task status from Open to In progress.Jan 20 2022, 12:58 PM
Viacheslav assigned this task to Unknown Object (User).
Viacheslav changed the subtype of this task from "Task" to "Bug".
Viacheslav changed the task status from In progress to Needs testing.Jan 25 2022, 4:31 PM
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus ( 1.3.1) board.