Differences

This shows you the differences between two versions of the page.

doc:uci:dhcp [2013/01/30 05:05]
mwarning fix typo
doc:uci:dhcp [2013/05/23 14:58] (current)
p0g0
Line 38: Line 38:
<sortable> <sortable>
-^ Name ^ Type ^ Required ^ Default ^ Option ^ Description ^ +^ Name ^ Type ^ Default ^ Option ^ Description ^ 
-| ''add_local_domain'' | boolean | no | ''1'' | | Add the local domain as search directive in resolv.conf. | +| ''add_local_domain'' | boolean | ''1'' | | Add the local domain as search directive in resolv.conf. | 
-| ''add_local_hostname'' | boolean | no | ''1'' | | Add A and PTR records automatically for the local hostname. | +| ''add_local_hostname'' | boolean | ''1'' | | Add A and PTR records automatically for the local hostname. | 
-| ''addnhosts'' | list of file paths | no | //(none)// | ''-H'' | Additional host files to read for serving DNS responses | +| ''addnhosts'' | list of file paths | //(none)// | ''-H'' | Additional host files to read for serving DNS responses | 
-| ''authoritative'' | boolean | no | ''0'' | ''-K'' | Force //dnsmasq// into authoritative mode. This speeds up DHCP leasing. Used if this is the only server on the network | +| ''authoritative'' | boolean | ''0'' | ''-K'' | Force //dnsmasq// into authoritative mode. This speeds up DHCP leasing. Used if this is the only server on the network | 
-| ''bogusnxdomain'' | list of IP addresses | no | //(none)// | ''-B'' | IP addresses to convert into NXDOMAIN responses (to counteract "helpful" upstream DNS servers that never return NXDOMAIN). | +| ''bogusnxdomain'' | list of IP addresses | //(none)// | ''-B'' | IP addresses to convert into NXDOMAIN responses (to counteract "helpful" upstream DNS servers that never return NXDOMAIN). | 
-| ''boguspriv'' | boolean | no | ''0'' | ''-b'' | Reject reverse lookups to private IP ranges where no corresponding entry exists in ''/etc/hosts'' | +| ''boguspriv'' | boolean | ''0'' | ''-b'' | Reject reverse lookups to private IP ranges where no corresponding entry exists in ''/etc/hosts'' | 
-| ''cachelocal'' | boolean | no | ''1'' | | When set to ''0'', use each network interface's ''dns'' address in the local ''/etc/resolv.conf''. Normally, only the loopback address is used, and all queries go through //dnsmasq//. | +| ''cachelocal'' | boolean | ''1'' | | When set to ''0'', use each network interface's ''dns'' address in the local ''/etc/resolv.conf''. Normally, only the loopback address is used, and all queries go through //dnsmasq//. | 
-| ''cachesize'' | integer | no | ''150'' | ''-c'' | Size of //dnsmasq// query cache. | +| ''cachesize'' | integer | ''150'' | ''-c'' | Size of //dnsmasq// query cache. | 
-| ''dbus'' | boolean | no | ''0'' | ''-1'' | Enable DBus messaging for //dnsmasq//.\\ :!: Standard builds of //dnsmasq// on OpenWRT do not include DBus support. | +| ''dbus'' | boolean | ''0'' | ''-1'' | Enable DBus messaging for //dnsmasq//.\\ :!: Standard builds of //dnsmasq// on OpenWRT do not include DBus support. | 
-| ''dhcp_boot'' | string | no | //(none)// | <code>--dhcp-boot</code> | Specifies BOOTP options, in most cases just the file name | +| ''dhcp_boot'' | string | //(none)// |<code>--dhcp-boot</code>| Specifies BOOTP options, in most cases just the file name | 
-| ''dhcphostsfile'' | file path | no | //(none)// | <code>--dhcp-hostsfile</code> | Specify an external file with per host DHCP options | +| ''dhcphostsfile'' | file path | //(none)// | <code>--dhcp-hostsfile</code> | Specify an external file with per host DHCP options | 
-| ''dhcpleasemax'' | integer | no | ''150'' | ''-X'' | Maximum number of DHCP leases | +| ''dhcpleasemax'' | integer | ''150'' | ''-X'' | Maximum number of DHCP leases | 
-| ''dnsforwardmax'' | integer | no | ''150'' | ''-0'' (zero) | Maximum number of concurrent connections | +| ''dnsforwardmax'' | integer | ''150'' | ''-0'' (zero) | Maximum number of concurrent connections | 
-| ''domain'' | domain name | no | //(none)// | ''-s'' | DNS domain handed out to DHCP clients | +| ''domain'' | domain name | //(none)// | ''-s'' | DNS domain handed out to DHCP clients | 
-| ''domainneeded'' | boolean | no | ''0'' | ''-D'' | Tells //dnsmasq// never to forward queries for plain names, without dots or domain parts, to upstream nameservers. If the name is not known from /etc/hosts or DHCP then a "not found" answer is returned | +| ''domainneeded'' | boolean | ''0'' | ''-D'' | Tells //dnsmasq// never to forward queries for plain names, without dots or domain parts, to upstream nameservers. If the name is not known from /etc/hosts or DHCP then a "not found" answer is returned | 
-| ''ednspacket_max'' | integer | no | ''1280'' | ''-P'' | Specify the largest EDNS.0 UDP packet which is supported by the DNS forwarder | +| ''ednspacket_max'' | integer | ''1280'' | ''-P'' | Specify the largest EDNS.0 UDP packet which is supported by the DNS forwarder | 
-| ''enable_tftp'' | boolean | no | ''0'' | <code>--enable-tftp</code> | Enable the builtin TFTP server | +| ''enable_tftp'' | boolean | ''0'' | <code>--enable-tftp</code> | Enable the builtin TFTP server | 
-| ''expandhosts'' | boolean | no | ''0'' | ''-E'' | Add the local domain part to names found in ''/etc/hosts'' | +| ''expandhosts'' | boolean | ''0'' | ''-E'' | Add the local domain part to names found in ''/etc/hosts'' | 
-| ''filterwin2k'' | boolean | no | ''0'' | ''-f'' | Do not forward requests that cannot be answered by public name servers | +| ''filterwin2k'' | boolean | ''0'' | ''-f'' | Do not forward requests that cannot be answered by public name servers | 
-| ''fqdn'' | boolean | no | ''0'' | <code>--dhcp-fqdn</code> | Do not resolve unqualifed local hostnames. Needs ''domain'' to be set. | +| ''fqdn'' | boolean | ''0'' | <code>--dhcp-fqdn</code> | Do not resolve unqualifed local hostnames. Needs ''domain'' to be set. | 
-| ''interface'' | list of interface names | no | //(all interfaces)// | ''-i'' | List of interfaces to listen on. If unspecified, //dnsmasq// will listen to all interfaces except those listed in ''notinterface''. | +| ''interface'' | list of interface names | //(all interfaces)// | ''-i'' | List of interfaces to listen on. If unspecified, //dnsmasq// will listen to all interfaces except those listed in ''notinterface''. | 
-| ''leasefile'' | file path | no | //(none)// | ''-l'' (ell) | Store DHCP leases in this file | +| ''leasefile'' | file path | //(none)// | ''-l'' (ell) | Store DHCP leases in this file | 
-| ''local'' | string | no | //(none)// | ''-S'' | Look up DNS entries for this domain from ''/etc/hosts''. This follows the same syntax as ''server'' entries, see the man page. | +| ''local'' | string | //(none)// | ''-S'' | Look up DNS entries for this domain from ''/etc/hosts''. This follows the same syntax as ''server'' entries, see the man page. | 
-| ''localise_queries'' | boolean | no | ''0'' | ''-y'' | Choose IP address to match the incoming interface if multiple addresses are assigned to a host name in ''/etc/hosts''. :!: Note well the spelling of this option. | +| ''localise_queries'' | boolean | ''0'' | ''-y'' | Choose IP address to match the incoming interface if multiple addresses are assigned to a host name in ''/etc/hosts''. :!: Note well the spelling of this option. | 
-| ''logqueries'' | boolean | no | ''0'' | ''-q'' | Log the results of DNS queries, dump cache on SIGUSR1 | +| ''logqueries'' | boolean | ''0'' | ''-q'' | Log the results of DNS queries, dump cache on SIGUSR1 | 
-| ''nodaemon'' | boolean | no | ''0'' | ''-d'' | Don't daemonize the //dnsmasq// process | +| ''nodaemon'' | boolean | ''0'' | ''-d'' | Don't daemonize the //dnsmasq// process | 
-| ''nohosts'' | boolean | no | ''0'' | ''-h'' | Don't read DNS names from ''/etc/hosts'' | +| ''nohosts'' | boolean | ''0'' | ''-h'' | Don't read DNS names from ''/etc/hosts'' | 
-| ''nonegcache'' | boolean | no | ''0'' | ''-N'' | Disable caching of negative "no such domain" responses | +| ''nonegcache'' | boolean | ''0'' | ''-N'' | Disable caching of negative "no such domain" responses | 
-| ''noresolv'' | boolean | no | ''0'' | ''-R'' | Don't read upstream servers from ''/etc/resolv.conf'' | +| ''noresolv'' | boolean | ''0'' | ''-R'' | Don't read upstream servers from ''/etc/resolv.conf'' | 
-| ''notinterface'' | list of interface names | no | //(none)// | ''-I'' (eye) | Interfaces //dnsmasq// should not listen on. | +| ''notinterface'' | list of interface names | //(none)// | ''-I'' (eye) | Interfaces //dnsmasq// should not listen on. | 
-| ''nonwildcard'' | boolean | no | ''0'' | ''-z'' | Bind only configured interface addresses, instead of the wildcard address.  | +| ''nonwildcard'' | boolean | ''0'' | ''-z'' | Bind only configured interface addresses, instead of the wildcard address.  | 
-| ''port'' | port number | no | ''53'' | ''-p'' | Listening port for DNS queries, disables DNS server functionality if set to ''0'' | +| ''port'' | port number | ''53'' | ''-p'' | Listening port for DNS queries, disables DNS server functionality if set to ''0'' | 
-| ''queryport'' | integer | no | //(none)// | ''-Q'' | Use a fixed port for outbound DNS queries | +| ''queryport'' | integer | //(none)// | ''-Q'' | Use a fixed port for outbound DNS queries | 
-| ''readethers'' | boolean | no | ''0'' | ''-Z'' | Read static lease entries from ''/etc/ethers'', re-read on SIGHUP | +| ''readethers'' | boolean | ''0'' | ''-Z'' | Read static lease entries from ''/etc/ethers'', re-read on SIGHUP | 
-| ''resolvfile'' | file path | no | ''/etc/resolv.conf'' | ''-r'' | Specifies an alternative resolv file | +| ''resolvfile'' | file path | ''/etc/resolv.conf'' | ''-r'' | Specifies an alternative resolv file | 
-| ''server'' | list of strings | no | //(none)// | ''-S'' | List of DNS servers to forward requests to. See the //dnsmasq// man page for syntax details. | +| ''server'' | list of strings | //(none)// | ''-S'' | List of DNS servers to forward requests to. See the //dnsmasq// man page for syntax details. | 
-| ''strictorder'' | boolean | no | ''0'' | ''-o'' | Obey order of DNS servers in ''/etc/resolv.conf'' | +| ''strictorder'' | boolean | ''0'' | ''-o'' | Obey order of DNS servers in ''/etc/resolv.conf'' | 
-| ''tftp_root'' | directory path | no | //(none)// | <code>--tftp-root</code> | Specifies the TFTP root directory | +| ''tftp_root'' | directory path | //(none)// | --tftp-root | Specifies the TFTP root directory | 
-| ''rebind_protection'' | boolean | no | ''1'' | <code>--stop-dns-rebind</code> | Enables DNS rebind attack protection by discarding upstream RFC1918 responses | +| ''rebind_protection'' | boolean | ''1'' | --stop-dns-rebind | Enables DNS rebind attack protection by discarding upstream RFC1918 responses | 
-| ''rebind_localhost'' | boolean | no | ''0'' | <code>--rebind-localhost-ok</code> | Allows upstream 127.0.0.0/8 responses, required for DNS based blacklist services, only takes effect if rebind protection is enabled | +| ''rebind_localhost'' | boolean | ''0'' |--rebind-localhost-ok| Allows upstream 127.0.0.0/8 responses, required for DNS based blacklist services, only takes effect if rebind protection is enabled | 
-| ''rebind_domain'' | list of domain names | no | //(none)// | <code>--rebind-domain-ok</code> | List of domains to allow RFC1918 responses for, only takes effect if rebind protection is enabled |+| ''rebind_domain'' | list of domain names | //(none)// | --rebind-domain-ok | List of domains to allow RFC1918 responses for, only takes effect if rebind protection is enabled |
</sortable> </sortable>
Line 130: Line 130:
This adds the fixed IP address 192.168.1.2 and the name "mypc" for a machine with the (Ethernet) hardware address 00:11:22:33:44:55 This adds the fixed IP address 192.168.1.2 and the name "mypc" for a machine with the (Ethernet) hardware address 00:11:22:33:44:55
^ Name ^ Type ^ Required ^ Default ^ Description ^ ^ Name ^ Type ^ Required ^ Default ^ Description ^
-| ''ip'' | string | yes | //(none)// | The IP address to be used for this host. | +| ''ip'' | string | yes | //(none)// | 'ignore' or the IP address to be used for this host. | 
-| ''mac'' | string | yes | //(none)// | The hardware address of this host. |+| ''mac'' | string | no | //(none)// | The hardware address of this host. |
| ''name'' | string | no | //(none)// | Optional hostname to assign. | | ''name'' | string | no | //(none)// | Optional hostname to assign. |
As well as adding ''host'' sections, you can also enable the ''dnsmasq'' section option ''readethers'', and add entries to the ''/etc/ethers'' file. As well as adding ''host'' sections, you can also enable the ''dnsmasq'' section option ''readethers'', and add entries to the ''/etc/ethers'' file.
- 
-//Note: uci requires you to specify MAC address(es) of ''mypc'' client, however ''dnsmasq'' itself don't. IP address is then assigned to DHCP client according to the name he uses, not the MAC address he has. If you decide to go this way, you will need to edit ''/etc/dnsmasq.conf'' file. Details can be found in ''dnsmasq'' man page in [[http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html|--dhcp-host]] description. See the [[https://dev.openwrt.org/ticket/11928|ticket]] for updates.// 
==== DHCP OPTION example to set an alternative default gateway ==== ==== DHCP OPTION example to set an alternative default gateway ====
Line 210: Line 208:
<code>dhcp-script=/sbin/action.sh</code> <code>dhcp-script=/sbin/action.sh</code>
 +
 +==== DNS and DHCP Ports ====
 +DNS needs TCP and UDP port 53 open on the firewall.  DHCP needs UDP ports 67 and 68 open from your zone to/from the firewall.  See http://wiki.openwrt.org/doc/recipes/guest-wlan and http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html (viz "--dhcp-alternate-port") for more information.
===== Examples ===== ===== Examples =====

Back to top

doc/uci/dhcp.1359518731.txt.bz2 · Last modified: 2013/01/30 05:05 by mwarning