Version increased to 0.9.8cvs20050303-2.1maemo2.
[udhcp] / udhcpc.8
1 .TH UDHCPC 8 2001-09-26 GNU/Linux "GNU/Linux Administrator's Manual"
2 .SH NAME
3 udhcpc \- very small DHCP client
4 .SH SYNOPSIS
5 .B udhcpc
6 .RI [ OPTION ]...
7 .SH DESCRIPTION
8 The udhcp client negotiates a lease with the DHCP server and
9 executes a script when it is obtained or lost.
10 .SH OPTIONS
11 .TP
12 .BI \-c\  CLIENTID ,\ \-\-clientid= CLIENTID
13 Send the client identifier
14 .IR CLIENTID .
15 .TP
16 .BR -f ,\  \-\-foreground
17 Do not fork after obtaining a lease.
18 .TP
19 .BI \-H\  HOSTNAME ,\ \-\-hostname= HOSTNAME
20 Send the client hostname
21 .IR HOSTNAME .
22 .TP
23 .BI \-h\  HOSTNAME
24 Alias for -H
25 .IR HOSTNAME .
26 .TP
27 .BI \-i\  INTERFACE ,\ \-\-interface= INTERFACE
28 Configure
29 .IR INTERFACE .
30 .TP
31 .BR -n ,\  \-\-now
32 Exit with failure if a lease cannot be obtained.
33 .TP
34 .BI \-p\  FILE ,\ \-\-pidfile= FILE
35 Write the process ID of the daemon to
36 .IR FILE .
37 .TP
38 .BR -q ,\  \-\-quit
39 Exit after obtaining a lease.
40 .TP
41 .BI \-r\  ADDRESS ,\ \-\-request= ADDRESS
42 Request IP address
43 .IR ADDRESS .
44 .TP
45 .BI \-s\  FILE ,\ \-\-script= FILE
46 Use script
47 .IR FILE .
48 .TP
49 .BR -v ,\  \-\-version
50 Display version.
51 .SH USAGE
52 When an event occurs,
53 .B udhcpc
54 executes a script.  There are four possible arguments to this
55 script:
56 .TP
57 .B deconfig
58 .B deconfig
59 is used when
60 .B udhcpc
61 starts, and when a lease is lost.  The script should put the
62 interface in an up, but deconfigured, state.
63 .TP
64 .B bound
65 .B bound
66 is used when
67 .B udhcpc
68 moves from an unbound to a bound state.  The script should
69 configure the interface and set any other relevant parameters
70 (e.g., default gateway, dns server, etc.).
71 .TP
72 .B renew
73 .B renew
74 is used when
75 .B udhcpc
76 when a lease is renewed.  The interface is already
77 configured, so the IP address will not change.  Other parameters
78 (e.g., default gateway, subnet mask, dns server) may.
79 .TP
80 .B nak
81 .B nak
82 is used when
83 .B udhcpc
84 receieves a NAK packet from the server. The
85 enviromental variable
86 .B $message
87 will contain the reason for the
88 NAK message if the server included one. Processing this message
89 is optional, as the script will also be called with deconfig if
90 need be.
91 .PP
92 Parameters are passed to the script via the following environment
93 variables:
94 .TP
95 .B HOME
96 The inherited HOME, or "/" if it is unset.
97 .TP
98 .B PATH
99 The inherited PATH, or "/bin:/usr/bin:/sbin:/usr/sbin" if it is
100 unset.
101 .TP
102 .B interface
103 The interface.
104 .TP
105 .B ip
106 The client IP address.
107 .TP
108 .B siaddr
109 The BOOTP next server option.
110 .TP
111 .B sname
112 The BOOTP server name option.
113 .TP
114 .B boot_file
115 The BOOTP boot file option.
116 .TP
117 .B subnet
118 The subnet mask.
119 .TP
120 .B timezone
121 The timezone offset from UTC in seconds.
122 .TP
123 .B router
124 The list of routers.
125 .TP
126 .B timesvr
127 The list of time servers.
128 .TP
129 .B namesvr
130 The list of IEN 116 name servers.
131 .TP
132 .B dns
133 The list of DNS servers.
134 .TP
135 .B logsvr
136 The list of MIT-LCS UDP log servers.
137 .TP
138 .B cookiesvr
139 The list of RFC 865 cookie servers.
140 .TP
141 .B lprsvr
142 The list of LPR servers.
143 .TP
144 .B hostname
145 The host name.
146 .TP
147 .B bootsize
148 The length in 512-octet blocks of the bootfile.
149 .TP
150 .B domain
151 The domain name of the network.
152 .TP
153 .B swapsvr
154 The client's swap server.
155 .TP
156 .B rootpath
157 The path of the client's root dist.
158 .TP
159 .B ipttl
160 The TTL.
161 .TP
162 .B mtu
163 The MTU.
164 .TP
165 .B broadcast
166 The broadcast address.
167 .TP
168 .B ntpsrv
169 The list of NTP servers.
170 .TP
171 .B wins
172 The list of WINS servers.
173 .TP
174 .B lease
175 The lease time in seconds.
176 .TP
177 .B dhcptype
178 The DHCP message type (safely ignored).
179 .TP
180 .B serverid
181 The server IP address.
182 .TP
183 .B message
184 Reason for a DHCPNAK.
185 .TP
186 .B tftp
187 The TFTP server name.
188 .TP
189 .B bootfile
190 The bootfile name.
191 .SH FILES
192 .TP
193 .I /etc/udhcpc/default.script
194 Script run when leases are obtained or lost.
195 .SH NOTES
196 .B udhcpc
197 responds to the following signals:
198 .TP
199 .B SIGUSR1
200 This signal causes
201 .B udhcpc
202 to renew the current lease or, if it does not have one, obtain a
203 new lease.
204 .TP
205 .B SIGUSR2
206 This signal caused
207 .B udhcpc
208 to release the current lease.