OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • High availability »
  • DHCPD is stuck in recover state
« previous next »
  • Print
Pages: [1]

Author Topic: DHCPD is stuck in recover state  (Read 7201 times)

Vladiss

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
DHCPD is stuck in recover state
« on: January 28, 2021, 02:31:34 pm »
Hello people,

I have CARP enabled in my lab setup. It works just fine except for DHCP server on LAN - it just won't start. OPNsense version is 20.7.8. The nodes are configured as follows:

Primary: 192.168.1.10/24
Secondary: 192.168.1.20/24
Virtual IP: 192.168.1.1/24
DHCP scope: 192.168.1.100-199

Primary dhcpd.conf :

Code: [Select]
option domain-name "localdomain";
option ldap-server code 95 = text;
option arch code 93 = unsigned integer 16; # RFC4578
option pac-webui code 252 = text;

default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
one-lease-per-client true;
deny duplicates;
ping-check true;
update-conflict-detection false;
authoritative;
failover peer "dhcp_lan" {
  primary;
  address 192.168.1.10;
  port 519;
  peer address 192.168.1.20;
  peer port 520;
  max-response-delay 10;
  max-unacked-updates 10;
  split 128;
  mclt 600;

  load balance max seconds 3;
}


subnet 192.168.1.0 netmask 255.255.255.0 {
  pool {
    deny dynamic bootp clients;
    failover peer "dhcp_lan";
    range 192.168.1.100 192.168.1.199;
  }

  option routers 192.168.1.1;
 
}

Secondary dhcpd.conf:

Code: [Select]
option domain-name "localdomain";
option ldap-server code 95 = text;
option arch code 93 = unsigned integer 16; # RFC4578
option pac-webui code 252 = text;

default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
one-lease-per-client true;
deny duplicates;
ping-check true;
update-conflict-detection false;
authoritative;
failover peer "dhcp_lan" {
  secondary;
  address 192.168.1.20;
  port 520;
  peer address 192.168.1.10;
  peer port 519;
  max-response-delay 10;
  max-unacked-updates 10;

  load balance max seconds 3;
}


subnet 192.168.1.0 netmask 255.255.255.0 {
  pool {
    deny dynamic bootp clients;
    failover peer "dhcp_lan";
    range 192.168.1.100 192.168.1.199;
  }

  option routers 192.168.1.1;

}

After starting dhcpd service, both nodes enter recover state. Log entries say
Code: [Select]
dhcpd[99045] failover peer dhcp_lan: I move from startup to recover
DHCPv4/Leases tab on both nodes says
Code: [Select]
My State: recover
Peer State: unknown-state

Please help. Thanks!
Logged

ednt

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 2
    • View Profile
Re: DHCPD is stuck in recover state
« Reply #1 on: February 05, 2021, 10:36:29 am »
I have a similar problem.

After searching for a solution, I dicovered that for dhcp failover also port 647 UDP/TCP is needed.
Is this true?

This port is not enabled by the automatic generated rules.
Logged

ednt

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 2
    • View Profile
Re: DHCPD is stuck in recover state
« Reply #2 on: February 05, 2021, 11:47:25 am »
I just tested it and it failed.

I saw also no traffic on port 647 or 847.

Then I checked /var/dhcp/etc/dhcpd.conf
and found out that isc dhcp uses different ports for failover.

In my case 519 and 520.
« Last Edit: February 05, 2021, 01:19:47 pm by ednt »
Logged

ednt

  • Jr. Member
  • **
  • Posts: 51
  • Karma: 2
    • View Profile
Re: DHCPD is stuck in recover state
« Reply #3 on: February 05, 2021, 01:21:54 pm »
Ok, the ports where automatically enabled. (519,520)

In our case it was a problem of the NAT outbound rules:

This firewall should not use the VIP address when the destination is in the same net.
So invert destination and use as destination net the net of the rule.
Logged

Vladiss

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: DHCPD is stuck in recover state
« Reply #4 on: February 15, 2021, 03:29:51 pm »
Well it's definitely not the case with my setup - I disabled NAT completely, OPNsense boxes work just as a gateway between LANs. So I'm still confused :(
Logged

makanu

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: DHCPD is stuck in recover state
« Reply #5 on: March 13, 2023, 11:18:29 am »
Quote from: ednt on February 05, 2021, 01:21:54 pm
Ok, the ports where automatically enabled. (519,520)

In our case it was a problem of the NAT outbound rules:

This firewall should not use the VIP address when the destination is in the same net.
So invert destination and use as destination net the net of the rule.

As I am browsing the logs and comparing the configs I think our setup might have the same issue. Sadly I do not understand your solution with the NAT outbound rules. At least the last sentence makes no sense for me.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • High availability »
  • DHCPD is stuck in recover state
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2