Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 1 | # Sample udhcpd configuration file (/etc/udhcpd.conf) |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 2 | # Values shown are defaults |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 3 | |
| 4 | # The start and end of the IP lease block |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 5 | start 192.168.0.20 |
| 6 | end 192.168.0.254 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 7 | |
| 8 | # The interface that udhcpd will use |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 9 | interface eth0 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 10 | |
Denys Vlasenko | 777706c | 2010-03-19 23:42:23 +0100 | [diff] [blame] | 11 | # The maximum number of leases (includes addresses reserved |
| 12 | # by OFFER's, DECLINE's, and ARP conflicts). Will be corrected |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 13 | # if it's bigger than IP lease block, but it ok to make it |
| 14 | # smaller than lease block. |
| 15 | #max_leases 254 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 16 | |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 17 | # The amount of time that an IP will be reserved (leased to nobody) |
Denys Vlasenko | 87fa216 | 2010-03-20 18:06:23 +0100 | [diff] [blame] | 18 | # if a DHCP decline message is received (seconds) |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 19 | #decline_time 3600 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 20 | |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 21 | # The amount of time that an IP will be reserved |
Denys Vlasenko | 87fa216 | 2010-03-20 18:06:23 +0100 | [diff] [blame] | 22 | # if an ARP conflict occurs (seconds) |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 23 | #conflict_time 3600 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 24 | |
Denys Vlasenko | 87fa216 | 2010-03-20 18:06:23 +0100 | [diff] [blame] | 25 | # How long an offered address is reserved (seconds) |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 26 | #offer_time 60 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 27 | |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 28 | # If client asks for lease below this value, it will be rounded up |
Denys Vlasenko | 87fa216 | 2010-03-20 18:06:23 +0100 | [diff] [blame] | 29 | # to this value (seconds) |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 30 | #min_lease 60 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 31 | |
Denys Vlasenko | 14b162f | 2011-05-04 21:17:23 +0200 | [diff] [blame] | 32 | # The location of the pid file |
| 33 | #pidfile /var/run/udhcpd.pid |
| 34 | |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 35 | # The location of the leases file |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 36 | #lease_file /var/lib/misc/udhcpd.leases |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 37 | |
Denys Vlasenko | 14b162f | 2011-05-04 21:17:23 +0200 | [diff] [blame] | 38 | # The time period at which udhcpd will write out leases file. |
| 39 | # If this is 0, udhcpd will never automatically write leases file. |
| 40 | # Specified in seconds. |
| 41 | #auto_time 7200 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 42 | |
Denys Vlasenko | 87fa216 | 2010-03-20 18:06:23 +0100 | [diff] [blame] | 43 | # Every time udhcpd writes a leases file, the below script will be called |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 44 | #notify_file # default: no script |
| 45 | #notify_file dumpleases # useful for debugging |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 46 | |
Denys Vlasenko | a840884 | 2019-05-16 11:18:49 +0200 | [diff] [blame] | 47 | # The following are BOOTP specific options |
Denys Vlasenko | 2e7aa92 | 2010-03-21 02:22:07 +0100 | [diff] [blame] | 48 | # next server to use in bootstrap |
| 49 | #siaddr 192.168.0.22 # default: 0.0.0.0 (none) |
| 50 | # tftp server name |
| 51 | #sname zorak # default: none |
| 52 | # tftp file to download (e.g. kernel image) |
| 53 | #boot_file /var/nfs_root # default: none |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 54 | |
Denys Vlasenko | a840884 | 2019-05-16 11:18:49 +0200 | [diff] [blame] | 55 | # NOTE: "boot_file FILE" and "opt bootfile FILE" are conceptually the same, |
| 56 | # but "boot_file" goes into BOOTP-defined fixed-size field in the packet, |
| 57 | # whereas "opt bootfile" goes into DHCP option 0x43. |
| 58 | # Same for "sname HOST" and "opt tftp HOST". |
| 59 | |
Denys Vlasenko | 87fa216 | 2010-03-20 18:06:23 +0100 | [diff] [blame] | 60 | # Static leases map |
| 61 | #static_lease 00:60:08:11:CE:4E 192.168.0.54 |
Denys Vlasenko | a840884 | 2019-05-16 11:18:49 +0200 | [diff] [blame] | 62 | #static_lease 00:60:08:11:CE:3E 192.168.0.44 optional_hostname |
Denys Vlasenko | 87fa216 | 2010-03-20 18:06:23 +0100 | [diff] [blame] | 63 | |
Denys Vlasenko | 777706c | 2010-03-19 23:42:23 +0100 | [diff] [blame] | 64 | # The remainder of options are DHCP options and can be specified with the |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 65 | # keyword 'opt' or 'option'. If an option can take multiple items, such |
| 66 | # as the dns option, they can be listed on the same line, or multiple |
Denys Vlasenko | 2e7aa92 | 2010-03-21 02:22:07 +0100 | [diff] [blame] | 67 | # lines. |
Denys Vlasenko | 2b0e957 | 2009-06-17 13:22:26 +0200 | [diff] [blame] | 68 | # Examples: |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 69 | opt dns 192.168.10.2 192.168.10.10 |
| 70 | option subnet 255.255.255.0 |
| 71 | opt router 192.168.10.2 |
| 72 | opt wins 192.168.10.10 |
Denys Vlasenko | 777706c | 2010-03-19 23:42:23 +0100 | [diff] [blame] | 73 | option dns 129.219.13.81 # appended to above DNS servers for a total of 3 |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 74 | option domain local |
Denys Vlasenko | 2e7aa92 | 2010-03-21 02:22:07 +0100 | [diff] [blame] | 75 | option lease 864000 # default: 10 days |
Michael McTernan | 7b57ff4 | 2011-12-16 17:05:52 +0100 | [diff] [blame] | 76 | option msstaticroutes 10.0.0.0/8 10.127.0.1 # single static route |
| 77 | option staticroutes 10.0.0.0/8 10.127.0.1, 10.11.12.0/24 10.11.12.1 |
Denys Vlasenko | 266f6f1 | 2018-04-13 13:18:34 +0200 | [diff] [blame] | 78 | # Arbitrary option in hex or string form: |
Denys Vlasenko | 2903469 | 2010-04-04 15:38:22 +0200 | [diff] [blame] | 79 | option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4" |
Denys Vlasenko | 266f6f1 | 2018-04-13 13:18:34 +0200 | [diff] [blame] | 80 | option 14 "dumpfile" |
Russ Dill | 61fb489 | 2002-10-14 21:41:28 +0000 | [diff] [blame] | 81 | |
Denys Vlasenko | 2f1d13d | 2021-06-03 12:07:56 +0200 | [diff] [blame^] | 82 | # Currently supported options [hex option value] (for more info, see common.c): |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 83 | #opt lease NUM # [0x33] |
| 84 | #opt subnet IP # [0x01] |
| 85 | #opt broadcast IP # [0x1c] |
| 86 | #opt router IP_LIST # [0x03] |
| 87 | #opt ipttl NUM # [0x17] |
| 88 | #opt mtu NUM # [0x1a] |
| 89 | #opt hostname STRING # [0x0c] client's hostname |
| 90 | #opt domain STRING # [0x0f] client's domain suffix |
| 91 | #opt search STRING_LIST # [0x77] search domains |
| 92 | #opt nisdomain STRING # [0x28] |
| 93 | #opt timezone NUM # [0x02] (localtime - UTC_time) in seconds. signed |
Denys Vlasenko | 2f1d13d | 2021-06-03 12:07:56 +0200 | [diff] [blame^] | 94 | #opt tzstr STRING # [0x64] RFC 4833. IEEE 1003.1 TZ string |
| 95 | #opt tzdbstr STRING # [0x65] RFC 4833. Reference to the TZ database string |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 96 | #opt tftp STRING # [0x42] tftp server name |
| 97 | #opt bootfile STRING # [0x43] tftp file to download (e.g. kernel image) |
| 98 | #opt bootsize NUM # [0x0d] size of that file |
| 99 | #opt rootpath STRING # [0x11] (NFS) path to mount as root fs |
| 100 | #opt wpad STRING # [0xfc] Web Proxy Auto Discovery Protocol |
| 101 | #opt serverid IP # [0x36] default: server's IP |
Denys Vlasenko | 2f1d13d | 2021-06-03 12:07:56 +0200 | [diff] [blame^] | 102 | #opt message STRING # [0x38] error message (if set, udhcpd would send it on success too) |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 103 | #opt vlanid NUM # [0x84] 802.1P VLAN ID |
| 104 | #opt vlanpriority NUM # [0x85] 802.1Q VLAN priority |
Denys Vlasenko | 2f1d13d | 2021-06-03 12:07:56 +0200 | [diff] [blame^] | 105 | #opt vendor STRING # [0x3c] client's vendor string, not intended to be sent by DHCP servers |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 106 | # RFC 5071: PXELINUX Options |
Denys Vlasenko | 2f1d13d | 2021-06-03 12:07:56 +0200 | [diff] [blame^] | 107 | #opt 0xd0 F100747E # [0xd0] magic needed for other options to be recognized by clients |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 108 | #opt pxeconffile STRING # [0xd1] |
| 109 | #opt pxepathprefix STRING # [0xd2] |
| 110 | #opt reboottime NUM # [0xd3] bootstrap timeout |
Denys Vlasenko | 0f62c4d | 2010-03-20 07:12:21 +0100 | [diff] [blame] | 111 | # Options specifying server(s) |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 112 | #opt dns IP_LIST # [0x06] |
| 113 | #opt wins IP_LIST # [0x2c] |
| 114 | #opt nissrv IP_LIST # [0x29] |
| 115 | #opt ntpsrv IP_LIST # [0x2a] |
| 116 | #opt lprsrv IP_LIST # [0x09] |
| 117 | #opt swapsrv IP # [0x10] |
Nigel Hathaway | fb6b173 | 2011-04-26 02:50:00 +0200 | [diff] [blame] | 118 | # Options specifying routes |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 119 | #opt routes IP_PAIR_LIST # [0x21] |
| 120 | #opt staticroutes STATIC_ROUTES # [0x79] RFC 3442 classless static route option |
| 121 | #opt msstaticroutes STATIC_ROUTES # [0xf9] same, using MS option number |
Denys Vlasenko | e5ce91b | 2010-03-21 00:43:11 +0100 | [diff] [blame] | 122 | # Obsolete options, no longer supported |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 123 | #opt logsrv IP_LIST # [0x07] 704/UDP log server (not syslog!) |
| 124 | #opt namesrv IP_LIST # [0x05] IEN 116 name server, obsolete (August 1979!!!) |
| 125 | #opt cookiesrv IP_LIST # [0x08] RFC 865 "quote of the day" server, rarely (never?) used |
| 126 | #opt timesrv IP_LIST # [0x04] RFC 868 time server, rarely (never?) used |
Nigel Hathaway | fb6b173 | 2011-04-26 02:50:00 +0200 | [diff] [blame] | 127 | # TODO: in development |
Denys Vlasenko | edb74f4 | 2019-01-15 13:19:01 +0100 | [diff] [blame] | 128 | #opt userclass STRING # [0x4d] RFC 3004. set of LASCII strings. "I am a printer" etc |
| 129 | #opt sipsrv STRING LIST # [0x78] RFC 3361. flag byte, then: 0: domain names, 1: IP addrs |
| 130 | #opt ip6rd .... # [0xd4] IPv6 rapid deployment |