]> git.lizzy.rs Git - plan9front.git/blob - sys/man/8/ipconfig
merge
[plan9front.git] / sys / man / 8 / ipconfig
1 .TH IPCONFIG 8
2 .SH NAME
3 ipconfig, rip, linklocal \- Internet configuration and routing
4 .SH SYNOPSIS
5 .in +0.25i
6 .ti -0.25i
7 .B ip/ipconfig
8 .RB [ -6DGNOPdnpruX ]
9 .RB [ -b
10 .IR baud ]
11 .RB [ -c
12 .IR ctl ]
13 .RB [ -g
14 .IR gateway ]
15 .RB [ -h
16 .IR host ]
17 .RB [ -m
18 .IR mtu ]
19 .RB [ -o
20 .IR dhcp-opt ]
21 .RB [ -f
22 .IR dbfile ]
23 .RB [ -x
24 .IR netmtpt ]
25 [
26 .I type
27 [
28 .I device
29 ]\|]
30 .RI [ verb ]
31 [
32 .I local
33 [
34 .I mask
35 [
36 .I remote
37 [
38 .I file-server
39 [
40 .I auth
41 ]\|]\|]\|]\|]
42 .PP
43 .B ip/rip
44 .RB [ -bdr ]
45 .RB [ -x
46 .IR netmtpt ]
47 .PP
48 .B ip/linklocal
49 [
50 .B -t
51 .I gwipv4
52 ]
53 .I mac
54 \&...
55 .SH DESCRIPTION
56 .I Ipconfig
57 binds a device interface to a mounted IP stack (default
58 .BR /net )
59 and configures the interface with a local address and optionally
60 a mask, a remote address, a file server and an authentication server address.
61 If no device is specified, the first
62 .B ether
63 device on the mounted IP stack is used.
64 The addresses can be specified in the command line or obtained via DHCP.
65 If DHCP is requested, it will also obtain the addresses of DNS
66 servers, NTP servers, gateways, a Plan 9 file server,
67 and a Plan 9 authentication server.
68 Information from DHCP and IPv6 router advertisements is written to
69 .B /net/ndb
70 in the form of an
71 .IR ndb (8)
72 entry unless the
73 .B P
74 flag has been specified.
75 .PP
76 .I Type
77 may be
78 .BR ether ,
79 .BR gbe ,
80 .BR ppp ,
81 .BR pkt ,
82 or
83 .BR loopback .
84 The
85 .B gbe
86 type is equivalent to
87 .B ether
88 except that it allows jumbo packets (up to ~9KB).
89 The
90 .B pkt
91 interface passes all IP packets to and from a user program.
92 For
93 .B ppp
94 the device can be any byte stream device.
95 .PP
96 The verb (default
97 .IR add )
98 determines the action performed.  The usual verbs are:
99 .TF remove
100 .TP
101 .B add
102 if the device is not bound to the IP stack, bind it.
103 Add the given local address, mask, and remote address to the interface.
104 An interface may have multiple addresses.
105 .TP
106 .B remove
107 remove the address from the device interface.
108 .TP
109 .B unbind
110 unbind the device interface and all its addresses from the
111 IP stack.
112 .PD
113 .PP
114 The IPv6-specific verbs, which take different arguments, are:
115 .TP
116 .BI "add6 " "prefix pfx-len onlink auto validlt preflt"
117 sets the named IPv6 parameters; see
118 .IR ip (3)
119 for more detail.
120 .TP
121 .BI "ra6 " "[ keyword value ] ..."
122 sets IPv6 router advertisement parameter
123 .IR keyword 's
124 .IR value .
125 See
126 .IR ip (3)
127 for more detail.
128 Setting
129 .I recvra
130 non-zero also forks a process to
131 receive and process router advertisements.
132 Setting
133 .I sendra
134 non-zero also
135 enables IP routing on the interface,
136 forks a process to send router advertisements,
137 and if no
138 .I recvra
139 process is running, forks one.
140 .PD
141 .PP
142 The options are:
143 .TF M
144 .PD
145 .TP
146 .B 6
147 if adding an address (the default action),
148 add the IPv6 link-local address.
149 .TP
150 .B b
151 the baud rate to use on a serial line
152 when configuring
153 .BR PPP .
154 .TP
155 .B c
156 write the control string
157 .I ctl
158 to the ethernet device control file before starting to configure it.
159 May be repeated to specify multiple control writes.
160 .TP
161 .B d
162 use DHCP to determine any unspecified configuration parameters.
163 .TP
164 .B D
165 turn on debugging.
166 .TP
167 .B g
168 the default gateway.
169 .TP
170 .B G
171 use only generic DHCP and RA options.  Without this option,
172 .I ipconfig
173 adds to requests a Vendor Class option with value
174 .BI plan9_$ cputype
175 and also requests vendor specific options 128 and 129 which we
176 interpret as the Plan 9 file server and auth server.
177 Replies to these options contain a list of IP addresses for possible
178 file servers and auth servers.
179 .TP
180 .B h
181 the hostname to add to DHCP requests.  Some DHCP
182 servers, such as the one used by Comcast, will not respond
183 unless a correct hostname is in the request.
184 .TP
185 .B m
186 the maximum IP packet size to use on this interface.
187 .TP
188 .B n
189 determine parameters but don't configure the interface.
190 .TP
191 .B N
192 look in
193 .I dbfile
194 (default
195 .BR /lib/ndb/local )
196 for the IP parameters for the specified
197 .I local
198 IP address or if
199 .I local
200 is omited and the device is an ethernet then all IP parameters
201 associated with the MAC address. IPv6 addresses are added only
202 if a IPv6 link-local address exists on the interface or the
203 .B 6
204 flag has been given to automatically configure one.
205 .TP
206 .B O
207 addresses specified on the command line override those obtained via DHCP.
208 A command line address of 0 implies no override.
209 .TP
210 .B p
211 write configuration information to
212 .BR /net/ndb .
213 .TP
214 .B P
215 do not write configuration information to
216 .BR /net/ndb .
217 .TP
218 .B r
219 by default,
220 .I ipconfig
221 exits after trying DHCP for 15 seconds with no answer.
222 This option directs
223 .I ipconfig
224 instead to fork a background process that keeps trying forever.
225 .TP
226 .B u
227 disable IPv6 duplicate discovery detection,
228 which removes any existing ARP table entry for one of our IPv6 addresses
229 before adding new ones.
230 .TP
231 .B f
232 use the ndb database file
233 .IR dbfile .
234 .TP
235 .B x
236 use the IP stack mounted at
237 .I netmtpt
238 instead of at
239 .BR /net .
240 .TP
241 .B X
242 don't fork a process to keep the DHCP lease alive.
243 .TP
244 .B o
245 adds
246 .I dhcpoption
247 to the list of paramters requested of the DHCP server.  The
248 result will appear in
249 .B /net/ndb
250 should this be the first interface.  The known options are:
251 .RS
252 .LP
253 .ft L
254 arptimeout, baddr, bflen, bootfile, clientid, cookie, discovermask,
255 discoverrouter, dns, dom, dumpfile, etherencap, extpath, finger,
256 homeagent, impress, ipaddr, ipforward, ipgw, ipmask, irc, lease, log,
257 lpr, maxdatagram, maxmsg, message, mtu, name, netbiosdds, netbiosns,
258 netbiosscope, netbiostype, ni, nisdomain, nisplus, nisplusdomain,
259 nntp, nonlocal, ntp, overload, params, pathplateau, pathtimeout,
260 policyfilter, pop3, rebindingtime, renewaltime, rl, rootpath, rs,
261 serverid, smtp, st, staticroutes, stdar, subnetslocal, supplymask,
262 swap, sys, tcpka, tcpkag, tcpttl, tftp, time, timeoff, trailerencap,
263 ttl, type, vendorclass, www, xdispmanager, xfont
264 .RE
265 .IP
266 The options
267 .BR ipmask ,
268 .BR ipgw ,
269 .BR dns ,
270 .BR sys ,
271 and
272 .B ntp
273 are always requested.
274 .TF M
275 .PD
276 .PP
277 If DHCP is requested, a process is forked
278 off to renew the lease before it
279 runs out.  If the lease does run out, this
280 process will remove any configured addresses
281 from the interface.
282 .PP
283 .I Rip
284 runs the routing protocol RIP.
285 It listens for RIP packets on connected networks and
286 updates the kernel routing tables.
287 The options are:
288 .TF M
289 .PD
290 .TP
291 .B b
292 broadcasts routing information onto the networks.
293 .TP
294 .B n
295 gathers routing information but doesn't write to the
296 route table.  This is useful with
297 .B \-d
298 to debug a network.
299 .TP
300 .B x
301 use the IP stack mounted at
302 .I netmtpt
303 instead of at
304 .BR /net .
305 .TP
306 .B d
307 turn on (voluminous) debugging.
308 .PP
309 .I Linklocal
310 prints the IPv6 link-local address corresponding to the given
311 .I mac
312 address.
313 Given
314 .BR -t ,
315 .I linklocal
316 instead prints the
317 .I 6to4
318 EUI-64-based IPv6 address corresponding to
319 .I mac
320 and
321 .I 6to4
322 gateway
323 .IR gwipv4 .
324 .SH EXAMPLES
325 Configure Ethernet 0 as the primary IP interface.
326 Get all addresses via DHCP.  Start up a connection server
327 and DNS resolver for this IP stack.
328 .IP
329 .EX
330 % bind -b '#l0' /net
331 % bind -a '#I0' /net
332 % ip/ipconfig
333 % ndb/cs
334 % ndb/dns -r
335 .EE
336 .PP
337 Add a second address to the stack.
338 .IP
339 .EX
340 % ip/ipconfig ether /net/ether0 add 12.1.1.2 255.255.255.0
341 .EE
342 .PP
343 At Bell Labs, our primary IP stack is always to the company's internal
344 firewall-protected network.  The following creates an external
345 IP stack to directly access the outside Internet.  Note that the
346 connection server uses a different set of
347 .I ndb
348 files.  This prevents us from confusing inside and outside name/address
349 bindings.
350 .IP
351 .EX
352 % bind -b '#l1' /net.alt
353 % bind -b '#I1' /net.alt
354 % ip/ipconfig -x /net.alt -g 204.178.31.1 ether /net.alt/ether1\\
355         204.178.31.6 255.255.255.0
356 % ndb/cs -x /net.alt -f /lib/ndb/external
357 % ndb/dns -sx /net.alt -f /lib/ndb/external
358 % aux/listen -d /rc/bin/service.alt /net.alt/tcp
359 .EE
360 .PP
361 Configure the IPv6 link-local address automatically
362 and listen for router announcements.
363 .IP
364 .EX
365 ip/ipconfig -6 
366 ip/ipconfig ra6 recvra 1
367 .EE
368 .SH FILES
369 .B /sys/log/ipconfig
370 .SH SOURCE
371 .B /sys/src/cmd/ip/ipconfig
372 .br
373 .B /sys/src/cmd/ip/rip.c
374 .br
375 .B /sys/src/cmd/ip/linklocal.c
376 .SH "SEE ALSO"
377 .IR ether (3),
378 .IR ip (3),
379 .IR loopback (3),
380 .IR ndb (6),
381 .IR 6in4 (8),
382 .IR dhcpd (8),
383 .IR ppp (8)
384 .br
385 .B /lib/rfc/rfc2373
386 for IPv6's modified EUI-64