OPNsense Forum

English Forums => General Discussion => Topic started by: AverageGuy on November 14, 2021, 02:59:26 PM

Title: What address range does OPNSense use to assign "stati" ip address to?
Post by: AverageGuy on November 14, 2021, 02:59:26 PM
I couldn't make the title short and complete.  I'm going to install OPNSense on a new device when it arrives.  On my consumer routers that I have used in the all have let me assign an IP address with the mac address so I have a consistent IP address on a computer.    Some have required the address be in the range of DHCP leases and some require it be outside of the lease addresses.  Which way does OPNSense do it?  I apologize if that's in the docs somewhere.  I just haven't found it, probably due to the fact I can't figure out what search terms to use.

Thanks,
Jim.
Title: Re: What address range does OPNSense use to assign "stati" ip address to?
Post by: Patrick M. Hausen on November 14, 2021, 04:29:47 PM
If you mean static DHCP assignments, then keep them outside of your dynamic range.
Title: Re: What address range does OPNSense use to assign "stati" ip address to?
Post by: AverageGuy on November 16, 2021, 11:37:37 AM
I'm sure I'm not using the right language.  I know that static as defined by changing the /etc/network/interfaces file on linux or using netplan on Ubuntu it should lie outside of the dhcp range.  On all of the routers I've had over the years there is a way to tell the router to apply a fixed IP address to a device based on it's mac address.  On the Netgear router I'm using now, it's called Address Reservation.  I recall WRT and Tomato had that feature so I assumed that OPNSense might too.  Anyway the Netgear box reserves address in the DHCP range where I think the ASUS box it replaced used addresses outside of the DHCP range.  If OPNSense has that feature, which range does it use? 
Thanks,
Jim
Title: Re: What address range does OPNSense use to assign "stati" ip address to?
Post by: Patrick M. Hausen on November 16, 2021, 12:07:41 PM
The range you define in the DHCP settings, of course. Service > DHCPv4 > LAN ...

You can define a subnet, a dynamic range within that subnet, and static reservations that should lie outside of the dynamic range but of course inside the subnet. Keeping them outside of the range is necessary because of the way the ISC DHCPd works.

For example I have my OPNSense at address 192.168.1.1 in the subnet 192.168.1.0/24.
I defined a dynamic range from 192.168.1.128 to 192.168.1.254. And I created various static reservations in the range from .2 to .127.

But that is really all up to you - it's a configuration question.
Title: Re: What address range does OPNSense use to assign "stati" ip address to?
Post by: AverageGuy on November 16, 2021, 01:10:36 PM
Thank you.  That's what I was looking for.  The static mappings I'm using are all in the range 10-100 so I'll start my dhcp lease range at something above 100 when ever the new hardware arrives,

Jim.