Get ip from a specific dhcp range



  • Hi all,

    I have a situation:
    I have a dhcp server and a range.
    network 192.168.100.0/24
    first scope 100.15–100.30
    I have defined a second range 100.50 -- 100.100 and i try to force the esxi server(and all vms) to get ip's from this one.
    Can it be done from PFsense somehow?

    Thank you.



  • I don't think so based on how DHCP works, but I've been wrong once or twice in my life before.  I wouldn't use dynamic IP for my VM hosts.  Do you have so many clients that you can't use static IPs for your known devices?



  • ~50 vm's



  • I was thinking to use somehow the mac address of the esxi server.



  • I was thinking to use somehow the mac address of the esxi server.

    This will work via static mapping in the DHCP Server config but then you may as well use static IP if you're going to have to manually enter anything.  I never saw the point of leaving a client as dynamic and then plugging in a static mapping to one specific IP… just make it static IP to start with.  Perhaps if you have devices that are hard-wired for DHCP then I can see a use case, but in general I don't know what advantage you get from dynamic clients with static mappings.  It doesn't seem to lighten the admin load any.

    Your DHCP issue still exists because there is no way for the server to issue a conditional lease to an unknown client.  It will use the next available IP in the pool, regardless of your defined ranges, so oyu will never be able to specify pool A versus pool B.  The client will broadcast a request and the first available DHCP server will respond with a lease.


  • LAYER 8 Global Moderator

    what advantage you get from dynamic clients with static mappings

    The ability to update options to those clients without touching them, say change in your gateway, change in ntp, change in dns, all the options available in dhcp - which are lots and lots can all be updated to the clients without having to touch them.  While you might want that host to always be IP address X, doesn't mean you won't be handing out other info.

    Also if IP address is given out via dhcp, you can always change it to something else when the need comes about without having to actually touch the host again.  Say for example you need to re ip the segment to something else.. If you set the static on the host you would have to go touch everything.. If you hand out stuff with dhcp simple release/renew/reboot and your on your new IP range, etc.

    I really can not think of a reason why you shouldn't use dhcp reservation vs actual set static.. You limit your options when you do with static on the device.

    As to the OP question - no there is no way to have client pull from specific pool when you have multiple.  Other than since you say your clients are all VM's so that means they would have same vendor for mac.. So with the use of the mac address controls in pfsense you could set the VM mac to be ignored in your 1st pool, and allowed in the 2nd pool, etc.  I believe you might be able to get this to work??  Have not actually tested this.. When I get a chance I will.  You will prob want to use the "Denied clients will be ignored rather than rejected." checkbox as well.

    To be honest might be easier to just let them get IPs.. Find them in your dhcp leases then set them up to be something specific and let them reboot or release renew to get the new IP in whatever range that is not in your pools you want them to be, etc.


  • Rebel Alliance Developer Netgate

    ^that. Use the vendor MACs range to setup controls so that all VMware MACs get served from the one pool.

    For example, deny "00:0c:29,00:50:56" from the main pool and allow "00:0c:29,00:50:56" in the second pool.

    That should catch all automatic and manual VMware MACs.


Log in to reply