dhcpd.conf
The dhcpd.conf
file is the configuration file for dhcpd
, the ISC DHCP server. This file contains all the configuration settings for the DHCP server, including the IP address ranges (scopes) it will manage, options it will provide to clients, and other operational parameters.
Structure and Syntax
The dhcpd.conf
file uses a straightforward, declarative syntax. Here’s an overview of the key components and directives:
Global Parameters: These settings apply to the entire DHCP server.
Subnet Declarations: These define IP address ranges and options specific to a subnet.
Host Declarations: These provide fixed address assignments for specific hosts.
Example Configuration
Here is a basic example of a dhcpd.conf
file:
Key Components Explained
Global Parameters
default-lease-time: The default lease time in seconds for IP addresses if the client does not request a specific time.
max-lease-time: The maximum lease time in seconds for IP addresses.
option domain-name: The domain name to be assigned to clients.
option domain-name-servers: The DNS servers to be assigned to clients.
Subnet Declarations
subnet: Defines a subnet and its netmask.
range: Specifies the range of IP addresses that the DHCP server can assign to clients within the subnet.
option routers: The default gateway for clients on this subnet.
option broadcast-address: The broadcast address for this subnet.
option subnet-mask: The subnet mask for clients on this subnet.
Host Declarations
host: Defines a specific client by its MAC address.
hardware ethernet: The MAC address of the client.
fixed-address: A fixed IP address to be assigned to this client.
Advanced Configuration Options
Dynamic DNS Updates
The DHCP server can be configured to update DNS records dynamically. This requires additional configuration in both dhcpd.conf
and named.conf
.
Failover Configuration
For high availability, two DHCP servers can be configured to share load and provide redundancy.
Practical Use Cases
Adding a New Subnet
Edit
dhcpd.conf
:Add a new subnet declaration:
Restart the DHCP Server:
Assigning a Fixed IP to a Client
Edit
dhcpd.conf
:Add a host declaration:
Restart the DHCP Server:
Security Considerations
Restrict Access: Limit the range of IP addresses to only what is necessary.
Logging: Enable logging to monitor DHCP server activities.
Backup: Regularly back up the
dhcpd.conf
file to prevent data loss.
Conclusion
The dhcpd.conf
file is the heart of the ISC DHCP server configuration, allowing administrators to define how IP addresses are allocated, what options are provided to clients, and how the server interacts with other network services. By understanding its structure and options, you can effectively manage and customize your DHCP server to fit your network needs.
Last updated