DHCP Server
-
Hi there folks!
I have a question: My LAN has a netmask 255.255.255.0. I have a DHCP server with a pool 192.168.0.1 and a range from 192.168.0.190 to 192.168.0.254
Why the server is delivering addresses with a netmask 255.0.0.0?
-
@reeko it wouldn't where exactly are you seeing this?
So here is my lan dhcp..
For validation sniff on your lan interface for dhcp and you can see exactly what is offered.
example
That is a different network than my lan, but wanted to show a dhcp exchange.. Was just easier to cycle the wifi on my phone to see a new request and what the dhcp server sent back.
-
Hi @johnpoz, thank you for the reply.
My Pc is receiving that mask. My setup is like yours:
I don't know if this is a bug or if I'm missing something here:
What do you think?
Greetings!
-
@reeko that is off your machine - actually sniff the traffic and see what dhcp server offered.
That looks like it got its dhcp from 192.168.153.2 - is that pfsense IP? Maybe you have a rouge dhcp server on the network?
Did you change your network? Did it use to be 192/8 ?
-
@johnpoz Hi, there is no other DHCP server in the network. The IP 192.168.153.2 is the IP of my Pfsense server. I will sniff the net to check if there is a phantom dhcp around. No changes were made to the network.
@johnpoz said in DHCP Server:
Did it use to be 192/8
No, actually it use to be 192/24
-
@reeko well that makes no sense.. if you actually got the lease from pfsense and its 24 bit.. Have no idea why your machine would be using 8 bit mask.
I have never seen such an issue.. And I don't even see how you could set that up to happen.. Even if you set a dhcp reservation for the device, which would be outside the dhcp pool scope of IPs.. But it should use the default mask, there sure is not a gui easy way to adjust that in a reservation.. Guess you might be able to override the default mask with the dhcp options in the reservations.
So all your devices are getting this /8 mask, or just this one machine?
-
-
-
@johnpoz I thought the same. It's extremely weird this issue. Is not logical what is happening. Every single device is getting this /8 netmask, instead of a /24. Probably is some sort of bug, I'm not sure. Maybe I need to check the config file and see if there is a problem.
-
@reeko well look in your actual config.. But the config is created from what is in the xml.
[22.01-RELEASE][admin@sg4860.local.lan]/: cat var/dhcpd/etc/dhcpd.conf option domain-name "local.lan"; option ldap-server code 95 = text; option domain-search-list code 119 = text; option arch code 93 = unsigned integer 16; # RFC4578 option custom-lan-0 code 252 = text; option custom-lan-1 code 46 = string; option custom-opt1-0 code 252 = text; option custom-opt9-0 code 252 = text; option custom-opt5-0 code 252 = text; option custom-opt8-0 code 252 = text; default-lease-time 7200; max-lease-time 86400; log-facility local7; one-lease-per-client true; deny duplicates; update-conflict-detection false; authoritative; class "s_lan" { match pick-first-value (option dhcp-client-identifier, hardware); } subnet 192.168.9.0 netmask 255.255.255.0 { pool { option domain-name-servers 192.168.3.10; ignore-client-uids true;
Notice where the pool is setup
subnet 192.168.9.0 netmask 255.255.255.0 {
-
@johnpoz Look the wireshak:
cat var/dhcpd/etc/dhcpd.conf:
option domain-name "acbl.net.ve";
option ldap-server code 95 = text;
option domain-search-list code 119 = text;
option arch code 93 = unsigned integer 16; # RFC4578
option custom-lan-0 code 1 = text;default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
one-lease-per-client true;
deny duplicates;
update-conflict-detection false;
authoritative;
class "s_lan" {
match pick-first-value (option dhcp-client-identifier, hardware);
}
subnet 192.168.153.0 netmask 255.255.255.0 {
pool {
option domain-name-servers 192.168.153.3;range 192.168.153.190 192.168.153.254; } pool { option domain-name-servers 192.168.153.3,8.8.8.8; option routers 192.168.153.65; range 192.168.153.66 192.168.153.127; } option routers 192.168.153.2; option domain-name "acbl.net.ve"; option domain-name-servers 192.168.153.3; max-lease-time 14400; ping-check true; option netbios-name-servers 192.168.153.3; option netbios-node-type 8; option custom-lan-0 "";
}
host s_lan_0 {
hardware ethernet 58:91:cf:12:0f:66;
fixed-address 192.168.153.128;
option host-name "LAPTOP-DELL";}
subclass "s_lan" 1:58:91:cf:12:0f:66;
host s_lan_1 {
hardware ethernet 40:74:e0:94:79:e7;
fixed-address 192.168.153.129;
option host-name "dell-egil";}
subclass "s_lan" 1:40:74:e0:94:79:e7;
host s_lan_2 {
hardware ethernet 341a:2e:f6:b7;
fixed-address 192.168.153.130;
option host-name "dell-laptop";}
subclass "s_lan" 1:34:de:1a:2e:f6:b7;
host s_lan_3 {
hardware ethernet 00:71:cc:03:13:be;
fixed-address 192.168.153.132;
option host-name "NPI0313BE";}
subclass "s_lan" 1:00:71:cc:03:13:be;
host s_lan_4 {
hardware ethernet 62:bb:1b:c5:c3:ae;
fixed-address 192.168.153.133;
option host-name "EXEGIL";}
subclass "s_lan" 1:62:bb:1b:c5:c3:ae;
host s_lan_5 {
hardware ethernet 88:53:2e:a1:a7:8e;
fixed-address 192.168.153.134;
option host-name "dell-ygarcia";}
subclass "s_lan" 1:88:53:2e:a1:a7:8e;
host s_lan_6 {
hardware ethernet 78:0c:b8:b1:62:e1;
fixed-address 192.168.153.150;
option host-name "DESKTOP-7NSAKJ9";}
subclass "s_lan" 1:78:0c:b8:b1:62:e1;I'm really confused. I don't understand what is happening. Maybe it could be a good idea delete the DHCP server and create it again.
What do you think?
-
@reeko you didn't actual show the option in the dhcp ack,
But clearly shows mask of 255.255.255.0 there..
-
@johnpoz Yes, It seems to be. However, every device that requests an IP gets an /8 netmask.
So, Why? xD
-
@reeko please post up your dhcp capture of your client request, and the answer.. Attach the pcap please..
In the pcap lets see the mac of the dhcp server, is this pfsense mac? And its actually offering only 255.0.0.0 when clearly from your conf it says to use 255.255.255.0 on the pool.
-
The suspense is killing me! What ended up happening with this one?
-
@luckman212 Hi there!
Sorry, I was busy with other things.
Apparently, the problem was this:
There was a number in the "Number" field. I presume that number enabled an advanced option, altering the DHCP functionality. The number was a "1". I deleted that, saved the configuration, restarted the server and the DHCP server now is delivering addresses correctly: 255.255.255.0I forgot to use WireShark and sniff the network. That helped me a lot. Thank you for that @johnpoz
-
@reeko Ah ha. That makes sense. DHCP Option Code 1 specifies the subnet mask. So it of course could cause this issue. Nice troubleshooting! Glad you were able to solve it.
-
-
@johnpoz said in DHCP Server:
xml
Thanks guys! This just saved me from my very own malformed XML. They grow up so fast, don't they? <3
-
@skilledinept now kicking myself in hindsight when he posted dhcp.conf - that I missed this
option custom-lan-0 code 1 = text;