Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This may seem a daft question (and i fear it might be), but would it be possible for a server acting as a network's sole DHCP server send out a request for an IP address to the network, then catch its own request and answer it?

All of my intuition points to a no answer and ideally i would test it out but i don't have the time/spare resources currently so i was hoping someone else may have had the same thought and tried it out.

This is meant to be a generic question but if anyone is interested i'm running isc-dhcp on ubuntu 11.04

share|improve this question
    
I don't, but the devil was making work for idle minds. –  James Butler Aug 12 '11 at 9:35
3  
The devil makes packets for idle networks. –  Tom O'Connor Aug 12 '11 at 11:30

4 Answers 4

up vote 8 down vote accepted

Technically the specs would allow for that to happen but it would be beyond stupid to try to do so.

share|improve this answer

In theory I think it SHOULD be possible since most linux distros these come up with an apipa (169.254.0.1 to 169.254.255.254) address if none is configured or provided. Therefore the dhcp server should be able to run and possibly answer requests. Now if you configure a reserved (fixed) ip address for the server's own mac-address, and if the dhcp client daemon stays running and keeps trying, it should in theory be able to be answered by the dhcp server daemon. Then it should be able to set its own proper ip-address, and continue to answer dhcp requests from other machines.

I'm not sure if dhcp servers can have an apipa address, an I think the server daemon needs to be restarted after the ip change, but other than that... I still cannot think of any sensible use case for this.

share|improve this answer

It's a bad idea in two ways but yes it is possible.

  1. The server can't assign an IP during boot-up when the DHCP server on the same machine hasn't been started yet. So you have to make sure that the DHCP server is up before trying to assign the IP.
  2. If the DHCP also updates the DNS for the dynamically assigned hosts then it is quite hard to know where your DHCP server is when the DNS fails (for whatever reason)
share|improve this answer

As far as I know this is NOT possible. DHCP is not just broadcast based. The initial part of the DHCP protocol is broadcast based, but at some point the server and client talk using their IP-addresses.

If I recall correctly (don't have the RFC's at hand) the server is the first one in the conversation that needs to send real ip-address information.

This automatically makes it impossible to have the server serve itself.

Of course it is possible that the server itself is a DHCP client that receives it's DHCP config from ANOTHER DHCP server (usually a reserved-fixed ip). It's a bit odd, but I can imagine some use-cases for such a setup.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.