Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dechristopher/dhcp-client
Reference DHCP client in go
https://github.com/dechristopher/dhcp-client
client dhcp golang reference
Last synced: 23 days ago
JSON representation
Reference DHCP client in go
- Host: GitHub
- URL: https://github.com/dechristopher/dhcp-client
- Owner: dechristopher
- License: unlicense
- Created: 2020-04-09T00:28:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-10T12:26:34.000Z (about 4 years ago)
- Last Synced: 2024-06-20T03:29:17.036Z (5 months ago)
- Topics: client, dhcp, golang, reference
- Language: Go
- Homepage:
- Size: 432 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang DHCP Client Demonstration
A toy golang DHCP client to explore the DHCP protocol.
Randomizes request MAC address as to not step on the same lease over and over.## Usage
```bash
./compile.sh
./toydhcp [-ip4 address]
```## Outline
- [DHCP Protocol Diagram](#dhcp-protocol-diagram)
- [DHCP Packet Sequence](#dhcp-packet-sequence)
1. [DISCOVER](#discover)
2. [OFFER](#offer)
3. [REQUEST](#request)
4. [(N)ACKNOWLEDGE](#nacknowledge)
- [DHCP Option Codes](#dhcp-option-codes)
- [Additional Reading](#additional-reading)## DHCP Protocol Diagram
![flow](img/flow.png)
Wikipedia - Gelmo96 / CC BY-SA (https://creativecommons.org/licenses/by-sa/4.0)## DHCP Packet Sequence
#### DISCOVER
![discover](img/discover.png)#### OFFER
![offer](img/offer.png)#### REQUEST
![request](img/request.png)#### (N)ACKNOWLEDGE
![acknowledge](img/ack.png)## DHCP Option Codes
A small selection of important DHCP Option Codes
- *53* - DHCP Message Type (1B) - Indicates the specific type of DHCP message: DISCOVER(1), OFFER(2), REQUEST(3), DECLINE(4), ACK(5), NACK(6), RELEASE(7), INFORM(8)
- *50* - Requested IP Address (4B)
- *54* - DHCP Server Address (4B)
- *51* - Lease Time in Seconds (4B)
- *3* - Router IP Address (4B)
- *1* - Network Subnet Mask (4B)
- *255* - End Mark (1B)## Additional Reading
[Wikipedia.org - DHCP](https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol)
[The TCP/IP Guide - DHCP Options](http://www.tcpipguide.com/free/t_SummaryOfDHCPOptionsBOOTPVendorInformationFields-2.htm)