# dhcpsrv [![Latest release](https://img.shields.io/github/v/release/Engelgardt23/dhcpsrv)](https://github.com/Engelgardt23/dhcpsrv/releases/latest) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) πŸ‡ΊπŸ‡Έ English | [πŸ‡·πŸ‡Ί Русский](README.ru.md) A tiny portable **DHCP server** for the laptop of a storage/server engineer. One double-click β€” pick a NIC β€” done. Live table of clients, ping status, packet counters. No install, no Python required on the target machine. Built for the β€œplug the cable in, watch a BMC pop up with an IP” workflow during firmware updates, recovery, and benchmarks. > **Made by engelgardt.** --- ## Download Grab the latest release: [**releases page**](https://github.com/Engelgardt23/dhcpsrv/releases/latest). The asset is `dhcpsrv-portable-vX.Y.Z.zip` (~12 MB). ## Run 1. Unzip anywhere. 2. Double-click `dhcpsrv.exe`. 3. Accept the UAC prompt (admin is needed to bind UDP/67 and reconfigure the NIC). 4. Pick the network adapter wired to your server or switch β€” that's the only question. 5. `Ctrl+C` to stop. You'll be asked whether to revert the NIC to DHCP. ## Defaults (no other prompts) | Parameter | Value | |---|---| | Server IP | `10.10.10.1/24` | | Pool | `10.10.10.2 .. 10.10.10.51` (50 addresses) | | Lease | `7200 s` (2 hours β€” survives long stress tests) | | TFTP option | server IP (BMC will see your Tftpd32 immediately) | ## What's on screen ``` β”Œβ”€ dhcpsrv v1.0.0 made by engelgardt ────────────────────────────────────┐ β”‚ Server: 10.10.10.1/255.255.255.0 Pool: 10.10.10.2–10.10.10.51 … β”‚ β”‚ Leases: 3/50 Pkts: 47 DISCOVER: 12 REQUEST: 11 RELEASE: 0 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€ Clients ───────────────────────────────────────────────────────────────┐ β”‚ # β”‚ IP β”‚ Hostname β”‚ MAC β”‚ Last seen β”‚ Ping β”‚ β”‚ 1 β”‚ 10.10.10.2 β”‚ server-01 β”‚ a0:c5:f2:13:57:46 β”‚ 17:42:18 β”‚ OK β”‚ β”‚ 2 β”‚ 10.10.10.3 β”‚ server-02 β”‚ 70:b3:d5:11:22:33 β”‚ 17:42:21 β”‚ -- β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”Œβ”€ Events ────────────────────────────────────────────────────────────────┐ β”‚ [17:42:18] DISCOVER a0:c5:f2:13:57:46 β†’ OFFER 10.10.10.2 β”‚ β”‚ [17:42:18] REQUEST a0:c5:f2:13:57:46 β†’ ACK 10.10.10.2 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## Typical scenarios - **Server with shared LOM** β€” one cable into the BMC/host port, BMC and the host OS both get IPs from this DHCP. - **8-port switch** β€” laptop on one port, up to 7 servers on the rest; the 50-address pool covers everyone. - **Direct cable into a dedicated Mgmt port** β€” single client (the BMC). ## Compatibility - Windows 10 / 11. - Filters out wireless / VPN / virtual adapters from the picker (Wi-Fi, Cisco AnyConnect, Hyper-V, VMware, VirtualBox, TAP/TUN, WireGuard, OpenVPN, Tailscale, ZeroTier). - NIC names with spaces or non-ASCII characters are quoted correctly for `netsh`. ## Notes - Nothing is installed on your machine. Delete the folder to remove. - The UAC prompt appears every time. (If you want it gone on *your* machine, wire `dhcpsrv.exe` through a Scheduled Task with β€œRun with highest privileges” and launch via `schtasks /run /tn dhcpsrv`.) - If Tftpd32 has its DHCP module enabled, disable it β€” UDP/67 is then taken. - Lease defaults to 7200 s; the client renews at half lease. If you want it effectively forever, the source supports `2147483647` β€” rebuild from source if you really need it. ## Build from source ``` python -m pip install rich pyinstaller python -m PyInstaller --onefile --uac-admin --console --name dhcpsrv dhcpsrv_app.py ``` ## License MIT β€” see [LICENSE](LICENSE).