Skip to content
/ dhcpd-pd Public

DHCPv6 client for IPv6 Prefix delegation (RFC 3633). Mirror only

License

Notifications You must be signed in to change notification settings

ensc/dhcpd-pd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

dhcp-pd is a DHCPv6 client for IPv6 Prefix delegation (RFC 3633). It implements only the required network operations and calls scripts which have to do the interface configuration.

This program was designed for dialup connections (e.g. PPPoE) to internet providers and monitors state of the interface. It will e.g. rerequest an IAPD when interface went down at the daily reconnect.

Limitations

  • supports only one interface; when there are multiple interfaces, program must be started for each of them

Usage

/usr/sbin/dhcpd-pd ppp0 /etc/dhcpd-pd/run [HHMM]
  • HHMM is optional and specifies the time of the daily reconnect

Scripts

see run for a sample script.

Environment

DHCP_INTERFACE
the interface name
DHCP_OP
the operation; this is the same value as the first parameter of the script
DHCP_IAPD_ID
the numeric IAID (32 bits) of the IAPD
DHCP_IAPD_TM
the time in seconds since epoch when IAPD information were received from server. The special value of 0 means there is no such time (e.g. no lease available yet).
DHCP_IAPD_T1
the time in seconds since epoch when lease must be renewed from server (RENEW operation). The special value of 0 means there is no such time (e.g. no lease available yet) and -1 means that T1 lasts infinitely.
DHCP_IAPD_T1_SEC
the raw value in seconds of T1; basically there holds DHCP_IAPD_T1 = DHCP_IAPD_TM + DHCP_IAPD_T1_SEC
DHCP_IAPD_T2
the time in seconds since epoch when lease must be renewed from any server (REBIND operation). The special value of 0 means there is no such time (e.g. no lease available yet) and -1 means that T2 lasts infinitely.
DHCP_IAPD_T2_SEC
the raw value in seconds of T2; basically there holds DHCP_IAPD_T2 = DHCP_IAPD_TM + DHCP_IAPD_T2_SEC
DHCP_SERVER_ADDR
(optionally) the IPv6 address of the DHCP server
DHCP_SERVER_PREF
(optionally) the numeric preference value (8 bits) of the DHCP server
DHCP_IAPREFIX_NUM
number of prefixes
DHCP_IAPREFIX_x_TM
the time in seconds since epoch when prefix has been received
DHCP_IAPREFIX_x_LT_PREF
the pref lifetime of the prefix in seconds since epoch; x is the index of the prefix
DHCP_IAPREFIX_x_LT_PREF_SEC
the raw pref lifetime of the prefix in seconds; x is the index of the prefix
DHCP_IAPREFIX_x_LT_VALID
the valid lifetime of the validix in seconds since epoch; x is the index of the validix
DHCP_IAPREFIX_x_LT_VALID_SEC
the raw valid lifetime of the validix in seconds; x is the index of the validix
DHCP_IAPREFIX_x_NET_ADDR
the IPv6 address of the prefix
DHCP_IAPREFIX_x_NET_LEN
the len of the prefix

Example

DHCP_IAPD_ID=1
DHCP_IAPD_T1=1546689795
DHCP_IAPD_T1_SEC=900
DHCP_IAPD_T2=1546690335
DHCP_IAPD_T2_SEC=1440
DHCP_IAPD_TM=1546688895
DHCP_IAPREFIX_0_LT_PREF=1546690695
DHCP_IAPREFIX_0_LT_PREF_SEC=1800
DHCP_IAPREFIX_0_LT_VALID=1546703295
DHCP_IAPREFIX_0_LT_VALID_SEC=14400
DHCP_IAPREFIX_0_NET_ADDR=2003:cf:7746:5200::
DHCP_IAPREFIX_0_NET_LEN=56
DHCP_IAPREFIX_0_TM=1546688895
DHCP_IAPREFIX_NUM=1
DHCP_INTERFACE=ppp0
DHCP_NOW=1546688895
DHCP_OP=ACTIVE
DHCP_SERVER_ADDR=fe80::106:106:3e9b:f7b6
DHCP_SERVER_PREF=0

Requirements:

  • OpenSSL (for SHA hashing of the client uid)

TODOs

  • add in-source SHA algorithm to avoid OpenSSL dep
  • allow more configuration
    • custom lifetimes
    • custom iapd identifiers