-
Notifications
You must be signed in to change notification settings - Fork 2
dhcp server
Pre-Alpha. This page describes behavior that may change.
DHCP server plugin serving leases to LAN clients per RFC 2131/2132. Address pool with bitmap allocation, lease tracking with expiry timers, full DISCOVER/OFFER/REQUEST/ACK/NAK/RELEASE/DECLINE state machine, static MAC-to-IP mappings, subnet matching for multi-handler dispatch, and support for multiple named address ranges per subnet.
Subsystem.
service {
dhcp-server {
enabled true;
listen-interface eth1;
shared-network lan {
subnet 192.168.1.0/24 {
range {
start 192.168.1.100;
stop 192.168.1.200;
}
lease-time 86400;
default-router 192.168.1.1;
dns-server 8.8.8.8;
dns-server 8.8.4.4;
domain-name example.com;
static-mapping printer {
mac-address aa:bb:cc:dd:ee:ff;
ip-address 192.168.1.10;
}
}
}
}
}
A subnet can define multiple named address ranges for segmented allocation:
shared-network lan {
subnet 192.168.1.0/24 {
range clients {
start 192.168.1.100;
stop 192.168.1.199;
}
range servers {
start 192.168.1.200;
stop 192.168.1.250;
}
}
}
Each range has an independent bitmap pool. Address allocation prefers the client's last-assigned range.
| Path | Type | Default | Description |
|---|---|---|---|
dhcp-server/enabled |
boolean | false | Enable the DHCP server. |
dhcp-server/listen-interface |
leaf-list | -- | Interfaces to serve DHCP on. |
dhcp-server/shared-network/<name>/subnet/<prefix>/range/start |
string | -- | First allocatable address. |
dhcp-server/shared-network/<name>/subnet/<prefix>/range/stop |
string | -- | Last allocatable address. |
dhcp-server/shared-network/<name>/subnet/<prefix>/lease-time |
uint32 | 86400 | Lease duration in seconds (60-604800). |
dhcp-server/shared-network/<name>/subnet/<prefix>/default-router |
string | -- | Default gateway (option 3). |
dhcp-server/shared-network/<name>/subnet/<prefix>/dns-server |
leaf-list | -- | DNS servers (option 6). |
dhcp-server/shared-network/<name>/subnet/<prefix>/domain-name |
string | -- | Domain name (option 15). |
dhcp-server/shared-network/<name>/subnet/<prefix>/static-mapping/<name>/mac-address |
string | -- | Client MAC address. |
dhcp-server/shared-network/<name>/subnet/<prefix>/static-mapping/<name>/ip-address |
string | -- | Fixed IP for this client. |
The server binds to the specified interfaces using SO_BINDTODEVICE (Linux). For each DHCPDISCOVER, it finds the matching subnet by comparing the giaddr (relay agent) or the receiving interface's address against configured subnets. Addresses are allocated from the bitmap pool, preferring the client's previously-assigned address if still available.
Static mappings take priority over the dynamic pool. A client whose MAC matches a static mapping always receives that fixed address regardless of the pool state.
Leases are tracked with expiry timers. Expired leases return their address to the pool. The server handles RELEASE and DECLINE messages to free addresses early.
main/internal/plugins/dhcpserver/
Unreviewed draft. This wiki was authored in bulk and has not been reviewed. File corrections on the issue tracker.
- Overview
- YANG Model
- Editor Workflow
- Archive and Rollback
- System
- Interfaces
- VRRP
- BFD
- FIB
- OSPF
- IS-IS
- MPLS / LDP / RSVP-TE
- RSVP-TE
- SRv6
- Static Routes
- Policy Routing
- Firewall
- Traffic Control
- Class of Service
- L2TP/PPP
- PPPoE
- VPP Data Plane
- RPKI
- IPsec VPN
- TACACS+ AAA
- RADIUS AAA
- AS112 DNS
- Authorization
- Fleet
- BGP
- Starting and Stopping
- Show Commands
- Monitoring
- Flow Export
- DDoS Mitigation
- Anomaly Detection
- Health Checks
- Audit Trail
- Production Diagnostics
- Logging
- Operational Reports
- Healthcheck
- Self-Update
- Zero-Touch Provisioning
- MRT Analysis
- Upgrade and Restart
- Storage
- Policy
- Core
- Resilience
- Validation
- Capabilities
- Address Families
- Protocol
- Subsystems
- Infrastructure
- Route Server at an IXP
- Transit Edge with RPKI
- Public Looking Glass
- ExaBGP Migration Walkthrough
- FlowSpec Injection
- Chaos-Tested Peering
- AS Path Topology