[SOLVED] Two question about DHCP

Started by WhiteTiger, June 21, 2020, 06:55:55 PM

Previous topic - Next topic
June 21, 2020, 06:55:55 PM Last Edit: June 24, 2020, 09:44:00 AM by WhiteTiger
I'm new to OPNSense, so sorry if my questions are trivial.
I want to use DHCP on the network and I want some addresses to be assigned based on the MAC Address.
But if I ask to do it with a PC that has already had an address from DHCP, I am forced to assign it another address.
I give an example.
DHCP from 192.168.100.101 to 192.168.100.199.
The first PC is assigned 192.168.100.101.
If now I want this address to be always assigned to it, an error appears because this address falls in the range 101-199. I am forced to give it as an example 192.168.100.201.

I also find it annoying that I have to assign all the fields by hand (mask, gateway, domain, etc.) when they are already defined by DHCP and above all already assigned to this PC.
If there are few PCs it is not a problem to assign these values by hand, but if there are dozens besides being a long job it is also easy to make mistakes
So, I would expect all values to be copied, not just IP and MAC.
Is there a way to copy all these values?

Any statically assigned device should live outside of the dhcp range. For example my dhcp network  range is 100 to 199. My servers live between .3 and .39, my network switches and WAP points live between 230 and 250.


When a device connects all you need to do is go to the leases table, click the plus symbol to add a static lease, all you need to do is enter the IP address you want the device to have, and that address MUST be outside the dhcp range you have set. Its a limitation of the server.
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Quote from: marjohn56 on June 21, 2020, 09:51:50 PM
Any statically assigned device should live outside of the dhcp range.
...
When a device connects all you need to do is go to the leases table, click the plus symbol to add a static lease, all you need to do is enter the IP address you want the device to have, and that address MUST be outside the dhcp range you have set. Its a limitation of the server.
They are two different things.
It is right that the static address is outside the DHCP range, but another thing is that DHCP reserves some addresses to certain machines already known by it.
Evidently OPNSense assigns static addresses not static leases.
I have to rearrange my way of thinking about assigning addresses.

The second question remains: is there a way to "inherit" all the previously assigned information (gateway, mask, domain, etc.) without having to type all again?

As I said just enter the IP address you want to assign to the mac address. Everything else will default to what's in your dhcp settings. If you click on the help icons they say they will use the defaults.
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Quote from: marjohn56 on June 22, 2020, 10:29:42 AM
As I said just enter the IP address you want to assign to the mac address. Everything else will default to what's in your dhcp settings. If you click on the help icons they say they will use the defaults.

OK, many thanks