Page MenuHomeVyOS Platform

DHCP server statistic is empty in 1.2
Closed, ResolvedPublic


1. DHCP server has active leases but column "Pool" is empty. (in 1.1.8 this column is populated with dhcp shared-network-name 'LAN')
ma@ipsec-left:~$ sh dhcp server leases

IP address       Hardware address   Lease expiration     Pool                      Client Name
----------       ----------------   ----------------     ----                      -----------    00:0c:29:89:19:94  2018/07/02 18:00:00                            ipsec-l2tp

2. DHCP statistics is empty. Column "Leased" is 0 but in fact we have one active lease.

ma@ipsec-left:~$ show dhcp server statistics 

Pool                      Pool size   # Leased    # Avail
----                      ---------   --------    -------
LAN                       127         0           127

3. DHCP server configuration

ma@ipsec-left# show service dhcp-server 
 disabled false
 hostfile-update disable
 shared-network-name LAN {
     authoritative enable
     subnet {
         domain-name internal-net
         lease 86400
         start {

4. Current VYOS version

ma@ipsec-left:~$ sh ver
Version:          VyOS 1.2.0-rolling+201807011342
Built by:
Built on:         Sun 01 Jul 2018 13:42 UTC
Build ID:         308061e6-61c9-4e27-a4cf-b291df102ef1

Architecture:     x86_64
Boot via:         installed image
System type:      VMware guest

Hardware vendor:  VMware, Inc.
Hardware model:   VMware Virtual Platform
Hardware S/N:     Unknown
Hardware UUID:    Unknown

Copyright:        VyOS maintainers and contributors


Difficulty level
Unknown (require assessment)
VyOS 1.2.0-rolling+201807011342
Why the issue appeared?
Will be filled on close

Event Timeline

syncer triaged this task as Normal priority.Jul 6 2018, 8:42 PM
syncer changed the visibility from "Subscribers" to "Public (No Login Required)".
syncer edited subscribers, added: Active contributors, Maintainers; removed: oleksandr.mamenko.
hagbard changed the task status from Open to In progress.Jul 6 2018, 10:26 PM

I can replicate it, looking into it.

Due to the newer dhcp-server package in jessie, the entries in dhcp.leases have changed and shared-network is not exposed in there, that is where the vyatta parser module fails ( /opt/vyatta/share/perl5/Vyatta/ ) in function get_active().

hagbard changed the task status from In progress to Open.Jul 9 2018, 3:35 PM

vyatta deployed their own and modified dhcpd, their modification is to set the shared-networkname in the lease file (, which is parsed by get_active() (/opt/vyatta/share/perl5/Vyatta/
It's possible to set variables on a lease event (more events like release are possible as well, or executing scripts on a lease etc.). However, since there are multiple new features available, I think the best is to rewrite the dhcp-server (ipv4) stuff first.

The below does work, if the parser now looks for shared-networkname (line 66 in /opt/vyatta/share/perl5/Vyatta/ needs to be modified), however that feels like a nasty hack rather than a solution.
I would think to rewrite the dhcp interface first.
All opinions welcome.

ddns-update-style none;
shared-network TEST {

subnet netmask {
        default-lease-time 86400;
        max-lease-time 86400;
on commit { set shared-networkname = "TEST"; }


I implemented the hack I proposed, in my tests it did work quite well. Let me know if there are still issues.

status set to resolved. git repo needs to be merged.