DHCP Server Configuration
DHCP Server Configuration
Overview
The Pimeleon router runs ISC DHCP Server providing dynamic IP allocation across both wired and wireless network segments. The server is configured for dual-interface operation with dynamic DNS integration, supporting automatic host registration and cross-network routing.
Architecture & Design Philosophy
Dual-Network DHCP Service
The DHCP server operates across two distinct network segments:
- Wired LAN (eth1): Trusted network with extended lease times for stable devices
- Wireless Network (wlan0): Guest network with standard lease times for mobile devices
- Cross-Network Routing: Automatic static routes enable seamless inter-network communication
- Unified Management: Single DHCP server instance manages both networks
Dynamic DNS Integration
Deep integration with Bind9 DNS server provides automatic hostname resolution:
- Forward Updates: Client hostnames automatically added to DNS zones
- Reverse Updates: PTR records created for IP-to-hostname resolution
- Dual-Stack Support: IPv4 and IPv6 hostname registration coordination
- Conflict Detection: Prevents duplicate hostname assignments
Network Service Discovery
Comprehensive service announcement ensures client auto-configuration:
- DNS Servers: Clients receive Pimeleon router DNS service (Bind9 → DNS filter)
- NetBIOS Services: Samba file sharing automatically discoverable
- NTP Synchronization: Time servers announced for accurate timekeeping
- Gateway Configuration: Routing and internet access automatically configured
Service Configuration
Global DHCP Settings
Foundation settings applied across all networks:
- Domain Name: zen.lan (local network domain)
- Lease Management: 30-minute default, 7-day maximum lease times
- Update Optimization: Efficient DNS update batching reduces server load
- Static Lease Updates: DNS records maintained for reserved IP addresses
- Client Updates: Allows clients to request specific hostnames
Network Segment Configuration
Wired LAN (192.168.76.0/24)
Trusted network configuration for permanent devices:
- IP Range: 192.168.76.100 - 192.168.76.254 (154 addresses)
- Interface Binding: eth1 (wired Ethernet)
- Gateway: 192.168.76.1 (Pimeleon router LAN interface)
- DNS Servers: 192.168.76.1 (local DNS with DNS filter filtering)
- NetBIOS Discovery: 192.168.76.1 (Samba file sharing services)
- NTP Server: 192.168.76.1 (local time synchronization)
- Cross-Network Routes: Automatic routing to WiFi network (192.168.77.x)
Wireless Network (192.168.77.0/24)
Guest network configuration for mobile and temporary devices:
- IP Range: 192.168.77.100 - 192.168.77.254 (154 addresses)
- Interface Binding: wlan0 (wireless interface)
- Gateway: 192.168.77.1 (Pimeleon router WiFi interface)
- DNS Servers: 192.168.77.1 (local DNS with DNS filter filtering)
- NetBIOS Discovery: 192.168.77.1 (Samba file sharing services)
- NTP Server: 192.168.77.1 (local time synchronization)
- Cross-Network Routes: Automatic routing to wired network (192.168.76.x)
Static IP Reservations
Critical infrastructure devices receive fixed IP assignments:
Infrastructure Servers
- TrueNAS (truenas.zen.lan): 192.168.76.5
- MAC: aa:bb:cc:dd:ee:ff
- Extended lease time for stability
- Dual-boot Workstation (dualboot.zen.lan): 192.168.76.10
- MAC: 00:d8:61:2e:4f:7e
- 24-hour lease time for development work
Dynamic DNS Integration Details
DNS Zone Management
Automatic DNS record maintenance across multiple zones:
- Forward Zone: local.lan domain for hostname-to-IP resolution
- Reverse Zones:
- X.168.192.in-addr.arpa (LAN network PTR records)
- Y.168.192.in-addr.arpa (WiFi network PTR records)
- Secure Updates: RNDC key authentication prevents unauthorized DNS changes
Update Process Flow
Streamlined DNS update process ensures consistent hostname resolution:
- Lease Assignment: Client receives IP address and provides hostname
- Forward Update: Hostname added to zen.lan zone pointing to assigned IP
- Reverse Update: PTR record created for IP-to-hostname lookups
- Conflict Resolution: Duplicate hostnames prevented through conflict detection
- Cache Refresh: DNS resolvers notified of new records
Cross-Network Hostname Resolution
Unified namespace spans both network segments:
- Single Domain: All devices use zen.lan regardless of network segment
- Universal Resolution: Hostnames resolve from both wired and wireless networks
- Service Discovery: mDNS and NetBIOS names work across network boundaries
Network Routing Integration
Automatic Route Distribution
DHCP server configures client routing for seamless inter-network access:
- Classless Routes: RFC 3442 routes enable cross-network communication
- Microsoft Compatibility: MS classless routes support Windows clients
- Network Awareness: Clients automatically discover both network segments
Cross-Network Communication
Clients receive routing configuration enabling network bridging:
- Wired to Wireless: LAN clients can reach WiFi devices (192.168.77.x via 192.168.76.1)
- Wireless to Wired: WiFi clients can reach LAN devices (192.168.76.x via 192.168.77.1)
- Service Access: File sharing and network services available from both networks
- Internet Access: All clients route internet traffic through appropriate gateway
Service Integration Benefits
DNS and DNS filter Coordination
DHCP service works seamlessly with DNS infrastructure:
- Automatic Filtering: All DHCP clients receive ad-blocking DNS by default
- Local Resolution: Internal hostnames resolve without external DNS queries
- Fallback Protection: Clients configured with backup DNS servers for redundancy
Samba File Sharing Integration
NetBIOS service announcement enables automatic file sharing discovery:
- Network Browsing: Clients automatically discover shared folders
- Cross-Platform: Windows, Mac, and Linux clients receive NetBIOS configuration
- Zero Configuration: File shares accessible without manual client setup
Time Synchronization
NTP server announcement ensures accurate timekeeping across all devices:
- Local NTP: Pimeleon router provides time service reducing internet dependencies
- Backup Servers: Ukrainian NTP pool servers provide fallback time sources
- Network Consistency: All devices maintain synchronized time for logging and security
Performance Characteristics
Lease Management Efficiency
Optimized lease handling for Pi 3B+ hardware:
- Short Default Leases: 30-minute leases enable rapid IP address recycling
- Extended Maximum: 7-day maximum accommodates long-term device assignments
- Update Batching: DNS update optimization reduces server processing overhead
- Memory Management: Efficient lease tracking minimizes RAM usage
Network Capacity Planning
Realistic capacity limits for hardware constraints:
- Total Address Space: 308 dynamic IP addresses across both networks
- Concurrent Clients: ~100-130 devices realistic for Pi 3B+ performance
- Lease Database: Efficient storage and retrieval of active leases
- Response Times: Sub-second DHCP response for typical network loads
DNS Update Performance
Optimized dynamic DNS operations:
- Batch Updates: Multiple DNS changes combined into single transactions
- Conflict Detection: Prevents duplicate work and update failures
- Update Optimization: Only necessary DNS changes are processed
- Zone Locking: Prevents concurrent update conflicts
Monitoring & troubleshooting
Service Health Monitoring
Regular monitoring ensures reliable DHCP service:
- Lease Pool Status: Track available IP addresses in each network segment
- DNS Update Success: Monitor dynamic DNS registration success rates
- Client Response Times: Measure DHCP response performance
- Static Host Conflicts: Detect MAC address or IP conflicts
Common troubleshooting Scenarios
- Lease Exhaustion: Monitor available IP addresses in each pool
- DNS Update Failures: Check RNDC key authentication and zone permissions
- Cross-Network Routing: Verify classless route distribution to clients
- Static Host Issues: Validate MAC addresses and IP assignments
Log Analysis
Key log locations for service diagnosis:
- DHCP Logs:
/var/log/dhcp/dhcpd.logfor lease and error information - DNS Update Logs: Monitor Bind9 logs for dynamic update status
- System Logs: Check systemd journals for service startup and errors
Configuration Management
Key Configuration Files
- Main Config:
/etc/dhcp/dhcpd.conf(primary DHCP server configuration) - RNDC Key:
/etc/dhcp/rndc.key(DNS update authentication) - Service Control: SystemD unit for service management
- Network Integration: Coordination with systemd-networkd interface configuration
Backup and Recovery
- Configuration Backup: Regular backup of dhcpd.conf and key files
- Lease Database: Backup of active lease information for continuity
- DNS Zone Coordination: Ensure dynamic DNS zones remain synchronized
- Service Dependencies: Proper startup order with DNS and network services
Related Documentation
- Ip Allocation - Network addressing scheme
- DNS Architecture - DNS service integration
- Topology - Network architecture overview