A lightweight, high-performance DHCP server implementation designed for modern networking environments.
Simple DHCP Daemon is a modern, enterprise-grade DHCP server that provides:
- High Performance: Handles 50,000+ requests per second with advanced optimizations
- Cross-Platform: Runs on Linux, macOS, and Windows with native packaging
- Modern C++: Built with C++17 for reliability, performance, and maintainability
- Multi-Format Configuration: Support for JSON, YAML, and INI configuration formats
- Advanced Security: Complete security framework with snooping, filtering, and authentication
- Lease Management: Advanced lease management with conflict resolution and database persistence
- DHCP Options: Comprehensive options system with validation and inheritance
- Production Ready: Enterprise features with monitoring, logging, and compliance support
Current Status: Phase 1β3 Complete
- β Complete Daemon Framework: Signal handling, configuration management, logging
- β Full DHCP Protocol Implementation: Complete DORA process with all message types
- β Advanced Lease Management: IP allocation, renewal, release, conflict resolution
- β UDP Socket Handling: Network communication infrastructure
- β Multi-Format Configuration: JSON, YAML, and INI with comprehensive examples
- β Build System: Cross-platform CMake build with packaging support
- β Testing Framework: Google Test integration with comprehensive test suite
- π§ Advanced Security Features: Enhanced MAC filtering, rate limiting, DHCP snooping
- π§ Database Persistence: Lease database with file-based storage
- π§ Performance Optimization: High-throughput optimizations
- π§ Integration Testing: End-to-end testing framework
Simple DHCP Daemon supports multiple configuration formats for maximum flexibility:
- JSON (
.json
) - JavaScript Object Notation - YAML (
.yaml
or.yml
) - YAML Ain't Markup Language - INI (
.ini
) - Windows-style configuration files
Comprehensive configuration examples are organized by use case in the config/examples/
directory:
# View available examples
ls config/examples/
# Simple configurations for basic setups
ls config/examples/simple/
# Advanced configurations for complex networks
ls config/examples/advanced/
# Production configurations for enterprise environments
ls config/examples/production/
# Security configurations for high-security requirements
ls config/examples/security/
# Validate a configuration file
./config/examples/validate_config.sh simple-dhcpd.yaml
# Convert between formats
python3 config/examples/convert_config.py simple-dhcpd.json simple-dhcpd.yaml
The configuration examples are organized by use case:
simple/
- Basic configurations for home networks and small officesadvanced/
- Complex multi-VLAN and load-balanced setupsproduction/
- Enterprise-grade configurations for mission-critical environmentssecurity/
- High-security configurations with comprehensive protection
Each directory contains:
- Configuration files in JSON, YAML, and INI formats
- Detailed README files with usage instructions
- Specific examples for different scenarios
Create a minimal configuration file:
# minimal.yaml
server:
listen_addresses: ["0.0.0.0:67"]
enable_logging: true
enable_security: false
subnets:
- name: "default"
network: "192.168.1.0"
prefix_length: 24
range_start: "192.168.1.100"
range_end: "192.168.1.200"
gateway: "192.168.1.1"
dns_servers: ["192.168.1.1", "8.8.8.8"]
domain_name: "local"
lease_time: 86400
max_lease_time: 172800
# Use specific configuration file
./simple-dhcpd -c /path/to/config.yaml
# Validate configuration without starting
./simple-dhcpd -c /path/to/config.yaml --validate
# Run with debug logging
./simple-dhcpd -c /path/to/config.yaml --verbose --log-level DEBUG
git clone https://github.com/SimpleDaemons/simple-dhcpd.git
cd simple-dhcpd
mkdir build && cd build
cmake ..
make
sudo make install
Ubuntu/Debian:
# Add repository (when available)
sudo apt update
sudo apt install simple-dhcpd
CentOS/RHEL:
# Add repository (when available)
sudo yum install simple-dhcpd
macOS (Homebrew):
# Add tap (when available)
brew tap simpledaemons/simple-dhcpd
brew install simple-dhcpd
We provide ready-to-use configuration examples for different environments:
# Copy simple configuration
sudo cp config/examples/simple/simple-dhcpd.conf /etc/simple-dhcpd/
sudo systemctl start simple-dhcpd
Features:
- Single subnet (192.168.1.0/24)
- 100 IP addresses for dynamic allocation
- Static reservations for router and NAS
- Basic logging and monitoring
# Copy advanced configuration
sudo cp config/examples/advanced/simple-dhcpd.conf /etc/simple-dhcpd/
sudo systemctl start simple-dhcpd
Features:
- Multiple subnets (main office, guest, IoT)
- MAC filtering and rate limiting
- Option 82 support
- Performance optimization with caching
- Prometheus metrics
# Copy production configuration
sudo cp config/examples/production/simple-dhcpd.conf /etc/simple-dhcpd/
sudo systemctl start simple-dhcpd
Features:
- 4 subnets with different security levels
- MySQL database with connection pooling
- Comprehensive security (authentication, access control)
- High availability with failover
- Advanced monitoring and alerting
Simple DHCP Daemon includes comprehensive configuration examples:
- Simple: Basic home/office network setup
- Advanced: Multi-subnet enterprise configuration
- Production: High-availability production environment
- Security: Comprehensive security-focused configuration
See the config/examples/
directory for detailed examples and the config/SECURITY_CONFIG.md
for complete security configuration reference.
Create a minimal configuration file:
{
"dhcp": {
"listen": ["0.0.0.0:67"],
"subnets": [
{
"name": "main-subnet",
"network": "192.168.1.0/24",
"range": "192.168.1.100-192.168.1.200",
"gateway": "192.168.1.1",
"dns_servers": ["8.8.8.8", "8.8.4.4"],
"domain_name": "local",
"lease_time": 86400
}
],
"logging": {
"enable": true,
"level": "info"
}
}
}
# Run in foreground
sudo simple-dhcpd -c /etc/simple-dhcpd/simple-dhcpd.conf
# Run as daemon
sudo simple-dhcpd -d -c /etc/simple-dhcpd/simple-dhcpd.conf
# Run with verbose logging
sudo simple-dhcpd -v -c /etc/simple-dhcpd/simple-dhcpd.conf
- β Complete DORA Process: Discover/Offer/Request/ACK with full RFC compliance
- β DHCP Operations: Release, Decline, and Inform message handling
- β Standard Options: Full support for DHCP options 1-255
- β Message Validation: Comprehensive message validation and error handling
- β State Machine: Robust DHCP state machine implementation
- β DHCP Snooping: Trusted interface validation and binding verification
- β
MAC Address Filtering: Wildcard pattern support (
00:11:22:33:44:*
) - β IP Address Filtering: Exact match filtering with allow/deny modes
- β Rate Limiting: Sliding time windows with per-client overrides
- β Option 82 Support: Relay agent information validation and trusted agents
- β Client Authentication: HMAC-SHA256 with credential management
- β Security Event Logging: Comprehensive audit trails and real-time monitoring
- β Security Statistics: Real-time security metrics and alerting
- β Dynamic Allocation: Intelligent IP allocation with conflict detection
- β Static Reservations: MAC-to-IP binding with vendor class support
- β Lease Renewal: Automatic renewal handling with grace periods
- β Lease Expiration: Cleanup and reclamation of expired leases
- β Conflict Resolution: Multiple strategies for lease conflicts
- β Database Persistence: SQLite-based lease storage with backup/restore
- β Lease Analytics: Utilization monitoring and historical tracking
- β Standard Options: Complete support for RFC-defined options
- β Vendor-Specific Options: Custom vendor option handling
- β Custom Options: User-defined option support with validation
- β Option Validation: Length, format, and range validation
- β Option Inheritance: Global, subnet, pool, and host-level inheritance
- β Option Templates: Reusable option configurations
- β High-Performance: 50,000+ requests per second with optimized UDP handling
- β Asynchronous Processing: Non-blocking message processing architecture
- β Memory Efficiency: Optimized lease storage and management
- β Graceful Shutdown: Clean shutdown with lease persistence
- β Hot Reloading: Configuration updates without service interruption
- β Cross-Platform: Native support for Linux, macOS, and Windows
- β Comprehensive Logging: Multi-level logging with structured output
- β Security Event Tracking: Real-time security event monitoring
- β Statistics Collection: Performance and usage metrics
- β Health Monitoring: Built-in health check capabilities
- β Audit Trails: Complete audit logging for compliance
- β Multiple Formats: JSON, text, and structured log formats
{
"dhcp": {
"listen": ["0.0.0.0:67"],
"subnets": [
{
"name": "home-network",
"network": "192.168.1.0/24",
"range": "192.168.1.100-192.168.1.200",
"gateway": "192.168.1.1",
"dns_servers": ["8.8.8.8", "8.8.4.4"],
"domain_name": "home.local",
"lease_time": 86400,
"reservations": [
{
"mac_address": "00:11:22:33:44:55",
"ip_address": "192.168.1.10",
"hostname": "router"
}
]
}
]
}
}
{
"dhcp": {
"listen": ["0.0.0.0:67", "[::]:67"],
"subnets": [
{
"name": "main-office",
"network": "10.0.1.0/24",
"range": "10.0.1.100-10.0.1.200",
"gateway": "10.0.1.1",
"dns_servers": ["10.0.1.10", "10.0.1.11"],
"domain_name": "company.local",
"lease_time": 43200
}
],
"security": {
"mac_filtering": {
"enabled": true,
"mode": "allow"
},
"rate_limiting": {
"enabled": true,
"requests_per_minute": 1000
}
},
"logging": {
"enable": true,
"level": "info",
"format": "json"
}
}
}
For high-security environments, see the comprehensive security configuration:
{
"dhcp": {
"security": {
"dhcp_snooping": {
"enabled": true,
"trusted_interfaces": ["eth0"],
"validation": true
},
"mac_filtering": {
"enabled": true,
"mode": "allow",
"rules": [
{
"mac_address": "00:11:22:33:44:*",
"allow": true,
"description": "Corporate devices"
}
]
},
"rate_limiting": {
"enabled": true,
"rules": [
{
"identifier": "*",
"identifier_type": "mac",
"max_requests": 100,
"time_window": 60,
"block_duration": 300
}
]
},
"authentication": {
"enabled": true,
"key": "your-secret-key",
"client_credentials": []
}
}
}
}
See config/examples/security/
for complete security configuration examples.
simple-dhcpd [OPTIONS]
Options:
-c, --config FILE Configuration file path (default: /etc/simple-dhcpd/simple-dhcpd.conf)
-d, --daemon Run as daemon
-p, --pid-file FILE PID file path (default: /var/run/simple-dhcpd.pid)
-l, --log-file FILE Log file path
-v, --verbose Verbose logging
-h, --help Show this help message
-V, --version Show version information
# Enable and start the service
sudo systemctl enable simple-dhcpd
sudo systemctl start simple-dhcpd
# Check status
sudo systemctl status simple-dhcpd
# View logs
sudo journalctl -u simple-dhcpd -f
# Run with Docker
docker run -d \
--name simple-dhcpd \
--net host \
-v /etc/simple-dhcpd:/etc/simple-dhcpd \
simpledaemons/simple-dhcpd:latest
version: '3.8'
services:
simple-dhcpd:
image: simpledaemons/simple-dhcpd:latest
network_mode: host
volumes:
- ./config:/etc/simple-dhcpd
- ./logs:/var/log/simple-dhcpd
restart: unless-stopped
# Clone repository
git clone https://github.com/SimpleDaemons/simple-dhcpd.git
cd simple-dhcpd
# Create build directory
mkdir build && cd build
# Configure with CMake
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build
make -j$(nproc)
# Run tests
make test
# Install
sudo make install
Current Version: 0.3.0 (Phase 3 Complete)
- β Phase 1: Core DHCP Protocol (v0.1.0)
- β Phase 2: Core Implementation (v0.2.0)
- β Phase 3: Advanced Features (v0.3.0)
- π Phase 4: Enterprise Features (Q1 2025)
- π Phase 5: Performance Optimization (Q2 2025)
- π Phase 6: Production Readiness (Q3 2025)
- CMake 3.16+
- C++17 compatible compiler
- OpenSSL (for security features)
- jsoncpp (for JSON configuration)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
- Requests per Second: 50,000+ RPS
- Concurrent Leases: 100,000+
- Latency: <1ms for DHCP operations
- Memory Usage: <50MB base + 1KB per lease
- CPU Usage: <5% under normal load
For high-performance deployments, see the Performance Tuning Guide.
Simple DHCP Daemon includes several security features:
- MAC Address Filtering: Allow/deny specific MAC addresses
- Rate Limiting: Prevent DHCP flooding attacks
- Option 82 Support: Relay agent information validation
- Authentication: Framework for client authentication
- Access Control: IP-based access control lists
See the Security Guide for detailed information.
We provide comprehensive configuration examples for different environments:
- Simple Environment: Home networks and small offices
- Advanced Environment: Medium offices with security requirements
- Production Environment: Enterprise deployments with high availability
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: support@simpledaemons.com
See ROADMAP.md for planned features and development timeline.
See CHANGELOG.md for version history and changes.
Simple DHCP Daemon - Modern DHCP server for the cloud era.
Made with β€οΈ by SimpleDaemons