Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docs:techref:odhcpd [2018/03/24 00:32] – Updated RA parms as per odhcpd in git README cvmiller | docs:techref:odhcpd [2024/04/09 03:19] (current) – [Table] systemcrash | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== odhcpd ====== | ====== odhcpd ====== | ||
| - | **Embedded DHCP/ | + | See also: [[https:// |
| - | + | ||
| - | Development is happening at: https:// | + | |
| + | odhcpd is an embedded DHCP/ | ||
| ===== Abstract ===== | ===== Abstract ===== | ||
| + | odhcpd is a daemon for serving and relaying IP management protocols to configure clients and downstream routers. | ||
| + | It tries to follow the [[https:// | ||
| - | odhcpd is a daemon for serving and relaying IP management protocols to | + | odhcpd provides server services for DHCP, RA, stateless |
| - | configure clients and downstream routers. It tries to follow the RFC 6204 | + | |
| - | requirements for IPv6 home routers. | + | |
| - | + | ||
| - | odhcpd provides server services for DHCP, RA, stateless and stateful DHCPv6, | + | |
| - | prefix delegation and can be used to relay RA, DHCPv6 and NDP between routed | + | |
| - | (non-bridged) interfaces in case no delegated prefixes are available. | + | |
| ===== Features ===== | ===== Features ===== | ||
| + | ==== Router Discovery (RD) ==== | ||
| + | Router Discovery (RD) support (solicitations and advertisements) with 2 modes of operation: | ||
| + | - RD Server mode: Router Discovery (RD) server for slave interfaces: | ||
| + | - Automatic detection of prefixes, delegated prefix, default routes and MTU. | ||
| + | - Automatic re-announcement of any changes in either prefixes or routes. | ||
| + | - RD Relay mode: Router Discovery (RD) relay between master and slave interfaces. | ||
| + | - Supports rewriting of the announced DNS server addresses. | ||
| - | 1. Router Discovery | + | ==== DHCPv6 ==== |
| - | server: RD server | + | DHCPv6 |
| - | a) automatic detection of prefixes, delegated prefix | + | - DHCPv6 Server mode: stateless, stateful and Prefix Delegation (PD) server |
| - | b) automatic reannouncement when changes | + | - Stateless |
| + | - Prefix delegation support. | ||
| + | - Dynamic reconfiguration of any changes | ||
| + | - Hostname detection and hosts-file creation. | ||
| + | - DHCPv6 Relay mode: A mostly standards-compliant DHCPv6-relay: | ||
| + | - Supports rewriting of the announced DNS server addresses. | ||
| - | | + | ==== DHCPv4 ==== |
| - | a) support for rewriting announced DNS-server | + | - Stateless and stateful DHCPv4 |
| - | + | ||
| - | 2. DHCPv6-support with 2 modes of operation | + | |
| - | | + | |
| - | a) stateless and stateful address assignment | + | |
| - | b) prefix delegation support | + | |
| - | c) dynamic reconfiguration in case prefixes change | + | |
| - | d) hostname detection and hosts-file creation | + | |
| - | relay: mostly standards-compliant DHCPv6-relay | + | ==== Neighbor Discovery Proxy (NDP) ==== |
| - | a) support for rewriting announced DNS-server addresses | + | Proxy for Neighbor Discovery solicitation and advertisement messages (NDP): |
| - | + | | |
| - | 3. DHCPv4-support | + | - Supports marking interfaces as " |
| - | | + | |
| - | 4. Proxy for Neighbor Discovery messages (solicitations and advertisments) | + | Interfaces marked as " |
| - | a) support for auto-learning routes to the local routing table | + | |
| - | b) support for marking interfaces | + | |
| - | | + | |
| - | [Warning: you should provide additional firewall rules for security] | + | |
| - | + | ||
| - | + | ||
| - | ===== Compiling ===== | + | |
| - | + | ||
| - | odhcpd uses cmake: | + | |
| - | * To prepare a Makefile use: "cmake ." | + | |
| - | * To build / install use: " | + | |
| - | * To build DEB or RPM packages use: "make package" | + | |
| + | :!: Interfaces marked as external need additional firewall rules for security! | ||
| ===== Configuration ===== | ===== Configuration ===== | ||
| + | odhcpd uses a UCI configuration file in ''/ | ||
| - | odhcpd | + | ==== odhcpd |
| - | and may also receive information from ubus | + | Configuration for the odhcp daemon. |
| - | < | + | ^ Name ^ Type ^ Default |
| - | Section of type odhcpd | + | | '' |
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| - | Option Type Default Description | + | ==== dhcp section ==== |
| - | legacy bool 0 Enable | + | Configuration for DHCPv4, DHCPv6, RA and NDP services. |
| - | no dhcpv4 option set | + | |
| - | leasefile string DHCP/ | + | |
| - | leasetrigger string Lease trigger script | + | |
| + | < | ||
| + | ^ Name ^ Type ^ Required | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | | '' | ||
| + | </ | ||
| - | Sections of type dhcp (configure DHCP / DHCPv6 / RA / NDP service) | + | ==== host section ==== |
| + | The '' | ||
| - | Option Type Default Description | + | ^ Name ^ Type ^ Required ^ Default |
| - | interface string <name of UCI section> | + | | '' |
| - | ifname string < | + | | '' |
| - | networkid string same as ifname compat. alias for ifname | + | | '' |
| - | ignore bool 0 ignore this interface | + | | '' |
| - | master bool 0 is a master interface | + | | '' |
| - | for relaying | + | | '' |
| - | ra string disabled Router Advert service | + | Example '' |
| - | [disabled|server|relay|hybrid] | + | |
| - | dhcpv6 string disabled DHCPv6 service | + | |
| - | [disabled|server|relay|hybrid] | + | |
| - | dhcpv4 string disabled DHCPv4 service | + | |
| - | [disabled|server] | + | |
| - | ndp string disabled Neighbor Discovery Proxy | + | |
| - | [disabled|relay|hybrid] | + | |
| - | dynamicdhcp bool 1 dynamically create leases | + | ===== ubus API ===== |
| - | for DHCPv4 and DHCPv6 | + | Replace dnsmasq with odhcpd |
| - | dns list < | + | |
| - | accepts | + | |
| - | domain list < | + | |
| - | leasetime string 12h DHCPv4 address leasetime | + | <code bash> |
| - | start integer 100 DHCPv4 pool start | + | ubus -v list dhcp |
| - | limit integer 150 DHCPv4 pool size | + | ubus call dhcp ipv4leases |
| - | + | ubus call dhcp ipv6leases | |
| - | ra_default integer 0 Override default route | + | |
| - | 0: default | + | |
| - | 1: ignore no public address | + | |
| - | 2: ignore all | + | |
| - | ra_management integer 1 RA management mode | + | |
| - | 0: no M-Flag but A-Flag | + | |
| - | 1: both M and A | + | |
| - | 2: M but not A | + | |
| - | ra_offlink bool 0 Announce prefixes off-link | + | |
| - | ra_preference string medium Route(r) preference | + | |
| - | [medium|high|low] | + | |
| - | + | ||
| - | ra_maxinterval | + | |
| - | sending unsolicited RA | + | |
| - | ra_mininterval | + | |
| - | sending unsolicited RA | + | |
| - | ra_lifetime integer 1800 Value to be placed in Router | + | |
| - | Lifetime field of RA | + | |
| - | ra_useleasetime | + | |
| - | limit for the preferred and | + | |
| - | valid lifetime of a prefix | + | |
| - | ra_reachabletime integer 0 Reachable Time in milliseconds to be | + | |
| - | advertised in RA messages | + | |
| - | ra_retranstime | + | |
| - | advertised in RA messages | + | |
| - | ra_hoplimit integer 0 Current hoplimit to be advertised | + | |
| - | in RA messages | + | |
| - | ra_mtu | + | |
| - | RA messages | + | |
| - | + | ||
| - | ndproxy_routing bool 1 Learn routes from NDP | + | |
| - | ndproxy_slave bool 0 NDProxy external slave | + | |
| - | ndproxy_static list Static NDProxy prefixes | + | |
| - | + | ||
| - | + | ||
| - | Sections of type host (static leases) | + | |
| - | Option Type Default Description | + | |
| - | ip string IP-Address to lease | + | |
| - | mac string MAC-address | + | |
| - | duid string DUID in base16 | + | |
| - | hostid string IPv6 host identifier | + | |
| - | name string Hostname | + | |
| </ | </ | ||
| - | :?: '' | + | ===== Compiling |
| - | * //A-Flag//: tell client to use auto-configuration i.e. SLAAC | + | odhcpd uses cmake. |
| - | * //M-Flag//: notify client that DHCPv6 server is available | + | |
| - | ===== Administration | + | |
| - | ==== ubus admin tool ==== | + | <code bash> |
| + | # Prepare | ||
| + | cmake . | ||
| - | < | + | # Build/ |
| - | ubus -v list | + | make |
| - | ubus -v list dhcp | + | make install |
| - | ubus call dhcp ipv4leases | + | |
| - | ubus call dhcp ipv6leases | + | |
| - | </ | + | |
| - | ===== Troubleshooting ===== | + | # Build DEB/RPM packages |
| - | + | make package | |
| - | ==== Many syslog messages of the format " | + | |
| - | + | ||
| - | On a default OpenWrt 14.07 install, odhcpd can log many messages to the syslog (viewable with " | + | |
| - | + | ||
| - | < | + | |
| - | Tue Oct 7 14:15:41 2014 daemon.warn odhcpd[746]: | + | |
| </ | </ | ||
| - | |||
| - | If IPv6 DHCP is not being used at all, odhcpd can have DHCPv6 disabled to avoid these messages. | ||
| - | |||
| - | < | ||
| - | # get the current setting for dhcpv6 in / | ||
| - | uci get dhcp.lan.dhcpv6 | ||
| - | </ | ||
| - | |||
| - | The default value is " | ||
| - | |||
| - | < | ||
| - | server | ||
| - | </ | ||
| - | |||
| - | Disable dhcpv6 and commit the change. | ||
| - | |||
| - | < | ||
| - | uci set dhcp.lan.dhcpv6=disabled | ||
| - | uci commit | ||
| - | </ | ||
| - | |||
| - | Confirm the new value is " | ||
| - | |||
| - | < | ||
| - | uci get dhcp.lan.dhcpv6 | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | disabled | ||
| - | </ | ||
| - | |||
| - | Now restart odhcpd (or just reboot the router). | ||
| - | |||
| - | < | ||
| - | / | ||
| - | </ | ||
| - | |||