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