README 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. odhcpd - Embedded DHCP/DHCPv6/RA Server & Relay
  2. ** Abstract **
  3. odhcpd is a daemon for serving and relaying IP management protocols to
  4. configure clients and downstream routers. It tries to follow the RFC 6204
  5. requirements for IPv6 home routers.
  6. odhcpd provides server services for DHCP, RA, stateless and stateful DHCPv6,
  7. prefix delegation and can be used to relay RA, DHCPv6 and NDP between routed
  8. (non-bridged) interfaces in case no delegated prefixes are available.
  9. ** Features **
  10. 1. Router Discovery support (solicitations and advertisements) with 2 modes
  11. server: RD server for slave interfaces
  12. a) automatic detection of prefixes, delegated prefix and default routes, MTU
  13. b) automatic reannouncement when changes to prefixes or routes occur
  14. relay: RD relay between master and slave interfaces
  15. a) support for rewriting announced DNS-server addresses in relay mode
  16. 2. DHCPv6-support with 2 modes of operation
  17. server: stateless, stateful and PD-server mode
  18. a) stateless and stateful address assignment
  19. b) prefix delegation support
  20. c) dynamic reconfiguration in case prefixes change
  21. d) hostname detection and hosts-file creation
  22. relay: mostly standards-compliant DHCPv6-relay
  23. a) support for rewriting announced DNS-server addresses
  24. 3. DHCPv4-support
  25. server: stateless and stateful mode
  26. 4. Proxy for Neighbor Discovery messages (solicitations and advertisements)
  27. a) support for auto-learning routes to the local routing table
  28. b) support for marking interfaces "external" not proxying NDP for them
  29. and only serving NDP for DAD and for traffic to the router itself
  30. [Warning: you should provide additional firewall rules for security]
  31. ** Compiling **
  32. odhcpd uses cmake:
  33. * To prepare a Makefile use: "cmake ."
  34. * To build / install use: "make" / "make install" afterwards.
  35. * To build DEB or RPM packages use: "make package" afterwards.
  36. ** Configuration **
  37. odhcpd uses a UCI configuration file in /etc/config/dhcp for configuration
  38. and may also receive information from ubus
  39. Section of type odhcpd
  40. Option Type Default Description
  41. legacy bool 0 Enable DHCPv4 if start but
  42. no dhcpv4 option set
  43. maindhcp bool 0 Use odhcpd as the main DHCPv4
  44. service
  45. leasefile string DHCP/v6 lease/hostfile
  46. leasetrigger string Lease trigger script
  47. hostsfile string DHCP/v6 hostfile
  48. loglevel integer 6 Syslog level priority (0-7)
  49. Sections of type dhcp (configure DHCP / DHCPv6 / RA / NDP service)
  50. Option Type Default Description
  51. interface string <name of UCI section> logical OpenWrt interface
  52. ifname string <resolved from logical> physical network interface
  53. networkid string same as ifname compat. alias for ifname
  54. master bool 0 is a master interface
  55. for relaying
  56. ra string disabled Router Advert service
  57. [disabled|server|relay|hybrid]
  58. dhcpv6 string disabled DHCPv6 service
  59. [disabled|server|relay|hybrid]
  60. dhcpv4 string disabled DHCPv4 service
  61. [disabled|server]
  62. ndp string disabled Neighbor Discovery Proxy
  63. [disabled|relay|hybrid]
  64. dynamicdhcp bool 1 Dynamically create leases
  65. for DHCPv4 and DHCPv6
  66. dhcpv4_forcereconf bool 0 Force reconfiguration by sending
  67. force renew message even if the client
  68. did not include the force renew nonce
  69. capability option (RFC6704)
  70. dhcpv6_assignall bool 1 Assign all viable DHCPv6 addresses
  71. in statefull mode; if disabled
  72. only the DHCPv6 address having the
  73. longest preferred lifetime is assigned
  74. dhcpv6_hostidlength integer 12 Host ID length of dynamically created leases,
  75. allowed values: 12 - 64 (bits).
  76. dhcpv6_na bool 1 DHCPv6 stateful addressing hands out IA_NA -
  77. Internet Address - Network Address
  78. dhcpv6_pd bool 1 DHCPv6 stateful addressing hands out IA_PD -
  79. Internet Address - Prefix Delegation
  80. dhcpv6_pd_min_len integer - Minimum prefix length to delegate with IA_PD
  81. (value is adjusted if needed to be greater
  82. than the interface prefix length). Range [1,62]
  83. router list <local address> Routers to announce
  84. accepts IPv4 only
  85. dns list <local address> DNS servers to announce
  86. accepts IPv4 and IPv6
  87. dns_service bool 1 Announce the address of interface as DNS service
  88. if the list of dns is empty
  89. domain list <local search domain> Search domains to announce
  90. leasetime string 12h DHCPv4 address leasetime
  91. start integer 100 DHCPv4 pool start
  92. limit integer 150 DHCPv4 pool size
  93. preferred_lifetime string 12h Value for the preferred lifetime
  94. for a prefix
  95. ra_default integer 0 Override default route
  96. 0: default, 1: ignore no public address, 2: ignore all
  97. ra_flags list other-config List of RA flags to be
  98. advertised in RA messages
  99. [managed-config other-config home-agent none]
  100. ra_slaac bool 1 Announce slaac for a prefix
  101. ra_offlink bool 0 Announce prefixes off-link
  102. ra_preference string medium Route(r) preference
  103. [medium|high|low]
  104. ra_maxinterval integer 600 Maximum time allowed between
  105. sending unsolicited RA
  106. ra_mininterval integer 200 Minimum time allowed between
  107. sending unsolicited RA
  108. ra_lifetime integer 1800 Value to be placed in Router
  109. Lifetime field of RA
  110. ra_useleasetime bool 0 Use configured leasetime as
  111. limit for the preferred and
  112. valid lifetime of a prefix
  113. ra_reachabletime integer 0 Reachable Time in milliseconds to be
  114. advertised in RA messages
  115. ra_retranstime integer 0 Retransmit Time in milliseconds to be
  116. advertised in RA messages
  117. ra_hoplimit integer 0 Current hoplimit to be advertised
  118. in RA messages
  119. ra_mtu integer - MTU to be advertised in
  120. RA messages
  121. ra_dns bool 1 Announce DNS configuration in
  122. RA messages (RFC8106)
  123. ra_pref64 string Announce PREF64 option
  124. [IPv6 prefix] for NAT64 prefix (RFC8781)
  125. ndproxy_routing bool 1 Learn routes from NDP
  126. ndproxy_slave bool 0 NDProxy external slave
  127. prefix_filter string ::/0 Only advertise on-link prefixes within
  128. [IPv6 prefix] the provided IPv6 prefix; others are
  129. filtered out.
  130. ntp list <local address> NTP servers to announce
  131. accepts IPv4 and IPv6
  132. Sections of type host (static leases)
  133. Option Type Default Description
  134. ip string IP-Address to lease
  135. mac string MAC-address
  136. duid string DUID in base16
  137. hostid string IPv6 host identifier
  138. name string Hostname
  139. leasetime string DHCPv4/v6 leasetime