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

    Unexpected DHCPD behavior?

    Scheduled Pinned Locked Moved DHCP and DNS
    10 Posts 3 Posters 1.9k 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.
    • M
      mcampbell
      last edited by

      So I ran into a problem while editing my static DHCP leases.  I have a couple of internal IIS boxes that have multiple site names, and in the past, I would create a static dhcp lease for each sitename with the same IP address (and just give it a false MAC address).  This has been working for a few years now.  Fast forward a couple of pfsense upgrades (2.1-release) to today, the same configuration has been working fine, but I tried to edit (and then later tried to add) an entry for another site name, and it doesn't let me because now it shares the same IP address.  What gives?  When did this change?

      I've even tried editing /var/dhcpd/etc/dhcpd.conf, and adding those entries in, and just using the GUI to restart the dhcpd service, but I find it actually overwrites my changes, and puts in something else.  What is the best way to accomplish this?

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

        I forgot to mention that this is a CARP setup, so DHCPD is set to be a part of XMLSync, if that makes any difference.

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

          So I found a workaround.  I downloaded a backup of the dhcpd server, edited the xml file and restored it.  It seems to be working; however, it would be appreciated if anyone could bring up a neater way of doing it, as that would not be particularly convenient over the long term as new edits are required.

          1 Reply Last reply Reply Quote 0
          • D
            doktornotor Banned
            last edited by

            What do you mean "This has been working for a few years now."? What has been working? What are you trying to achieve here? How on earth is a webserver hosting a multitude of virtual hosts related to DHCP?  :o

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

              "I would create a static dhcp lease for each sitename with the same IP address (and just give it a false MAC address)"

              What, Im with doktornotor here – have no clue what your thinking your doing with that, what would be the point of that statement?

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

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

                OK, allow me to clarify.

                I have an IIS box, lets call it iisbox01.  It's a private development machine, and has its name given it via static DHCP, so that when people on the network type http://iisbox01 in their browser, it properly resolves to the box.  My network is small enough, that I don't have any other DNS, just this pfsense setup.

                Now, let's say I need to add different names to the same development box for different sites, let's say devsite01 & devsite02.  In my case, it's been easiest to simply add another static DHCP entry, because it also creates a dns lookup.  In the past (at least since pfsense 2.0.3), it used to be that you could create a second DHCP pointing to the same IP address, provided the MAC address was different.  And this was OK, because these sites didn't need to actually get a DHCP request, I just wanted the pointer in pfsense so people could go to http://devsite01 in their browser.  And this worked perfectly fine.  I am just surprised that in 2.1, that the behavior changed in the UI so that nothing could be in common (name, IP, or MAC), when it still accepted my previous static DHCPs.  In other words, the behavior of the DHCPD didn't change, just the UI added an additional check to make sure the IP address wasn't the same either; and I just wanted to know why that changed.

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

                  Why would anyone ever done that - if you needed a record to point a name to an IP, why not just do it in the host over ride section.  Why setup dhcp for something that is never going to ask for it?

                  I have different names point to same IP - simple dns entry.

                  C:>dig pi +short   
                  192.168.1.31

                  C:>dig xbmc +short 
                  192.168.1.31

                  "used to be that you could create a second DHCP pointing to the same IP address"

                  Well seems to me they cleaned up a bug or lack of check - since it should not be possible to create dhcp reservations for the same IP address - that is not a valid configuration.  What if both of them ask for lease?  So you have duplicate IPs on the network?

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

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

                    Sorry if I am looking stupid to you right now, but I'd not seen any host override function in pfsense, or I'd probably have done that to begin with…  where is it?

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

                      On the dns forwarder screen, just scroll down.  If you scroll down farther there is domain overrides

                      hostoverrides.png
                      hostoverrides.png_thumb

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

                      1 Reply Last reply Reply Quote 0
                      • D
                        doktornotor Banned
                        last edited by

                        @johnpoz:

                        Well seems to me they cleaned up a bug or lack of check - since it should not be possible to create dhcp reservations for the same IP address - that is not a valid configuration.  What if both of them ask for lease?  So you have duplicate IPs on the network?

                        Well, as for valid. This is supported by some DHCP daemons. I think one of semi-valid use cases would be

                        
                        subnet 10.11.12.0 netmask 255.255.255.0 {                                            
                                host mylaptop-wifi {                                                           
                                        hardware ethernet 11:22:33:44:55:66;                                  
                                        fixed-address 10.11.12.100;                                           
                                }                                                                             
                        
                                host mylaptop-wired {                                                          
                                        hardware ethernet aa:bb:cc:dd:ee:ff;                                  
                                        fixed-address 10.11.12.100;                                           
                                }  
                        }
                        
                        

                        assuming I make sure to switch off the wifi before plugging in the wire.  ::)

                        @OP: Just do as suggested above, you simply are doing things in completely wrong place!  :P

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