From 49b91b4fc97fe00c25b9225c8a27f80dc5b45cf7 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Tue, 14 May 2019 17:59:16 +0300 Subject: [PATCH] + doc: DHCP static leases --- AGHTechDoc.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/AGHTechDoc.md b/AGHTechDoc.md index 62ea41d4..c6f615f3 100644 --- a/AGHTechDoc.md +++ b/AGHTechDoc.md @@ -19,9 +19,11 @@ Contents: * Update client * Delete client * Enable DHCP server + * "Show DHCP status" command * "Check DHCP" command * "Enable DHCP" command * Static IP check/set + * Add a static lease ## First startup @@ -302,6 +304,38 @@ Algorithm: * UI shows the status +### "Show DHCP status" command + +Request: + + GET /control/dhcp/status + +Response: + + 200 OK + + { + "config":{ + "enabled":false, + "interface_name":"...", + "gateway_ip":"...", + "subnet_mask":"...", + "range_start":"...", + "range_end":"...", + "lease_duration":60, + "icmp_timeout_msec":0 + }, + "leases":[ + {"ip":"...","mac":"...","hostname":"...","expires":"..."} + ... + ], + "static_leases":[ + {"ip":"...","mac":"...","hostname":"..."} + ... + ] + } + + ### "Check DHCP" command Request: @@ -428,6 +462,40 @@ If we would set a different IP address, we'd need to replace the IP address for ip addr replace dev eth0 192.168.0.1/24 +### Add a static lease + +Request: + + POST /control/dhcp/add_static_lease + + { + "mac":"...", + "ip":"...", + "hostname":"..." + } + +Response: + + 200 OK + + +### Remove a static lease + +Request: + + POST /control/dhcp/remove_static_lease + + { + "mac":"...", + "ip":"...", + "hostname":"..." + } + +Response: + + 200 OK + + ## Device Names and Per-client Settings When a client requests information from DNS server, he's identified by IP address.