Page MenuHomePhabricator

Change dhcp lease couting funcition
Needs testing, Requires assessmentPublicFEATURE REQUEST

Description

Dear, Developers

I build 2 vyos in vrrp mode. and then I setup dhcp server on 2 vyos in failure over mode. It works great. But I met a problems that is a lot o f duplicate record of lease .

vyos@vrrp01.gctest.net# run show dhcp server  leases 
IP address     Hardware address    Lease expiration     Pool       Client Name
-------------  ------------------  -------------------  ---------  -------------
192.168.1.179  50:00:00:07:00:00   2019/05/11 23:47:28  dhcppool1  client04
192.168.1.177  50:00:00:04:00:00   2019/05/12 00:24:12  dhcppool1  vyosclient02
192.168.1.178  50:00:00:03:00:00   2019/05/12 00:27:03  dhcppool1  vyosclient01
192.168.1.100  50:00:00:06:00:00   2019/05/12 01:17:28  dhcppool1  vyosclient03
192.168.1.100  50:00:00:06:00:00   2019/05/12 01:17:28  dhcppool1  vyosclient03
192.168.1.179  50:00:00:07:00:00   2019/05/12 01:22:59  dhcppool1  client04
192.168.1.179  50:00:00:07:00:00   2019/05/12 01:22:59  dhcppool1  client04
192.168.1.177  50:00:00:04:00:00   2019/05/12 01:59:46  dhcppool1  vyosclient02
192.168.1.177  50:00:00:04:00:00   2019/05/12 01:59:46  dhcppool1  vyosclient02
192.168.1.178  50:00:00:03:00:00   2019/05/12 02:02:30  dhcppool1  vyosclient01
192.168.1.178  50:00:00:03:00:00   2019/05/12 02:02:30  dhcppool1  vyosclient01
[edit]

only 4 ip address was leased but the counting number is 11. That was not right. Can we fixed this issue ?

vyos@vrrp01.gctest.net# run show dhcp server  statistics 
Pool         Size    Leases    Available  Usage
---------  ------  --------  -----------  -------
dhcppool1     154        11          143  0%
[edit]

my vyos version is:

vyos@vrrp01.gctest.net# run show version
Version:          VyOS 1.2.1
Built by:         Sentrium S.L.
Built on:         Sun 14 Apr 2019 12:13 UTC
Build ID:         4ccd819a-db31-452e-b34b-a0b24af4e984

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

Hardware vendor:  Bochs
Hardware model:   Bochs
Hardware S/N:     Unknown
Hardware UUID:    Unknown

Copyright:        VyOS maintainers and contributors
[edit]

Yours Sincerely!
Steve Dong

Details

Difficulty level
Unknown (require assessment)
Version
vyos 1.2.1 release
Why the issue appeared?
Will be filled on close

Event Timeline

dongjunbo updated the task description. (Show Details)
dongjunbo updated the task description. (Show Details)May 12 2019, 1:59 AM
dongjunbo edited projects, added VyOS 1.2 Crux (VyOS 1.2.0-GA); removed VyOS 1.2 Crux.
dongjunbo changed Version from - to vyos 1.2.1 release.
pasik added a subscriber: pasik.May 23 2019, 6:52 AM
zsdc added a subscriber: zsdc.Jun 4 2019, 12:38 PM

This bug must be fixed in current rolling, because of T1416. @dongjunbo, check this, please.

dmbaturin changed the task status from Open to Needs testing.Sat, Jun 22, 11:54 AM
zsdc added a comment.Wed, Jun 26, 3:26 PM

Seem like static counting still not right

@dongjunbo, show please the configuration of this router so we could check why gcdomestic pool does not count correctly.

jjakob added a subscriber: jjakob.Wed, Jun 26, 5:08 PM

@zsdc I'm thinking of partially rewriting show_dhcp.py soon. You can wait a few days if it's not urgent.
@dongjunbo please attach your /config/dhcpd.leases as a file so we can test the code against it. You can sanitize it manually of MAC addresses if you prefer.