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

    Exclude an ip range in DHCP server scope

    Scheduled Pinned Locked Moved DHCP and DNS
    6 Posts 4 Posters 7.3k 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.
    • B
      bushtor
      last edited by

      Hi,

      One of my interfaces is on 192.168.45.0/23

      I want to enable a dhcp server with scope range from 192.168.45.50 .. 192.168.46.200 WHILE I also EXCLUDE the range 192.168.46.1 .. 192.168.46.49 from the same scope.

      How do I do that…?

      regards

      Tor

      1 Reply Last reply Reply Quote 0
      • M
        Metu69salemi
        last edited by

        http://www.subnet-calculator.com/cidr.php
        Based on that calculator, you can't do that.. if you don't believe calculate with binary notation..

        1 Reply Last reply Reply Quote 0
        • B
          bushtor
          last edited by

          I didn't want to define it with binary notation, I asked for either a possibility to exclude a subrange from inside a larger scope or a possibility to define two scope ranges.  The latter I have always used with dhcpd in linux, like this:

          subnet 192.168.100.0 netmask 255.255.254.0 {
                  range 192.168.101.200 192.168.101.50;
                  range 192.168.100.200 192.168.100.50;
                  option subnet-mask 255.255.254.0;
                  option broadcast-address 192.168.100.255;
                  option routers 192.168.100.1;
                  option domain-name-servers 192.168.100.10,192.168.100.11;
                  option netbios-name-servers 192.168.100.10;
          }

          Can I define something like this manually in pfsense too…?

          Secondly, if I do some scripting for such manually settings, where can I put the script to have it run automatically each time after the webinterface has updated or modified something...?

          Thanks for comments on this

          regards Tor

          1 Reply Last reply Reply Quote 0
          • D
            dLockers
            last edited by

            @Metu69salemi:

            http://www.subnet-calculator.com/cidr.php
            Based on that calculator, you can't do that.. if you don't believe calculate with binary notation..

            Whilst they're on the same network there is no reason why you shouldn't be able to exclude them from DHCP, a completely unrelated network protocol.

            In PfSense however, I have no idea.

            1 Reply Last reply Reply Quote 0
            • M
              Metu69salemi
              last edited by

              First of all:
              192.168.44.0/23 = 192.168.44.0 - 192.168.45.255 is on same network
              192.168.46.0/23 = 192.168.46.0 - 192.168.47.255 is on same network

              192.168.45.0 /23 is not on same network as 192.168.46.0 /23

              And secondly: I don't think that excluding is possible, unless you modify php checking and you give those exluded ip's as static entries.

              1 Reply Last reply Reply Quote 0
              • C
                cmb
                last edited by

                only one range is supported, you'd have to hack the source to do that. dhcpd.conf comes from /etc/inc/services.inc IIRC.

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