https://www.freebsd.org/cgi/man.cgi?query=dhcpd.conf&sektion=5&apropos=0&manpath=FreeBSD+10.1-RELEASE+and+Ports#ALLOW_AND_DENY_WITHIN_POOL_DECLARATIONS
When declaring permit lists for address allocation pools, the following
syntaxes are recognized following the allow or deny keywords:
known-clients;
If specified, this statement either allows or prevents allocation from
this pool to any client that has a host declaration (i.e., is known).
A client is known if it has a host declaration in any scope, not just
the current scope.
unknown-clients;
If specified, this statement either allows or prevents allocation from
this pool to any client that has no host declaration (i.e., is not
known).
So this is documented behavior. e.g. one of my "host" statements in my dhcpd.conf is:
host s_opt2_4 {
hardware ethernet 00:1f:3c:14:b1:6e;
fixed-address 10.49.213.1;
option host-name "Davis-PC_WiFi";
}
If I connect to the subnet that has 10.49.213.1 inside it, then I am given that IP address. If I connect to some other LAN-style subnet/interface on my pfSense that even has "deny unknown hosts" specified like:
subnet 10.49.208.0 netmask 255.255.252.0 {
pool {
deny unknown-clients;
range 10.49.211.0 10.49.211.254;
}
option routers 10.49.208.250;
option domain-name-servers 10.49.208.250;
option custom-lan-0 07:10:C0:A8:0A:31:D4:01;
}
I get an IP address in the specified range of that pool, because I am a "known" host.
That seems a shame! It is NOT supported to simply list hosts within a subnet{} scope - which would be an easy way to tell it that certain hosts were just restricted to that subnet.
The way to do it is to use classes and sub-classes:
https://www.freebsd.org/cgi/man.cgi?query=dhcpd.conf&sektion=5&apropos=0&manpath=FreeBSD+10.1-RELEASE+and+Ports#SUBCLASSES
https://thelowedown.wordpress.com/2008/01/24/using-dhcp-client-classing/
http://serverfault.com/questions/472618/how-do-i-assign-hosts-to-classes-in-isc-dhcpd
The way the pfSense GUI is organised, you already add static-mapped entries by interface (subnet) anyway. So the pfSense config knows which static-mapped hosts belong to which subnet. The PHP code that generates dhcpd.conf could make "class" and "subclass" statements that put all hosts for an interface into one class, then if "deny unknown clients" is selected on an interface, actually put an "allow members of "interface-xyz";" statement in the pool for that subnet. That will allow just those specified on the interface, and stop any unknown and any that are known from other interfaces.
I guess nobody should be depending on the current more liberal behavior, because the GUI description already says "If this is checked, only the clients defined below will get DHCP leases from this server." - so the current behavior is technically a bug and should be tightened up to match what is claimed on the GUI.
There are some situations where I would like this to work as advertised, so I will raise a redmine issue and have a look…