]> git.saurik.com Git - apple/network_cmds.git/blob - ifconfig.tproj/ifconfig.8
network_cmds-115.tar.gz
[apple/network_cmds.git] / ifconfig.tproj / ifconfig.8
1 .\" Copyright (c) 1983, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgment:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
33 .\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.27.2.14 2001/08/23 06:35:38 yar Exp $
34 .\"
35 .Dd July 2, 2001
36 .Dt IFCONFIG 8
37 .Os
38 .Sh NAME
39 .Nm ifconfig
40 .Nd configure network interface parameters
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl L
44 .Op Fl m
45 .Ar interface
46 .Op Cm create
47 .Op Ar address_family
48 .Oo
49 .Ar address Ns Op Cm / Ns Ar prefixlength
50 .Op Ar dest_address
51 .Oc
52 .Op Ar parameters
53 .Nm
54 .Ar interface
55 .Cm destroy
56 .Nm
57 .Fl a
58 .Op Fl L
59 .Op Fl d
60 .Op Fl m
61 .Op Fl u
62 .Op Ar address_family
63 .Nm
64 .Fl l
65 .Op Fl d
66 .Op Fl u
67 .Op Ar address_family
68 .Nm
69 .Op Fl L
70 .Op Fl d
71 .Op Fl m
72 .Op Fl u
73 .Op Fl C
74 .Sh DESCRIPTION
75 .Nm Ifconfig
76 is used to assign an address
77 to a network interface and/or configure
78 network interface parameters.
79 .Nm Ifconfig
80 must be used at boot time to define the network address
81 of each interface present on a machine; it may also be used at
82 a later time to redefine an interface's address
83 or other operating parameters.
84 .Pp
85 The following options are available:
86 .Bl -tag -width indent
87 .It Ar address
88 For the
89 .Tn DARPA Ns -Internet
90 family,
91 the address is either a host name present in the host name data
92 base,
93 .Xr hosts 5 ,
94 or a
95 .Tn DARPA
96 Internet address expressed in the Internet standard
97 .Dq dot notation .
98 .Pp
99 It is also possible to use the CIDR notation (also known as the
100 slash notation) to include the netmask.
101 That is, one can specify an address like
102 .Li 192.168.0.1/16 .
103 .\" For the Xerox Network Systems(tm) family,
104 .\" addresses are
105 .\" .Ar net:a.b.c.d.e.f ,
106 .\" where
107 .\" .Ar net
108 .\" is the assigned network number (in decimal),
109 .\" and each of the six bytes of the host number,
110 .\" .Ar a
111 .\" through
112 .\" .Ar f ,
113 .\" are specified in hexadecimal.
114 .\" The host number may be omitted on IEEE 802 protocol
115 .\" (Ethernet, FDDI, and Token Ring) interfaces,
116 .\" which use the hardware physical address,
117 .\" and on interfaces other than the first.
118 .\" For the
119 .\" .Tn ISO
120 .\" family, addresses are specified as a long hexadecimal string,
121 .\" as in the Xerox family.
122 .\" However, two consecutive dots imply a zero
123 .\" byte, and the dots are optional, if the user wishes to (carefully)
124 .\" count out long strings of digits in network byte order.
125 .It Ar address_family
126 Specify the
127 address family
128 which affects interpretation of the remaining parameters.
129 Since an interface can receive transmissions in differing protocols
130 with different naming schemes, specifying the address family is recommended.
131 The address or protocol families currently
132 supported are
133 .Dq inet ,
134 .Dq inet6 ,
135 .\" and
136 .\" .Dq ns .
137 .It Ar dest_address
138 Specify the address of the correspondent on the other end
139 of a point to point link.
140 .It Ar interface
141 This
142 parameter is a string of the form
143 .Dq name unit ,
144 for example,
145 .Dq Li en0 .
146 .El
147 .Pp
148 The following parameters may be set with
149 .Nm :
150 .Bl -tag -width indent
151 .It Cm add
152 Another name for the
153 .Cm alias
154 parameter.
155 Introduced for compatibility
156 with
157 .Bsx .
158 .It Cm alias
159 Establish an additional network address for this interface.
160 This is sometimes useful when changing network numbers, and
161 one wishes to accept packets addressed to the old interface.
162 If the address is on the same subnet as the first network address
163 for this interface, a netmask of
164 .Li 0xffffffff
165 has to be specified.
166 .It Fl alias
167 Remove the network address specified.
168 This would be used if you incorrectly specified an alias, or it
169 was no longer needed.
170 If you have incorrectly set an NS address having the side effect
171 of specifying the host portion, removing all NS addresses will
172 allow you to respecify the host portion.
173 .It Cm anycast
174 (Inet6 only.)
175 Specify that the address configured is an anycast address.
176 Based on the current specification,
177 only routers may configure anycast addresses.
178 Anycast address will not be used as source address of any of outgoing
179 IPv6 packets.
180 .It Cm arp
181 Enable the use of the Address Resolution Protocol
182 .Pq Xr arp 4
183 in mapping
184 between network level addresses and link level addresses (default).
185 This is currently implemented for mapping between
186 .Tn DARPA
187 Internet
188 addresses and
189 .Tn IEEE
190 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
191 .It Fl arp
192 Disable the use of the Address Resolution Protocol
193 .Pq Xr arp 4 .
194 .It Cm broadcast
195 (Inet only.)
196 Specify the address to use to represent broadcasts to the
197 network.
198 The default broadcast address is the address with a host part of all 1's.
199 .It Cm debug
200 Enable driver dependent debugging code; usually, this turns on
201 extra console error logging.
202 .It Fl debug
203 Disable driver dependent debugging code.
204 .It Cm delete
205 Another name for the
206 .Fl alias
207 parameter.
208 .It Cm down
209 Mark an interface
210 .Dq down .
211 When an interface is marked
212 .Dq down ,
213 the system will not attempt to
214 transmit messages through that interface.
215 If possible, the interface will be reset to disable reception as well.
216 This action does not automatically disable routes using the interface.
217 .It Cm ether
218 Another name for the
219 .Cm lladdr
220 parameter.
221 .\" .It Cm ipdst
222 .\" This is used to specify an Internet host who is willing to receive
223 .\" ip packets encapsulating NS packets bound for a remote network.
224 .\" An apparent point to point link is constructed, and
225 .\" the address specified will be taken as the NS address and network
226 .\" of the destination.
227 .\" IP encapsulation of
228 .\" .Tn CLNP
229 .\" packets is done differently.
230 .It Cm lladdr Ar addr
231 Set the link-level address on an interface.
232 This can be used to
233 e.g. set a new MAC address on an ethernet interface, though the
234 mechanism used is not ethernet-specific.
235 The address
236 .Ar addr
237 is specified as a series of colon-separated hex digits.
238 If the interface is already
239 up when this option is used, it will be briefly brought down and
240 then brought back up again in order to ensure that the receive
241 filter in the underlying ethernet hardware is properly reprogrammed.
242 .It Cm media Ar type
243 If the driver supports the media selection system, set the media type
244 of the interface to
245 .Ar type .
246 Some interfaces support the mutually exclusive use of one of several
247 different physical media connectors.
248 For example, a 10Mb/s Ethernet
249 interface might support the use of either
250 .Tn AUI
251 or twisted pair connectors.
252 Setting the media type to
253 .Dq 10base5/AUI
254 would change the currently active connector to the AUI port.
255 Setting it to
256 .Dq 10baseT/UTP
257 would activate twisted pair.
258 Refer to the interfaces' driver
259 specific documentation or man page for a complete list of the
260 available types.
261 .It Cm mediaopt Ar opts
262 If the driver supports the media selection system, set the specified
263 media options on the interface.
264 The
265 .Ar opts
266 argument
267 is a comma delimited list of options to apply to the interface.
268 Refer to the interfaces' driver specific man page for a complete
269 list of available options.
270 .It Fl mediaopt Ar opts
271 If the driver supports the media selection system, disable the
272 specified media options on the interface.
273 .It Cm tunnel Ar src_addr dest_addr
274 (IP tunnel devices only.)
275 Configure the physical source and destination address for IP tunnel
276 interfaces
277 .Pq Xr gif 4 .
278 The arguments
279 .Ar src_addr
280 and
281 .Ar dest_addr
282 are interpreted as the outer source/destination for the encapsulating
283 IPv4/IPv6 header.
284 .It Cm deletetunnel
285 Unconfigure the physical source and destination address for IP tunnel
286 interfaces previously configured with
287 .Cm tunnel .
288 .It Cm create
289 Create the specified network pseudo-device.
290 If the interface is given without a unit number, try to create a new
291 device with an arbitrary unit number.
292 If creation of an arbitrary device is sucessful, the new device name is
293 printed to standard output.
294 .It Cm destroy
295 Destroy the specified network pseudo-device.
296 .It Cm plumb
297 Another name for the
298 .Cm create
299 parameter.
300 Included for
301 .Tn Solaris
302 compatibility.
303 .It Cm unplumb
304 Another name for the
305 .Cm destroy
306 parameter.
307 Included for
308 .Tn Solaris
309 compatibility.
310 .It Cm metric Ar n
311 Set the routing metric of the interface to
312 .Ar n ,
313 default 0.
314 The routing metric is used by the routing protocol
315 .Pq Xr routed 8 .
316 Higher metrics have the effect of making a route
317 less favorable; metrics are counted as addition hops
318 to the destination network or host.
319 .It Cm mtu Ar n
320 Set the maximum transmission unit of the interface to
321 .Ar n ,
322 default is interface specific.
323 The MTU is used to limit the size of packets that are transmitted on an
324 interface.
325 Not all interfaces support setting the MTU, and some interfaces have
326 range restrictions.
327 .It Cm netmask Ar mask
328 .\" (Inet and ISO.)
329 (Inet only.)
330 Specify how much of the address to reserve for subdividing
331 networks into sub-networks.
332 The mask includes the network part of the local address
333 and the subnet part, which is taken from the host field of the address.
334 The mask can be specified as a single hexadecimal number
335 with a leading
336 .Ql 0x ,
337 with a dot-notation Internet address,
338 or with a pseudo-network name listed in the network table
339 .Xr networks 5 .
340 The mask contains 1's for the bit positions in the 32-bit address
341 which are to be used for the network and subnet parts,
342 and 0's for the host part.
343 The mask should contain at least the standard network portion,
344 and the subnet field should be contiguous with the network
345 portion.
346 .Pp
347 The netmask can also be specified in CIDR notation after the address.
348 See the
349 .Ar address
350 option above for more information.
351 .It Cm prefixlen Ar len
352 (Inet6 only.)
353 Specify that
354 .Ar len
355 bits are reserved for subdividing networks into sub-networks.
356 The
357 .Ar len
358 must be integer, and for syntactical reason it must be between 0 to 128.
359 It is almost always 64 under the current IPv6 assignment rule.
360 If the parameter is omitted, 64 is used.
361 .\" see
362 .\" Xr eon 5 .
363 .\" .It Cm nsellength Ar n
364 .\" .Pf ( Tn ISO
365 .\" only)
366 .\" This specifies a trailing number of bytes for a received
367 .\" .Tn NSAP
368 .\" used for local identification, the remaining leading part of which is
369 .\" taken to be the
370 .\" .Tn NET
371 .\" (Network Entity Title).
372 .\" The default value is 1, which is conformant to US
373 .\" .Tn GOSIP .
374 .\" When an ISO address is set in an ifconfig command,
375 .\" it is really the
376 .\" .Tn NSAP
377 .\" which is being specified.
378 .\" For example, in
379 .\" .Tn US GOSIP ,
380 .\" 20 hex digits should be
381 .\" specified in the
382 .\" .Tn ISO NSAP
383 .\" to be assigned to the interface.
384 .\" There is some evidence that a number different from 1 may be useful
385 .\" for
386 .\" .Tn AFI
387 .\" 37 type addresses.
388 .It Cm remove
389 Another name for the
390 .Fl alias
391 parameter.
392 Introduced for compatibility
393 with
394 .Bsx .
395 .Sm off
396 .It Cm link Op Cm 0 No - Cm 2
397 .Sm on
398 Enable special processing of the link level of the interface.
399 These three options are interface specific in actual effect, however,
400 they are in general used to select special modes of operation.
401 An example
402 of this is to enable SLIP compression, or to select the connector type
403 for some Ethernet cards.
404 Refer to the man page for the specific driver
405 for more information.
406 .Sm off
407 .It Fl link Op Cm 0 No - Cm 2
408 .Sm on
409 Disable special processing at the link level with the specified interface.
410 .It Cm up
411 Mark an interface
412 .Dq up .
413 This may be used to enable an interface after an
414 .Dq Nm Cm down .
415 It happens automatically when setting the first address on an interface.
416 If the interface was reset when previously marked down,
417 the hardware will be re-initialized.
418 .El
419 .Pp
420 .Nm Ifconfig
421 displays the current configuration for a network interface
422 when no optional parameters are supplied.
423 If a protocol family is specified,
424 .Nm
425 will report only the details specific to that protocol family.
426 .Pp
427 If the driver does supports the media selection system, the supported
428 media list will be included in the output.
429 .Pp
430 If the
431 .Fl m
432 flag is passed before an interface name,
433 .Nm
434 will display all
435 of the supported media for the specified interface.
436 If
437 .Fl L
438 flag is supplied, address lifetime is displayed for IPv6 addresses,
439 as time offset string.
440 .Pp
441 Optionally, the
442 .Fl a
443 flag may be used instead of an interface name.
444 This flag instructs
445 .Nm
446 to display information about all interfaces in the system.
447 The
448 .Fl d
449 flag limits this to interfaces that are down, and
450 .Fl u
451 limits this to interfaces that are up.
452 When no arguments are given,
453 .Fl a
454 is implied.
455 .Pp
456 The
457 .Fl l
458 flag may be used to list all available interfaces on the system, with
459 no other additional information.
460 Use of this flag is mutually exclusive
461 with all other flags and commands, except for
462 .Fl d
463 (only list interfaces that are down)
464 and
465 .Fl u
466 (only list interfaces that are up).
467 .Pp
468 The
469 .Fl C
470 flag may be used to list all of the interface cloners available on
471 the system, with no additional information.
472 Use of this flag is mutually exclusive with all other flags and commands.
473 .Pp
474 Only the super-user may modify the configuration of a network interface.
475 .Sh NOTES
476 The media selection system is relatively new and only some drivers support
477 it (or have need for it).
478 .Sh DIAGNOSTICS
479 Messages indicating the specified interface does not exist, the
480 requested address is unknown, or the user is not privileged and
481 tried to alter an interface's configuration.
482 .Sh BUGS
483 IPv6 link-local addresses are required for several basic communication
484 between IPv6 node.
485 If they are deleted by
486 .Nm
487 manually, the kernel might show very strange behavior.
488 So, such manual deletions are strongly discouraged.
489 .Sh SEE ALSO
490 .Xr netstat 1 ,
491 .Xr netintro 4 ,
492 .\" .Xr eon 5 ,
493 .Xr rc 8 ,
494 .Xr routed 8
495 .Sh HISTORY
496 The
497 .Nm
498 command appeared in
499 .Bx 4.2 .