Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Get ip from a specific dhcp range

    Scheduled Pinned Locked Moved DHCP and DNS
    7 Posts 4 Posters 2.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      nikkon
      last edited by

      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.

      pfsense 2.3.4 on Supermicro A1SRi-2758F + 8GB ECC + SSD

      Happy PfSense user :)

      1 Reply Last reply Reply Quote 0
      • KOMK
        KOM
        last edited by

        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?

        1 Reply Last reply Reply Quote 0
        • N
          nikkon
          last edited by

          ~50 vm's

          pfsense 2.3.4 on Supermicro A1SRi-2758F + 8GB ECC + SSD

          Happy PfSense user :)

          1 Reply Last reply Reply Quote 0
          • N
            nikkon
            last edited by

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

            pfsense 2.3.4 on Supermicro A1SRi-2758F + 8GB ECC + SSD

            Happy PfSense user :)

            1 Reply Last reply Reply Quote 0
            • KOMK
              KOM
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by

                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.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  ^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.

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.