Unexpected DHCPD behavior?
-
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?
-
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.
-
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.
-
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
-
"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?
-
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.
-
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.31C:>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?
-
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?
-
On the dns forwarder screen, just scroll down. If you scroll down farther there is domain overrides
-
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