• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/odhcp6c/README.md

  1 # odhcp6c - Embedded DHCPv6 Client
  2 
  3 
  4 ### Abstract
  5 
  6 odhcp6c is a minimal DHCPv6 and RA-client for use in embedded Linux systems
  7 especially routers.
  8 
  9 
 10 ## Features
 11 
 12 1. IPv6 bootstrap from different environments with autodetection
 13         * RA only
 14         * RA + stateless DHCPv6
 15         * RA + stateful DHCPv6 (either IA_NA or IA_PD or both)
 16 
 17 2. Handling of non-temporary addresses (IA_NA)
 18         * handling of valid and preferred lifetimes
 19         * automatic fallback to stateless or PD-only mode
 20 
 21 3. Support for DHCPv6 extension
 22         * Reconfigure-Messages
 23         * Prefix Delegation (including handling of valid and preferred lifetimes)
 24         * Prefix Exclusion
 25         * DNS Configuration Options
 26         * NTP Options
 27         * SIP Options
 28         * Information-Refresh Options
 29         * Configurable SOL_MAX_RT
 30         * DS-Lite AFTR-Name Option
 31         * Softwire address and port mapped clients (MAP, LW4over6)
 32         * CER-ID (experimental)
 33         * Server unicast Option
 34 
 35 4. Support for requesting and parsing Router Advertisements
 36         * parsing of prefixes, routes, MTU and RDNSS options
 37 
 38 
 39 ## Compiling
 40 
 41 odhcp6c uses cmake:
 42 * To prepare a Makefile use:  `cmake`.
 43 * To build / install use: `make` / `make install` afterwards.
 44 * To build DEB or RPM packages use: `make package` afterwards.
 45 
 46 
 47 ## State Script
 48 
 49 The state script is called whenever the DHCPv6 state changes.
 50 The script is called with the following parameters: `<interface>` `<state>`
 51 
 52 | State                                                         | Description                                                                                                           |
 53 |-----------------------------------|-------------------------------------------------------------------|
 54 | `started`                                                     | The DHCPv6 client has been started                                                            |
 55 | `bound`                                                       | A suitable server was found and addresses or prefixes acquired        |
 56 | `informed`                                            | A stateless information request returned updated information          |
 57 | `updated`                                                     | Updated information was received from the DHCPv6 server                       |
 58 | `ra-updated`                                          | Updated information was received via Router Advertisements            |
 59 | `rebound`                                                     | The DHCPv6 client switched to another server                                          |
 60 | `unbound`                                                     | The DHCPv6 client lost all DHCPv6 servers and will restart            |
 61 | `stopped`                                                     | The DHCPv6 client has been stopped                                                            |
 62 
 63 
 64 
 65 
 66 | Environment                                           | Description                                                                                                           |
 67 |-----------------------------------|-------------------------------------------------------------------|
 68 | `SERVER`                                                      | A space-separated list of upstream IPv6 routers                                       |
 69 | `RDNSS`                                                       | A space-separated list of recursive DNS servers                                       |
 70 | `DOMAINS`                                                     | A space-separated list of DNS search domains                                          |
 71 | `SNTP_IP`                                                     | A space-separated list of SNTP server IP addresses                            |
 72 | `SNTP_FQDN`                                           | A space-separated list of SNTP server FQDNs                                           |
 73 | `SIP_IP`                                                      | A space-separated list of SIP servers                                                         |
 74 | `SIP_DOMAIN`                                          | A space-separated list of SIP domains                                                         |
 75 | `OPTION_<num>`                                        | Custom option received as base-16                                                                     |
 76 |                                                                       | E.g. (Client ID) `OPTION_1` : `000300010badf00dcafe`                          |
 77 | `PREFIXES`                                            | A space-separated list of prefixes currently assigned                         |
 78 |                                                                       |       Format: `<prefix>/<length>,preferred,valid[,excluded=<excluded-prefix>/<length>][,class=<prefix class #>]`|
 79 | `ADDRESSES`                                           | A space-separated list of addresses currently assigned                        |
 80 |                                                                       |       Format: `<address>/<length>,preferred,valid`                                    |
 81 | `RA_ADDRESSES`                                        | A space-separated list of addresses from RA-prefixes                          |
 82 |                                                                       |       Format: `<address>/<length>,preferred,valid`                                    |
 83 | `RA_ROUTES`                                           | A space-separated list of routes from the RA                                          |
 84 |                                                                       |       Format: `<address>/<length>,gateway,valid,metric`                               |
 85 | `RA_DNS`                                                      | A space-separated list of recursive DNS servers from the RA           |
 86 | `RA_DOMAINS`                                          | A space-separated list of DNS search domains from the RA                      |
 87 | `RA_HOPLIMIT`                                         | Highest hop-limit received in RAs                                                                     |
 88 | `RA_MTU`                                                      | MTU-value received in RA                                                                                      |
 89 | `RA_REACHABLE`                                        | ND Reachability time                                                                                          |
 90 | `RA_RETRANSMIT`                                       | ND Retransmit time                                                                                            |
 91 | `AFTR`                                                        | The DS-Lite AFTR domain name                                                                          |
 92 | `CER`                                                         | A space-separated list of CER-id IPv6                                                         |
 93 | `MAPE` / `MAPT` / `LW4O6`             | Softwire rules for MAPE, MAPT and LW4O6                                                       |
 94 | `PASSTHRU`                                            | The content of the last packet relayed                                                        |
 95 
 96 
 97 
 98 ## Ubus Integration
 99 
100 Build with `ENABLE_UBUS` flag to connect odhcp6c to ubus. Object is registered at : `odhcp6c.{ifname}`.
101 
102 Events are emitted whenever the DHCPv6 state changes and can replace the use of a state script. The variables are the same as those defined in the State Script section.
103 
104 The following RPC methods are available:
105 
106 
107 | Method                                                        | I/O           | Description                                                                                                           |
108 |-----------------------------------|-----------|-------------------------------------------------------------------|
109 | `get_state()`                                         | Output        | Returns the DHCPv6 state                                                                                      |
110 |                                                                       |                       | OUT : see State Script section                                                                        |
111 | `get_statistics()`                            | Output        | Returns the packet statistics                                                                         |
112 |                                                                       |                       | `dhcp_solicit` : Total number of SOLICIT messages sent                        |
113 |                                                                       |                       | `dhcp_advertise` : Total number of ADVERTISE messages received        |
114 |                                                                       |                       | `dhcp_request` : Total number of REQUEST messages sent                        |
115 |                                                                       |                       | `dhcp_confirm` : Total number of CONFIRM messages sent                        |
116 |                                                                       |                       | `dhcp_renew` : Total number of RENEW messages sent                            |
117 |                                                                       |                       | `dhcp_rebind` : Total number of REBIND messages sent                          |
118 |                                                                       |                       | `dhcp_reply` : Total number of REPLY messages received                        |
119 |                                                                       |                       | `dhcp_release` : Total number of RELEASE messages sent                        |
120 |                                                                       |                       | `dhcp_decline` : Total number of DECLINE messages sent                        |
121 |                                                                       |                       | `dhcp_reconfigure` : Total number of RECONFIGURE messages received    |
122 |                                                                       |                       | `dhcp_information_request` : Total number of INFORMATION-REQUEST messages sent        |
123 |                                                                       |                       | `dhcp_discarded_packets` : Total number of discarded DHCP packets     |
124 |                                                                       |                       | `dhcp_transmit_failures` : Total number of DHCP messages that failed to be transmitted        |
125 | `reset_statistics()`                          | Input         | Reset packet statistics                                                                                       |
126 | `reconfigure_dhcp({...})`                     | Input         | Reconfigure DHCP settings                                                                                     |
127 |                                                                       |                       | `dscp` (int) : DSCP value used for DHCP packets                                       |
128 |                                                                       |                       | `release` (bool) : Send a RELEASE message on exit/reset                       |
129 |                                                                       |                       | `sol_timeout` (int) : Maximum timeout for DHCPv6-SOLICIT                      |
130 |                                                                       |                       | `sk_prio` (int) : Packet kernel priority                                                      |
131 |                                                                       |                       | `opt_requested` (int[]) : Options to be requested                                     |
132 |                                                                       |                       | `opt_strict` (bool) : Do not request any options except those specified       |
133 |                                                                       |                       | `opt_reconfigure` (bool) : Send Accept Reconfigure option                     |
134 |                                                                       |                       | `opt_fqdn` (bool) : Send Client FQDN option                                           |
135 |                                                                       |                       | `opt_unicast` (bool) : Ignore Server Unicast option                           |
136 |                                                                       |                       | `opt_send` (string[]) : Options to be sent                                            |
137 |                                                                       |                       | `req_addresses` (string{`try|force|none`}) : Request addresses        |
138 |                                                                       |                       | `req_prefixes` (int) : Request Prefixes (0 = auto)                            |
139 |                                                                       |                       | `stateful_only` (bool) : Discard advertisements without any address or prefix proposed        |
140 |                                                                       |                       | `irt_default` (int) : Default information refresh time (expressed in seconds)         |
141 |                                                                       |                       | `irt_min` (int) : Minimum information refresh time (expressed in seconds)                     |
142 |                                                                       |                       | `rand_factor` (int) : Randomization factor for retransmission timeout                         |
143 |                                                                       |                       | `auth_protocol` (string) : Authentication protocol to be used (`None`,`ConfigurationToken`, `ReconfigureKeyAuthentication`)|
144 |                                                                       |                       | `auth_token` (string) : Authentication token to be used when AuthenticationProtocol is set to `ConfigurationToken`|
145 |                                                                       |                       | `msg_solicit` (table) : Retransmission settings for SOLICIT                           |
146 |                                                                       |                       | `msg_request` (table) : Retransmission settings for REQUEST                           |
147 |                                                                       |                       | `msg_renew` (table) : Retransmission settings for RENEW                                       |
148 |                                                                       |                       | `msg_rebind` (table) : Retransmission settings for REBIND                                     |
149 |                                                                       |                       | `msg_release` (table) : Retransmission settings for RELEASE                           |
150 |                                                                       |                       | `msg_decline` (table) : Retransmission settings for DECLINE                           |
151 |                                                                       |                       | `msg_inforeq` (table) : Retransmission settings for INFORMATION-REQUEST       |
152 |                                                                       |                       |                                                                                                                                                       |
153 |                                                                       |                       | Input arguments for Retransmission settings :                                                         |
154 |                                                                       |                       | `delay_max` (int) : Maximum delay of first message (expressed in seconds)     |
155 |                                                                       |                       | `timeout_init` (int) : Initial message timeout (expressed in seconds)         |
156 |                                                                       |                       | `timeout_max` (int) : Initial message timeout (expressed in seconds)          |
157 |                                                                       |                       | `rc_max` (int) : Maximum message retry attempts                                                       |
158 | `renew()`                                                     | Input         | Force transmission of RENEW/INFORMATION-REQUEST messages                                      |
159 | `release()`                                           | Input         | Force transmission of RELEASE message and start new cycle                                     |
160 

This page was automatically generated by LXR 0.3.1.  •  OpenWrt