Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/torxed/slimdhcp
A very slim DHCP server
https://github.com/torxed/slimdhcp
Last synced: about 11 hours ago
JSON representation
A very slim DHCP server
- Host: GitHub
- URL: https://github.com/torxed/slimdhcp
- Owner: Torxed
- License: gpl-3.0
- Created: 2016-03-26T09:51:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-18T07:33:38.000Z (over 2 years ago)
- Last Synced: 2024-05-02T06:18:04.959Z (5 months ago)
- Language: Python
- Size: 7.53 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# slimDHCP
A very slim DHCP serverRunning
-------sudo python slimDHCP.py --interface=ens4u1 --cache_db=session.json --filter_clients='{"00:00:00:00:00:01" : "192.168.1.5"}'
Notes
-----
Requires Linux and Python3.3+.
There are some defaults if no options are given:* subnet `192.168.1.0`
* netmask `255.255.255.0`
* gateway `.1` *(first avail in subnet)*
* dns_servers `8.8.8.8` and `4.4.4.4`Parameters
----------All parameters must be JSON compliant.
This in order for `json.loads()` to parse some of them.```
--cache_dir='./'
--cache_db=null
--subnet="192.168.1.0" ("192.168.1.0/24" is also valid and thus --netmask is ignored)
--netmask="255.255.255.0" (/24 is also valid)
--gateway=null (takes first available host from subnet definition)
--is_gateway=false (more details below)
--dns_servers="8.8.8.8,4.4.4.4" (json compliant string required)
--pxe_bin=null
--pxe_dir='./'
--pxe_config=null
--filter_clients='{"de:ad:be:ef:00:01" : true, "de:ad:be:ef:00:02" : "192.168.1.10"}'
```There are some special flags, one such flag is `--is_gateway`.
`--is_gateway=false` simply tells slimDHCP that we're not the gateway, and thus won't give out a DHCP lease to our own MAC even if we tried.
However, if we set `--is_gateway=true` and our local interface sends a DHCP request, we will hand out a lease to ourselves.
See `false` as a passive mode. And in both cases, the `gateway` ip is reserved and won't be given out.