dhcp-client

command module
v0.0.0-...-c1c930b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2020 License: Unlicense Imports: 7 Imported by: 0

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

./compile.sh
./toydhcp [-ip4 address]

Outline

DHCP Protocol Diagram

flow
Wikipedia - Gelmo96 / CC BY-SA (https://creativecommons.org/licenses/by-sa/4.0)

DHCP Packet Sequence

DISCOVER

discover

OFFER

offer

REQUEST

request

(N)ACKNOWLEDGE

acknowledge

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
The TCP/IP Guide - DHCP Options

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL