OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: j_s on April 18, 2021, 01:41:41 AM

Title: Making dhcp server respond faster
Post by: j_s on April 18, 2021, 01:41:41 AM
I've had this nagging 'issue' for years, and I've never bothered to ask anyone.  The issue doesn't seem to be limited to my config, and it also seems to occur in pfsense, so I'm assuming that this is a 'by design' behavior.

When I plug in a desktop, laptop, etc DHCP doesn't respond on the first request.  I know this because I've done tcpdumps and watch 3-5 DHCP request go out before we get a reply from the opnsense box.

Now my questions:

1.  Is this actually 'by design'?
2.  If it is, can I change it somwhere to respond immediately?
3.  Is there a reason why it's deliberately made to not respond on the first request by default?
4.  If #3 is yes, why?

Trying to use this as a learning opportunity as well as change the behavior if possible.  I'm guessing there's a ton of info on this on the internet, and I cannot be the only one to notice this behavior.  But any keywords I've tried haven't really answered these 4 burning questions.

Thanks!
Title: Re: Making dhcp server respond faster
Post by: allebone on April 18, 2021, 02:42:30 AM
Check /var/dhcpd/etc/dhvpd.conf to see if conflict detection is true or false. If its on, it will try ping that ip first before leasing it to ensure its unused.
Title: Re: Making dhcp server respond faster
Post by: j_s on April 18, 2021, 03:35:56 AM
Thanks for the reply.  update-conflict-detection is false.

Title: Re: Making dhcp server respond faster
Post by: allebone on April 18, 2021, 08:04:11 PM
Then I dont know.
Title: Re: Making dhcp server respond faster
Post by: chemlud on April 18, 2021, 08:11:31 PM
1 0.000000 0.0.0.0 255.255.255.255 DHCP 335 DHCP Discover - Transaction ID 0x67bae409
2 0.000091 192.168.77.1 192.168.77.3 DHCP 342 DHCP Offer    - Transaction ID 0x67bae409
3 0.000708 0.0.0.0 255.255.255.255 DHCP 341 DHCP Request  - Transaction ID 0x67bae409
4 0.000774 192.168.77.1 192.168.77.3 DHCP 342 DHCP ACK      - Transaction ID 0x67bae409


Hmm, can't confim any issues...
Title: Re: Making dhcp server respond faster
Post by: Patrick M. Hausen on April 18, 2021, 08:19:50 PM
Did you do the packet trace on the OPNsense or on the client sending the DHCP request. I.e. do the requests definitely reach the OPNsense system? Could the switch keep the port from forwarding for 30 seconds because of bridge/loop detection?
Title: Re: Making dhcp server respond faster
Post by: j_s on April 21, 2021, 06:57:42 AM
Quote from: pmhausen on April 18, 2021, 08:19:50 PM
Did you do the packet trace on the OPNsense or on the client sending the DHCP request. I.e. do the requests definitely reach the OPNsense system? Could the switch keep the port from forwarding for 30 seconds because of bridge/loop detection?

To be honest, I was/am pretty sure I've always done it on the client machine.  So I checked on the opnsense side, and sure enough, it responds every time a dhcp request makes it to the opnsense box.  So it's not the opensense.

But now I'm not sure what would trigger this behavior.  Right now I'm eyeballing spanning tree being set to port-fast.  I'm wondering if disabling it completely would solve the problem.
Title: Re: Making dhcp server respond faster
Post by: Fright on April 21, 2021, 02:10:17 PM
QuoteRight now I'm eyeballing spanning tree being set to port-fast.  I'm wondering if disabling it completely would solve the problem
yes, switching ports to port-fast allows the cisco to make the port work instantly