DHCP Reservations?

Started by hunterjwizzard, February 22, 2022, 03:54:16 AM

Previous topic - Next topic
Hey folks,

I've been scouring the documentation and settings, but for the life of me I can't figure out how to set up DHCP reservations. Is it called something different on OPNsense?

DHCP static mappings?

opnsense-services DHCPv4 (or V6) - leases and hit the + to make a static mapping
Deciso DEC850v2

That did the trick! Thanks!

Now to figure out why a few of my devices are not appearing on the OPNsense lease table...

maybe those devices are not active at the moment, when at DHCP - leases scroll down on that page and hit the button [show all configured leases]

maybe than they show up?
Deciso DEC850v2

They'll show up once their current lease lapses, request a new one, and the defined ip is given.

The devices in question are IP cameras, currently streaming a live image to my NVR. They are definitely active. They also show as active according to an IP scanner. I'm sure they'll show up eventually but it is odd that the router says there are 42 active leases but the scanner is finding 50.

Just reboot the (WiFi)router and see what happens when they all get reconnected and show up in opnsense.
Deciso DEC850v2

Cameras are all wired(pro tip: do not use wifi cameras. They can be jammed with a $20 router some hacked russian firmware). But I will be rebooting the OPNsense this Saturday for some maintenance. We'll see if they show up then.

If you reboot the camera, it will force it to request an ip address. This is the cleanest way unless you can ssh to the camera and force a dhcp client restart or has a management interface that allows you to do that. An ifdown followed by an ifup would also be the next best thing. Given that most cameras don't have an easy way to do that, a reboot is often necessary.

Tried that - camera came right back up on its old IP address and still not detected on OPNsense. Very strange. There's probably a reset button on the camera I can try.

Can you show the pool you have setup and the reservations?
Services > DHCPv4 > Interface . what is your range?
Then below on "DHCP Static Mappings for this interface." does the camera should appear with an ip?
Then in Services > DHCPv4 > Leases  - here you can add a static lease with the + sign
You might have done all this already.
The next thing is to check the logs. Seems to need to be changed to informational. Look for messages there after powercycling the camera.

My DHCP range is 192.168.1.1 - 192.168.1.254

There are six cameras total, four have been static-mapped to ​251-254, those are working fine. The last two cameras are on .2 and .73. While we're on he subject the NVR itself is on .60. All three of those fail to appear on the leases map.


Checking the  logs, this is probably unrelated but I am seeing a bunch of errors like:

uid lease 192.168.1.197 for client 74:ee:2a:fe:38:d2 is duplicate on 192.168.1.0/24


Not sure if that means anything.


So because it couldn't hurt, I just bounced power to the camera on .2, just unplugged the POE injector since it happens to be near my desk, waited until it stopped appearing on the NVR, then put it back.

Same as before, camera came right back up on the same IP and was immediately detected by the NVR. It did not generate any messages in the log file.

QuoteMy DHCP range is 192.168.1.1 - 192.168.1.254
Ok but what is your available range for dynamic allocation? The point being you should have a pool for dynamic allocation within your "Available range" that is separate from the static leases pool.
So let's say you have an Available range of :192.168.5.1 - 192.168.5.254
Then you could have a "range" 'from' 192.168.5.150 'to' 192.168.5.180. These will be used dynamically.
Then you could allocate reserved ips outside it and avoid collisions.

This might not be the problem at the moment though.
What I normally do to avoid mac typos is in the "DHCP Static Mappings for this interface." list, I find the device, click on the pencil button that takes it to the "Static DHCP Mapping" and add the IP I want to give it there. The same can be done from the leases page. A powercycle of the client device (not opn) later and it gets the allocated ip.
If that doesn't work for these cameras, I'm out of ideas.

Right, sorry, the range is 192.168.1.10 to 192.168.1.245. This might explain why the camera at .2 is having a problem.

Quote from: cookiemonster on February 25, 2022, 01:18:10 PM
What I normally do to avoid mac typos is in the "DHCP Static Mappings for this interface." list, I find the device, click on the pencil button that takes it to the "Static DHCP Mapping" and add the IP I want to give it there. The same can be done from the leases page. A powercycle of the client device (not opn) later and it gets the allocated ip.
If that doesn't work for these cameras, I'm out of ideas.

That's exactly what I've been doing - the issue is that two of the cameras and the NVR are not appearing on the lease map at all. Along with 5 other active devices. It's very strange.

Anyway I've got a maintenance window tomorrow where the router will be coming down. Going to reboot the NVR and cycle the last 2 cameras again. I'll figure it out eventually.

I have it also like cookie monster is saying.

When you hit the + for static, give that device an ip outside of your ->
services-dhcp4-lan: Range 192.168.1.10 - 192.168.1.245.

So that is why cam 251,252 til 254 are working, those are outside the dynamic range.
Try giving the devices with static ip inside the range an ip outside the range (250,249,248 etc) and I think it will solve the problem of not connecting.
Deciso DEC850v2