Why should I assign static IP address on my DHCP server?


I have installed isc-dhcp-server on a Debian. I'm making some experiments with this as I'm a little bit newbie on network administration.

I have read that you should assign static IP to any ethernet interface from where you want to serve IP addresses from your DHCP, but I don't really understand why.

I mean, why my DHCP server can't assign an IP address to "myself" ? All I need is to define a rank of IP addresses on dhcpd.conf, isn't it?

Thank you.
LVL 15
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I think what you read is that your DHCP server itself should have a static IP address.  That is correct, and in my opinion all servers should have a static IP address.  

A lot of services (BIND, ISC-DHCP, etc..) bind to a certain IP address.  If they were receiving DHCP addresses it would make it very hard to administer.
Don JohnstonInstructorCommented:
One reason is that when a host tries to renew it's address, it will do so to the IP address of the server.  If the server address changes, then it can't renew the address.
gplanaAuthor Commented:
I understand that the DHCP server need to have a FIXED address, but why couldn't it be assigned by the DHCP server itself?

I mean, DHCP server can assign fixed address to hosts, according to its MAC address...
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Don JohnstonInstructorCommented:
It can, but what's the gain?  

The primary function of DHCP is to ease in the deployment of hosts so you don't have to manually assign IP addresses.  We're talking one host here.  So there's no real gain to having this server get a dynamic address.
Maybe because network  card, when asking for it's address sends DHCP request to other network devices (not to OS).
Network card will be configured by OS in case that network card don't receive any offer from some DHCP server.
Aside from -  renew address from the same DHCP server.

Also DHCP server can be responsible for assigning multiple DHCP scopes, not just one. What ip address should then get network card, exclusions, reservations - it can get really complicated if you don't assign static ip address.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bbaoIT ConsultantCommented:
> I mean, why my DHCP server can't assign an IP address to "myself"

you are asking a really great question as it could be challenging most experts. :))

i guess you have learnt some basic concepts how DHCP works for both DHCP server and DHCP client sides. briefly speaking, both sides need to 'talk' to each other back and forth in order to work out an IP to be assigned to the DHCP client. how can they talk to each other?

be aware that during the negotiation process, the DHCP client has NOT obtained an IP, so the both sides can't talk to each other at IP layer. instead, they talk at Link Layer, which uses MAC address to locate each other. theoretically, any Ethernet device has an unique MAC address, that's the ID for the devices to differentiate themselves individually.

okay, if, just IF, the DHCP server is to assign an IP to itself, then how does the server talk to the client over the SAME MAC address? can you know who talks to who and who serves who? apparently, it doesn't make sense and won't work that way. :-)

moreover, if a DHCP server didn't have a static IP, as an administrator how could you know where your DHCP server is located? where to manage it? that's NOT practical in reality and could be a nightmare if it was true. :-)

does it make sense now?
gplanaAuthor Commented:
Thank you both.
I think the clue is the IP broadcast address ( where DHCP questions goes to. I didn't realiza that this means that request is going to the network, but not to myself.
bbaoIT ConsultantCommented:
yes, any broadcast packet from self to broadcast address will be ignored.

but, again, the story starts at Link Layer (Layer 2) and there is NO IP address (Layer 3) at that moment. it is all about MAC address, its broadcast address is FF:FF:FF:FF:FF:FF (48 bits) instead of FF.FF.FF.FF ( or 32 bits).
gplanaAuthor Commented:
I have read that when no IP is assigned, DHCP client uses as IP address, and (=broadcast) as destination.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.