~phlash/ppp_dhcp6c

PPPD plugin that provides a DHCPv6 client
bug fix: actually wait for debounce period
bug fix: ensure initial protocol state is valid
bug fix: uninstal correct file!

refs

trunk
browse  log 

clone

read-only
https://git.sr.ht/~phlash/ppp_dhcp6c
read/write
git@git.sr.ht:~phlash/ppp_dhcp6c

You can also use your local clone with git send-email.

#DHCPv6 client implementation as a PPPD plugin

#Why?

Because existing implementations (eg: wide-dhcp6c) have undesirable behaviours when run from pppd such as not terminating correctly when signalled (even with SIGKILL), not detecting link failure and retaining instance locks thus preventing new instances from starting, always writing a PID file, spewing lots of log information to std[out/err]. There are other issues.

#How?

Running as a pppd plugin, we are notified of IPv6 coming up (via IPv6CP), and can solicit address information from our peer, either an Identity Association for Non-temporary Address (aka IA_NA request) or an Identity Association for Prefix Delegation (aka IA_PD request). We should receive appropriate IPv6 address information and can proceed to configure the local network interface known to pppd. Should this fail (timeout, rejection) we repeat the process while the link remains valid.

Should the link fail, we are notified and can drop local interface configuration. We would expect pppd to also terminate and be restarted (by some managing process) in such cases.

Should only IPv6CP fail (no idea how?) we are notified and act as above, dropping the local interface configuration then waiting for IPv6 to be restored at some point, or for pppd to terminate.

At regular intervals (as specified by the server that assigned our addresses), we must ask to Renew the associated lease. Should this fail (timeout, rejection) we drop the local interface configuration and re-start the soliciting process while the link remains valid as above.

DHCPv6 also supports Releasing addresses, however there is no point supporting this unless we need dynamic re-configuration. Not this time..

#Configuration

We add additional configuration options to pppd, usable in the normal way (command line, options file):

  • dhcp6c_duid: provides a fixed DHCP Unique ID assigned to this client. Must be a hexadecimal string containing a complete DUID with type indicators (see $11 of RFC8415). Default is a random UUID.
  • dhcp6c_iana: when set this provides an Identity Association ID and enables requesting a non-temporary address. Default is unset, zero (0) is valid.
  • dhcp6c_iapd: TBD

#Build & install

#Dependencies

  • ppp-dev package to provide headers (pppd.h)
  • libc6-dev package for system headers (netinet/ip6.h)

#Tooling

  • make, gcc standard packages
  • to run the test framework, you need to chown root:dip pppd dnsmasq ppp0_config as root, then everything can run as you via ppp_test.sh

#Targets

  • all: builds plugin locally
  • clean: remove build intermediates & outputs
  • install: copies built plugin to /usr/local/sbin/ (you need root privs of course)
  • uninstall: removes plugin from install location (you need root privs of course)
Do not follow this link