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