Page MenuHomePhabricator

DHCP with VRRP
Closed, ResolvedPublic

Description

As per http://forum.vyos.net/showthread.php?tid=26854

Hi Guys

I maintain a separate network for my Wifi Clients that consists of two VyOS VMs running VRRP between them (for the gateway).

Each VM has a unique IP in 10.0.4.0/24 and VRRP is configured for 10.0.4.1 address. These two VMs also provide DHCP for this subnet and is configured using DHCP failover. Prior to this setup I was running a standalone VyOS VM (also DHCP) and had no problems whatsoever

Since replacing it with this new VRRP pair however, I'm getting a lot more disconnects from my wifi clients and I suspect its to do with DHCP. As per the below, you can see there's a lot of DHCP leases for the same IP/MAC and I'm not too sure if this is a possible problem - As an aside, I've seen that the VRRP master responds to DHCP requests from both 10.0.4.1 and 10.0.4.2 at the same time (with the same offer).

Does anyone have any thoughts on this?

> root@vy-gw-a:~# show vrrp detail
> --------------------------------------------------
> Interface: eth2
> --------------
>   Group: 100
>   ----------
>   State:                        MASTER
>   Last transition:              2d9h44s
> 
>   RFC 3768 Compliant
>   Virtual MAC interface:        eth2v100
>   Address Owner:                no
> 
>   Source Address:               10.0.4.2
>   Priority:                     100
>   Advertisement interval:       1 sec
>   Authentication type:          IPSEC_AH
>   Preempt:                      enabled
> 
>   Sync-group:                   SYNC
> 
>   VIP count:                    1
>     10.0.4.1/24
> 
> root@vy-gw-a:~# 
> root@vy-gw-a:~# show configuration commands  | grep dhcp
> set service dhcp-server disabled 'false'
> set service dhcp-server shared-network-name DHCPPOOL1 authoritative 'disable'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 default-router '10.0.4.1'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 dns-server '10.0.4.1'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 domain-name 'mydomain.com'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 failover local-address '10.0.4.2'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 failover name 'DHCP-HA'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 failover peer-address '10.0.4.3'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 failover status 'primary'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 lease '7200'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 start 10.0.4.10 stop '10.0.4.50'
> root@vy-gw-a:~# 
> root@vy-gw-a:~# show dhcp server leases
> 
> IP address       Hardware address   Lease expiration     Pool                      Client Name
> ----------       ----------------   ----------------     ----                      -----------
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 21:09:52  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.30        14:dd:xx:xx:xx:xx  2016/11/07 21:10:08  DHCPPOOL1                android-d9c1cxxxxxxxxxxx
> root@vy-gw-a:~#

and the other router

> root@vy-gw-b:~# show vrrp detail
> --------------------------------------------------
> Interface: eth2
> --------------
>   Group: 100
>   ----------
>   State:                        BACKUP
>   Last transition:              10h7m40s
> 
>   Master router:                10.0.4.2
>   Master priority:              100
> 
>   RFC 3768 Compliant
>   Virtual MAC interface:        eth2v100
>   Address Owner:                no
> 
>   Source Address:               10.0.4.3
>   Priority:                     50
>   Advertisement interval:       1 sec
>   Authentication type:          IPSEC_AH
>   Preempt:                      enabled
> 
>   Sync-group:                   SYNC
> 
>   VIP count:                    1
>     10.0.4.1/24
> 
> root@vy-gw-b:~#
> root@vy-gw-b:~# show configuration commands | grep dhcp
> set service dhcp-server disabled 'false'
> set service dhcp-server shared-network-name DHCPPOOL1 authoritative 'disable'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 default-router '10.0.4.1'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 dns-server '10.0.4.1'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 domain-name 'mydomain.com'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 failover local-address '10.0.4.3'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 failover name 'DHCP-HA'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 failover peer-address '10.0.4.2'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 failover status 'secondary'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 lease '7200'
> set service dhcp-server shared-network-name DHCPPOOL1 subnet 10.0.4.0/24 start 10.0.4.10 stop '10.0.4.50'
> root@vy-gw-b:~# 
> root@vy-gw-b:~# show dhcp server leases 
> 
> IP address       Hardware address   Lease expiration     Pool                      Client Name
> ----------       ----------------   ----------------     ----                      -----------
> 10.0.4.30        14:dd:xx:xx:xx:xx  2016/11/07 20:10:08  DHCPPOOL1                android-d9c1cxxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/08 05:43:20  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:13:33  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:13:33  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:13:33  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:16:22  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:16:22  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:16:22  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:25:08  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:25:08  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:25:08  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:37:16  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:37:16  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:37:16  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:43:53  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:43:53  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:43:53  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:49:49  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:49:49  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:49:49  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:55:06  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:55:06  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 20:55:06  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 21:09:52  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 21:09:52  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.29        ac:37:xx:xx:xx:xx  2016/11/07 21:09:52  DHCPPOOL1                android-38538xxxxxxxxxxx
> 10.0.4.30        14:dd:xx:xx:xx:xx  2016/11/07 21:10:08  DHCPPOOL1                android-d9c1cxxxxxxxxxxx
> root@vy-gw-b:~#

Details

Difficulty level
Normal (likely a few hours)
Version
-

Related Objects

Event Timeline

syncer triaged this task as Normal priority.Nov 9 2016, 11:02 AM
syncer added a project: VyOS 1.1.x (1.1.8).

@EwaldvanGeffen I recall you had tested something similar in terms of setup of DHCP
can you assist here?
Suspecting some issues there

@tsumaru720 please post output of

show configuration |strip-private

here or any other paste service
Thanks!

When doing DHCP-FO it's intentional both machines send out a lease. The duplicate 'lease' issue in the show statements should've been resolved in latest versions IIRC. Which version are you running?

@EwaldvanGeffen

simon@vy-gw-a:~$ show version
Version:      VyOS 1.1.7
Description:  VyOS 1.1.7 (helium)                                                                                                                                                     
Copyright:    2016 VyOS maintainers and contributors                                                                                                                                  
Built by:     maintainers@vyos.net                                                                                                                                                    
Built on:     Wed Feb 17 09:57:31 UTC 2016
Build ID:     1602170957-4459750
System type:  x86 64-bit
Boot via:     image
Hypervisor:   KVM
HW model:     Standard PC (i440FX + PIIX, 1996)
HW S/N:       Not Specified
HW UUID:      7FD7FCB0-0515-3347-B1CF-10CA6690F0C7
Uptime:       09:49:13 up 3 days,  8:15,  2 users,  load average: 0.02, 0.02, 0.05

I used the "Latest Stable" ISO from your website about 2 weeks ago

syncer reassigned this task from syncer to EwaldvanGeffen.Nov 13 2016, 4:44 PM
syncer added a subscriber: dmbaturin.
syncer added a subscriber: syncer.

@dmbaturin this is candidate for 1.1.8 too
@EwaldvanGeffen, as you more aware, any ideas why it happens again?
Thanks!

Could this patch be your solution. I remember there was the duplicate print effect when using DHCP-FO on the entries in the lease file in a specific condition that I've made it to ignore.

syncer removed a subscriber: VyOS 1.1.x (1.1.8).

@tsumaru720 Could you provide feedback?

@EwaldvanGeffen not sure how to apply the patch

As an aside, I don't currently have any VyOS VMs set up as DHCP servers currently but will in a few weeks on a new deployment

syncer changed the edit policy from "Public (No Login Required)" to "Custom Policy".Aug 21 2017, 2:41 AM
syncer edited projects, added VyOS 1.1.x (1.1.8); removed VyOS 1.1.x.
syncer set Version to -.
syncer edited subscribers, added: Maintainers; removed: dmbaturin, syncer, VyOS 1.1.x.

@EwaldvanGeffen can this patch go to 1.1.8?

syncer added a subscriber: dmbaturin.

@EwaldvanGeffen confirmed that fix was done for 1.1.x
@dmbaturin can you merge it and introduce in 1.1.8 ?

Harliff added a subscriber: Harliff.EditedNov 19 2017, 10:38 PM

Gentlemen, you've forgot to add this fix to the changelog.

Seem like this issue still in vyos 1.2. Would please check it and fix it ?