The pfSense Store

Author Topic: TESTING NEEDED: Multiple DHCP pools within a subnet  (Read 19687 times)

0 Members and 1 Guest are viewing this topic.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #15 on: December 26, 2012, 11:58:38 am »
Hmm that DNS config looks OK, not sure why it didn't go to the client properly.

Also static mappings are not pool specific, they are global for an interface. You can't define a static mapping inside a pool.
I made a commit earlier today to remove the static mapping list from the pool page since it's not relevant.

To control who gets into a specific pool you need to use the allow/deny MAC boxes. At the moment they're just comma-separated lists. they could be changed into lists (like aliases) in the future if we get a proper web developer position filled.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline robfantini

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #16 on: December 26, 2012, 12:44:02 pm »
tried using the mac address allow, saved  changes and then restarted dhcp server [ not sure is restart is needed ]  rebooted the client and still wrong dns in resolv.conf .   

maybe  the client is asking for and getting the old lease information.  is there a place to clear the cache?


Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #17 on: December 26, 2012, 01:49:45 pm »
The client could be remembering it, that varies by OS but it may be in /tmp/ or /var/ somewhere. (I think it's /var/lib/dhclient/dhclient.leases but on FreeBSD it's in /var/db/dhclient/dhclient.leases I think, or thereabouts)

On pfSense the server's lease database is under /var/dhcpd/var/db/ but you can clear individual leases from the GUI by clicking the 'x' next to the lease under Status > DHCP Leases. Failing that, stop the dhcp service, rm the leases files(s), then restart it.

Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #18 on: December 26, 2012, 02:16:07 pm »
I just did a quick test in a VM:

Code: [Select]
option domain-name "example.com";
option ldap-server code 95 = text;
option domain-search-list code 119 = text;

default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
ddns-update-style none;
one-lease-per-client true;
deny duplicates;
ping-check true;
authoritative;
class "000C29DBA30B" {
        match if substring (hardware, 1, 6) = 00:0C:29:DB:A3:0B;
}
subnet 192.168.27.0 netmask 255.255.255.0 {
        pool {
                deny members of "000C29DBA30B";
                range 192.168.27.100 192.168.27.199;
        }

        pool {
                option domain-name-servers 208.67.222.222;
                allow members of "000C29DBA30B";
                range 192.168.27.50 192.168.27.60;
        }

        option routers 192.168.27.1;
        option domain-name-servers 192.168.27.1;

}

That one MAC address is my test client.

And the Windows client received:
Code: [Select]
Ethernet adapter Local Area Connection:

        Connection-specific DNS Suffix  . : example.com
        Description . . . . . . . . . . . : VMware Accelerated AMD PCNet Adapter

        Physical Address. . . . . . . . . : 00-0C-29-DB-A3-0B
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 192.168.27.50
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.27.1
        DHCP Server . . . . . . . . . . . : 192.168.27.1
        DNS Servers . . . . . . . . . . . : 208.67.222.222
        Lease Obtained. . . . . . . . . . : Wednesday, December 26, 2012 3:02:35 PM
        Lease Expires . . . . . . . . . . : Wednesday, December 26, 2012 5:02:35 PM

So it did receive the expected IP and DNS server from the secondary pool.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline robfantini

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #19 on: December 29, 2012, 12:30:53 pm »
the client here runs debian wheezy .

there is a fixed dhcp lease in /var/dhcpd/etc/dhcpd.conf  on pfsense.

all the rest of settings here look the same.

when i get a chance, I'll try removing the fixed lease , clearing caches  , restating network on client...

maybe you could try adding the test client to fixed leases ..

Offline robfantini

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #20 on: December 29, 2012, 12:54:40 pm »
after deleting the fixed lease the client got the correct sub pool nameserver.

on our current dhcp server we use 'group' to assign some dhcp options:

Code: [Select]
       group {
                        option ntp-servers  10.100.100.17;
                        next-server 10.100.100.17;

                       
                        host phone30 {
                                hardware ethernet 00:0E:08:19:.....;
                                fixed-address 10.100.199.30;
                                }

                        host phone31 {
                                hardware ethernet 70:81:05:-----;
                                fixed-address 10.100.199.30;
                                }
               # we have about 20 more devices...
}

the isc-dhcp-server server runs on Debian wheezy . here is version info:
Code: [Select]
fbc123  /etc/dhcp # aptitude show isc-dhcp-server
Package: isc-dhcp-server                 
State: installed
Automatically installed: no
Version: 4.2.2.dfsg.1-5+deb70u2


I think
maybe fixed leases could be assigned to a  group?   

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #21 on: December 29, 2012, 01:03:02 pm »
With some more coding changes, perhaps.

Fixed leases do not belong to a pool so no pool-specific settings will apply to them.

Eventually someone could take the pool type settings and apply that to static leases as well, since most all of those settings are also valid for static leases.

But doing the groups thing, though interesting, would greatly increase the complexity of the code on the page, and it's already pretty complicated.

Possible, yes, but unless someone pumps some funding into it, not likely to happen anytime soon.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #22 on: January 27, 2013, 12:47:34 pm »
FYI- Input validation was added last week to prevent overlapping pools from being saved. Testing would be helpful there also.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline bluenote

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #23 on: May 15, 2013, 03:54:04 pm »
I tested multiple DHCP pool for a subnet (LAN) and I noticed that the fixed lease were not anymore handle properly. Only the last one inserted was show in the fixed lease table in the bottom of services_dhcp.php.

Every new insertion made the previous record to be delete.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #24 on: May 15, 2013, 04:08:35 pm »
I tested multiple DHCP pool for a subnet (LAN) and I noticed that the fixed lease were not anymore handle properly. Only the last one inserted was show in the fixed lease table in the bottom of services_dhcp.php.

Every new insertion made the previous record to be delete.

On 2.1 or with a 2.0.x patch? (I would expect issues with the 2.0.x patch, it wasn't meant to be used, use 2.1 instead)
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #25 on: May 16, 2013, 02:44:29 pm »
I tested multiple DHCP pool for a subnet (LAN) and I noticed that the fixed lease were not anymore handle properly. Only the last one inserted was show in the fixed lease table in the bottom of services_dhcp.php.

Every new insertion made the previous record to be delete.

On 2.1 or with a 2.0.x patch? (I would expect issues with the 2.0.x patch, it wasn't meant to be used, use 2.1 instead)

Seems to be fixed by this:
https://github.com/pfsense/pfsense/commit/37c922a6faff0e55db04fb66e43b76180e1c1449
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline WetWilly

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #26 on: June 04, 2013, 08:40:36 am »
Is "Multiple DHCP pools outside of subnet"

Anywhere on the roadmap?

Or is there any smooth way to a DHCP-range outside of LAN interface subnet?

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: TESTING NEEDED: Multiple DHCP pools within a subnet
« Reply #27 on: June 04, 2013, 09:04:28 am »
Is "Multiple DHCP pools outside of subnet"

Anywhere on the roadmap?

Or is there any smooth way to a DHCP-range outside of LAN interface subnet?

It's closer to being possible, but not going to happen any time soon (maybe 2.2, if someone has the time or funding for it).

There is no way to do DHCP for another subnet on an interface currently. That's a question for another thread, though.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!