https://github.com/determinatesystems/dhcpv6macd
A DHCPv6 service which assigns IPv6 addresses strictly on MAC address only. Potentially violates RFCs and specs.
https://github.com/determinatesystems/dhcpv6macd
Last synced: about 1 year ago
JSON representation
A DHCPv6 service which assigns IPv6 addresses strictly on MAC address only. Potentially violates RFCs and specs.
- Host: GitHub
- URL: https://github.com/determinatesystems/dhcpv6macd
- Owner: DeterminateSystems
- License: gpl-3.0
- Created: 2022-11-09T17:06:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-24T21:01:40.000Z (about 1 year ago)
- Last Synced: 2025-04-24T21:42:08.062Z (about 1 year ago)
- Language: Go
- Size: 66.4 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DHCPv6 server for difficult clients
This is a probably not RFC-compliant DHCPv6 server for a very narrow use case: assigning fixed IPv6 addresses based entirely on the client's MAC address.
Note that this DHCPv6 server does not respect or account for leases.
You should only use this if:
- You have clients you can't configure to use regular SLAAC with addresses following the usual EUI-64 scheme
- You still need these clients to have stable IP addresses, even if they don't keep any state (frequent OS wipes!)
We use this for macs where reprovisioning isn't 100% reliable, so we want them to get the same IP address even if _none of the scripts have run_.
This is why we wrote this horrible hack.
## Usage
```
go build .
sudo ./dhcpv6macd -interface enp2s0 -base-address 2001:db8:0123:4567::
```
There is also a NixOS module in the flake.nix.
See the `flake.nix` for a NixOS test involving router and a client.
## Address allocation scheme
The prefix is assumed to be at least a /80.
The MAC address is simply concatenated onto the prefix.
## What's not inside
This does not provide:
- Router advertisements (we use systemd-networkd for this)
- DHCPv4 (we use systemd-networkd for this)
- Options for DNS, NTP, etc
## License
This code is GPL-3, and based on Adguard's AdGuardHome DHCPv6 server: https://github.com/AdguardTeam/AdGuardHome/blob/167b1125113c86e6304471d80d983c17f0f707e3/internal/dhcpd/v6_unix.go.