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

    DHCP Server

    Scheduled Pinned Locked Moved DHCP and DNS
    20 Posts 4 Posters 2.3k Views 4 Watching
    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.
    • R Offline
      Reeko @johnpoz
      last edited by

      @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

      johnpozJ R 3 Replies Last reply Reply Quote 0
      • johnpozJ Offline
        johnpoz LAYER 8 Global Moderator @Reeko
        last edited by johnpoz

        @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?

        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 25.07 | Lab VMs 2.8, 25.07

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

          @reeko said in DHCP Server:

          No, actually it use to be 192/24

          so 192.0.0.0/24

          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 25.07 | Lab VMs 2.8, 25.07

          1 Reply Last reply Reply Quote 0
          • R Offline
            Reeko @Reeko
            last edited by

            @reeko

            1 Reply Last reply Reply Quote 0
            • R Offline
              Reeko @johnpoz
              last edited by

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

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

                @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 {

                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 25.07 | Lab VMs 2.8, 25.07

                R 1 Reply Last reply Reply Quote 1
                • R Offline
                  Reeko @johnpoz
                  last edited by

                  @johnpoz Look the wireshak:

                  4670eb81-f527-4d32-868f-61d286c1ff09-image.png

                  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 34🇩🇪1a: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?

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

                    @reeko you didn't actual show the option in the dhcp ack,

                    But clearly shows mask of 255.255.255.0 there..

                    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 25.07 | Lab VMs 2.8, 25.07

                    R 1 Reply Last reply Reply Quote 0
                    • R Offline
                      Reeko @johnpoz
                      last edited by

                      @johnpoz Yes, It seems to be. However, every device that requests an IP gets an /8 netmask.

                      So, Why? xD

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

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

                        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 25.07 | Lab VMs 2.8, 25.07

                        luckman212L 1 Reply Last reply Reply Quote 0
                        • luckman212L Offline
                          luckman212 LAYER 8 @johnpoz
                          last edited by

                          The suspense is killing me! What ended up happening with this one?

                          R 1 Reply Last reply Reply Quote 0
                          • R Offline
                            Reeko @luckman212
                            last edited by

                            @luckman212 Hi there!

                            Sorry, I was busy with other things.

                            Apparently, the problem was this:
                            af8c793f-d24f-47df-ad7d-8fbcc24c8787-image.png
                            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.0

                            1489bf8e-e93a-463d-84b5-5324b6dc38d4-image.png

                            I forgot to use WireShark and sniff the network. That helped me a lot. Thank you for that @johnpoz

                            luckman212L 1 Reply Last reply Reply Quote 0
                            • luckman212L Offline
                              luckman212 LAYER 8 @Reeko
                              last edited by

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

                              5a810a4a-43b5-4d6b-a411-f3199389b8a9-image.png

                              R 1 Reply Last reply Reply Quote 0
                              • R Offline
                                Reeko @luckman212
                                last edited by

                                @luckman212 Oh! Now everything makes sense. Geez!

                                Well, thank you for the information.

                                Greetings!

                                1 Reply Last reply Reply Quote 0
                                • senseivitaS Offline
                                  senseivita
                                  last edited by

                                  @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

                                  Missing something? Word endings, maybe? I included a free puzzle in this msg if you solv--okay, I'm lying. It's dyslexia, makes me do that, sorry! Just finish the word; they're rarely misspelled, just incomplete. Yeah-yeah-I know. Same thing.

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

                                    @skilledinept now kicking myself in hindsight when he posted dhcp.conf - that I missed this

                                    option custom-lan-0 code 1 = text;
                                    

                                    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 25.07 | Lab VMs 2.8, 25.07

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