('A DHCP client designed to be used for troubleshooting of DHCP servers',)
Project description
DORA The DHCP Client
Version 0.1.3
A Python command line DHCP client that was designed for troubleshooting. Provides an interface for sending tailored DHCP packets to a DHCP server and inspect the response.
Installation
Python
Run directly with Python3.8, install using pip:
pip install dora-dhcp-client
Alternate Installation
Alternately install and run as a Docker image.
sudo curl -L --fail https://raw.githubusercontent.com/vfrazao-ns1/dora_dhcp_client/master/run.sh -o /usr/local/bin/dora
sudo chmod +x /usr/local/bin/dora
Requirements
- Python 3.8.0 or higher
- Docker (Optional)
NOTE: This has been tested on Ubuntu 18.04 and Windows WSL. May or may not work on other platforms.
Basic Usage
Check if port 68 (and port 67 if relay field is set) is currently bound to by another program (for example with: sudo netstat -tulpn
). If there is anything bound to these ports they must first be killed, and prevented from restarting.
Run dora.py
with a -h
/--help
flag to see all the available options:
$ sudo dora.py -h
usage: dora.py [-h] [-i INTERFACE] [-a MAC_ADDR] [-d] [-u] [-s SERVER] [-r RELAY] [-v] [-o OPTIONS] [-p PORT] [--target_port TARGET_PORT] [-@ TARGET]
optional arguments:
-h, --help show this help message and exit
-i INTERFACE, --interface INTERFACE
Interface to bind to and make DHCP requests
-a MAC_ADDR, --mac_addr MAC_ADDR
MAC address to use (default random)
-d, --debug Print debug statements
-u, --unicast Send DHCP packets over unicast to specified server
-s SERVER, --server SERVER
Server to send DHCP packets. Required for unicast and for relay use.
-r RELAY, --relay RELAY
Address to set the giaddr field to
-v, --verbose Verbosity level (v: show ack packet, vv: show all packets, vvv: show debug)
-o OPTIONS, --options OPTIONS
JSON body of options to include in requests
-p PORT, --port PORT Port to send packets from on client machine
--target_port TARGET_PORT
Port to send to on target machine
-@ TARGET Given an IP address of a DHCP server, sends unicast requests
NOTE: dora.py must be able to bind to port 68 (and 67 under certain circumstances) in order to function properly. This may require the use of sudo
. This may also require stopping any services (e.g., systemd-networkd) that are already bound to those ports.
Running dora.py
without supplying any options just binds to an arbitrary interface and sends out broadcast UDP packets.
-i
allows selection of the interface to bind to (e.g., "eth0")
-a
allows the MAC address to be set in both the client identifier option and the chaddr field
-d
Prints very low level debug statements and includes any Python tracebacks
-u
sets the unicast flag in the DHCP packet
-s
specifies an unicast address to send the packets to, the -u
flag should be selected but doesnt need to be
-r
sets the giaddr field of the packet
-v
sets the verbosity level of the output. No v
flags means that the client will just report success or failure to obtain a lease. A single v
flag (-v
) will pretty print a human readable form of the DHCPACK packet. This will show the set of options that the DHCP server has sent us back. Two v
flags (-vv
) will pretty print the all four packets in the lease handshake (DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK). Three v
flags will print everything stated before and it will enable the debug output (same as setting the -d
flag).
-p
sets the client port (default: 68)
--target_port
sets the server port (default: 67)
-@
is a convenience flag that sets the unicast flag, sets the giaddr field to the IP of the current machine, and sends unicast packets to the server specified
NOTE the DHCP RFC 2131 sets the client port to 68 and the server port to 67 options that set different client or server ports are not expected to work with an RFC compliant server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dora_dhcp_client-0.1.3.tar.gz
.
File metadata
- Download URL: dora_dhcp_client-0.1.3.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b422c3111fb32500e428d2d863f180c5042c192a80757078d1d8b12f0c53228 |
|
MD5 | afa3f730ead1e576f12263bf2734e6b9 |
|
BLAKE2b-256 | 9caee89e88407ce67676560e75ac0db433d1444666448f9945f7fc6924bad10c |
File details
Details for the file dora_dhcp_client-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: dora_dhcp_client-0.1.3-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7358637e387d9f48a7a3e99e407d7a97e5be9587bd6215ba683b2822eb5d146d |
|
MD5 | 7b0a70ec290ec15e61912a9a69ea59d9 |
|
BLAKE2b-256 | e01e1fc561b9d88df7c6cc287190c6eb44dec8d9c9961c0ffbb1a4b8387af1e7 |