| Crates.io | mini-dhcp |
| lib.rs | mini-dhcp |
| version | 0.5.1 |
| created_at | 2024-11-25 09:05:17.767115+00 |
| updated_at | 2026-01-23 09:48:30.654609+00 |
| description | A minimalistic DHCP server |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1460092 |
| size | 89,856 |
A lightweight DHCP server implementation in Rust that handles basic DHCP operations including IP address assignment and lease management.
Basic usage example:
use mini_dhcp::MiniDHCPConfiguration;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Initialize the DHCP server with network interface
let config = MiniDHCPConfiguration::new("eth0".to_string()).await?;
// Start the DHCP server
mini_dhcp::start(config).await?;
Ok(())
}
The DHCP server is configured to:
The server stores lease information in a CSV file (leases.csv) in the current directory. The file is human-readable and can be inspected or edited manually if needed.
This server is designed for single-server environments and has known deviations from RFC 2131/2132.
Key intentional deviation: When a client attempts to renew or rebind a lease that the server has no record of (e.g., after server restart), RFC 2131 specifies the server MUST remain silent. Instead, mini-dhcp accepts the renewal if the IP is available - providing better UX in single-server setups.