OPNsense Forum

English Forums => General Discussion => Topic started by: hakuna on July 29, 2023, 11:23:25 am

Title: DHCP giving IP Address that are already leased to other devices
Post by: hakuna on July 29, 2023, 11:23:25 am
I am not really sure when this started happening since I don't add new devices to my network.

But I am redeploying my Proxmox and all, setting up new VMs, I noticed that all the VMs are receiving IP Addresses leased to my tablet, my Xbox, you name it.
I connected this thin client on the network and it got the same IP as my Air Filter. But that is a static IP.
I have no idea what is going on.

The only major network change I made few weeks back was to set 2 VLANs but there was no issues and everything is working as expected.

And the DHCP log is full of errors like:

"Error   dhcpd   from the dynamic address pool for 192.168.1.0/24"
"Dynamic and static leases present for 192.168.1.43."
"Remove host declaration s_lan_23 or remove 192.168.1.43"

Of course the IP and lease number changes but what the heck?

According to the logs this has been going on forever.


(https://cdn.discordapp.com/attachments/713037374686494873/1134772873760878685/image.png)
Title: Re: DHCP giving IP Address that are already leased to other devices
Post by: hakuna on July 30, 2023, 04:18:18 am
I had to deleted all the leases which cleaned the log errors but still showing errors like Dynamic and static leases present for clients that have no static IP at all since the OPNSense DHCP is the one doing that.
Title: Re: DHCP giving IP Address that are already leased to other devices
Post by: Patrick M. Hausen on July 30, 2023, 07:58:13 am
The dynamic range and the static entries must not overlap.
Title: Re: DHCP giving IP Address that are already leased to other devices
Post by: hakuna on July 30, 2023, 02:58:45 pm
The dynamic range and the static entries must not overlap.

Yep, it looks like I have been doing this wrong for years and only noticed it now due to something non related sending me to the logs where I saw the errors.
Pool has been changed and the log is clean now.

Thank you
Title: Re: DHCP giving IP Address that are already leased to other devices
Post by: pankaj on July 31, 2023, 12:55:53 am
I run couple of VLANs on my home network and faced the same problem as you, the root cause was that I was assigning static addresses that were inside the DHCP range. And I ended up with following policies on home LAN:

1. For IoTs VLAN - no DHCP and all devices are assigned static address, this has also helped reduced lot of network clutter as 50+ devices are not broadcasting any more over WiFi.

2. Other VLANs - I take out a reasonable number of IP addresses from the DHCP range (from the start of the subnet) for static assignment and leave the rest for DHCP.

HTH
Title: Re: DHCP giving IP Address that are already leased to other devices
Post by: CJ on July 31, 2023, 04:28:31 pm
I run couple of VLANs on my home network and faced the same problem as you, the root cause was that I was assigning static addresses that were inside the DHCP range. And I ended up with following policies on home LAN:

1. For IoTs VLAN - no DHCP and all devices are assigned static address, this has also helped reduced lot of network clutter as 50+ devices are not broadcasting any more over WiFi.

2. Other VLANs - I take out a reasonable number of IP addresses from the DHCP range (from the start of the subnet) for static assignment and leave the rest for DHCP.

HTH

What I generally recommend is that people use DHCP with a small range to bootstrap things and then use the rest of the range to assign static leases. This helps make it easier to get the MAC and other info regarding the machine and makes it so you're not automatically hosed if you forget to create a static lease.