]> git.saurik.com Git - apple/network_cmds.git/blob - ifconfig.tproj/ifconfig.8
d9a3c35a9b508715e2e18940a598e39085434f50
[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 .Sh DESCRIPTION
74 .Nm Ifconfig
75 is used to assign an address
76 to a network interface and/or configure
77 network interface parameters.
78 .Nm Ifconfig
79 must be used at boot time to define the network address
80 of each interface present on a machine; it may also be used at
81 a later time to redefine an interface's address
82 or other operating parameters.
83 .Pp
84 The following options are available:
85 .Bl -tag -width indent
86 .It Ar address
87 For the
88 .Tn DARPA Ns -Internet
89 family,
90 the address is either a host name present in the host name data
91 base,
92 .Xr hosts 5 ,
93 or a
94 .Tn DARPA
95 Internet address expressed in the Internet standard
96 .Dq dot notation .
97 .Pp
98 It is also possible to use the CIDR notation (also known as the
99 slash notation) to include the netmask.
100 That is, one can specify an address like
101 .Li 192.168.0.1/16 .
102 .\" For the Xerox Network Systems(tm) family,
103 .\" addresses are
104 .\" .Ar net:a.b.c.d.e.f ,
105 .\" where
106 .\" .Ar net
107 .\" is the assigned network number (in decimal),
108 .\" and each of the six bytes of the host number,
109 .\" .Ar a
110 .\" through
111 .\" .Ar f ,
112 .\" are specified in hexadecimal.
113 .\" The host number may be omitted on IEEE 802 protocol
114 .\" (Ethernet, FDDI, and Token Ring) interfaces,
115 .\" which use the hardware physical address,
116 .\" and on interfaces other than the first.
117 .\" For the
118 .\" .Tn ISO
119 .\" family, addresses are specified as a long hexadecimal string,
120 .\" as in the Xerox family.
121 .\" However, two consecutive dots imply a zero
122 .\" byte, and the dots are optional, if the user wishes to (carefully)
123 .\" count out long strings of digits in network byte order.
124 .It Ar address_family
125 Specify the
126 address family
127 which affects interpretation of the remaining parameters.
128 Since an interface can receive transmissions in differing protocols
129 with different naming schemes, specifying the address family is recommended.
130 The address or protocol families currently
131 supported are
132 .Dq inet ,
133 .Dq inet6 ,
134 .\" and
135 .\" .Dq ns .
136 .It Ar dest_address
137 Specify the address of the correspondent on the other end
138 of a point to point link.
139 .It Ar interface
140 This
141 parameter is a string of the form
142 .Dq name unit ,
143 for example,
144 .Dq Li en0 .
145 .El
146 .Pp
147 The following parameters may be set with
148 .Nm :
149 .Bl -tag -width indent
150 .It Cm add
151 Another name for the
152 .Cm alias
153 parameter.
154 Introduced for compatibility
155 with
156 .Bsx .
157 .It Cm alias
158 Establish an additional network address for this interface.
159 This is sometimes useful when changing network numbers, and
160 one wishes to accept packets addressed to the old interface.
161 If the address is on the same subnet as the first network address
162 for this interface, a netmask of
163 .Li 0xffffffff
164 has to be specified.
165 .It Fl alias
166 Remove the network address specified.
167 This would be used if you incorrectly specified an alias, or it
168 was no longer needed.
169 If you have incorrectly set an NS address having the side effect
170 of specifying the host portion, removing all NS addresses will
171 allow you to respecify the host portion.
172 .It Cm anycast
173 (Inet6 only.)
174 Specify that the address configured is an anycast address.
175 Based on the current specification,
176 only routers may configure anycast addresses.
177 Anycast address will not be used as source address of any of outgoing
178 IPv6 packets.
179 .It Cm arp
180 Enable the use of the Address Resolution Protocol
181 .Pq Xr arp 4
182 in mapping
183 between network level addresses and link level addresses (default).
184 This is currently implemented for mapping between
185 .Tn DARPA
186 Internet
187 addresses and
188 .Tn IEEE
189 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
190 .It Fl arp
191 Disable the use of the Address Resolution Protocol
192 .Pq Xr arp 4 .
193 .It Cm broadcast
194 (Inet only.)
195 Specify the address to use to represent broadcasts to the
196 network.
197 The default broadcast address is the address with a host part of all 1's.
198 .It Cm debug
199 Enable driver dependent debugging code; usually, this turns on
200 extra console error logging.
201 .It Fl debug
202 Disable driver dependent debugging code.
203 .It Cm delete
204 Another name for the
205 .Fl alias
206 parameter.
207 .It Cm down
208 Mark an interface
209 .Dq down .
210 When an interface is marked
211 .Dq down ,
212 the system will not attempt to
213 transmit messages through that interface.
214 If possible, the interface will be reset to disable reception as well.
215 This action does not automatically disable routes using the interface.
216 .It Cm ether
217 Another name for the
218 .Cm lladdr
219 parameter.
220 .\" .It Cm ipdst
221 .\" This is used to specify an Internet host who is willing to receive
222 .\" ip packets encapsulating NS packets bound for a remote network.
223 .\" An apparent point to point link is constructed, and
224 .\" the address specified will be taken as the NS address and network
225 .\" of the destination.
226 .\" IP encapsulation of
227 .\" .Tn CLNP
228 .\" packets is done differently.
229 .It Cm lladdr Ar addr
230 Set the link-level address on an interface.
231 This can be used to
232 e.g. set a new MAC address on an ethernet interface, though the
233 mechanism used is not ethernet-specific.
234 The address
235 .Ar addr
236 is specified as a series of colon-separated hex digits.
237 If the interface is already
238 up when this option is used, it will be briefly brought down and
239 then brought back up again in order to ensure that the receive
240 filter in the underlying ethernet hardware is properly reprogrammed.
241 .It Cm media Ar type
242 If the driver supports the media selection system, set the media type
243 of the interface to
244 .Ar type .
245 Some interfaces support the mutually exclusive use of one of several
246 different physical media connectors.
247 For example, a 10Mb/s Ethernet
248 interface might support the use of either
249 .Tn AUI
250 or twisted pair connectors.
251 Setting the media type to
252 .Dq 10base5/AUI
253 would change the currently active connector to the AUI port.
254 Setting it to
255 .Dq 10baseT/UTP
256 would activate twisted pair.
257 Refer to the interfaces' driver
258 specific documentation or man page for a complete list of the
259 available types.
260 .It Cm mediaopt Ar opts
261 If the driver supports the media selection system, set the specified
262 media options on the interface.
263 The
264 .Ar opts
265 argument
266 is a comma delimited list of options to apply to the interface.
267 Refer to the interfaces' driver specific man page for a complete
268 list of available options.
269 .It Fl mediaopt Ar opts
270 If the driver supports the media selection system, disable the
271 specified media options on the interface.
272 .It Cm tunnel Ar src_addr dest_addr
273 (IP tunnel devices only.)
274 Configure the physical source and destination address for IP tunnel
275 interfaces
276 .Pq Xr gif 4 .
277 The arguments
278 .Ar src_addr
279 and
280 .Ar dest_addr
281 are interpreted as the outer source/destination for the encapsulating
282 IPv4/IPv6 header.
283 .It Cm deletetunnel
284 Unconfigure the physical source and destination address for IP tunnel
285 interfaces previously configured with
286 .Cm tunnel .
287 .It Cm create
288 Create the specified network pseudo-device.
289 If the interface is given without a unit number, try to create a new
290 device with an arbitrary unit number.
291 If creation of an arbitrary device is successful, the new device name is
292 printed to standard output.
293 .It Cm destroy
294 Destroy the specified network pseudo-device.
295 .It Cm plumb
296 Another name for the
297 .Cm create
298 parameter.
299 Included for
300 .Tn Solaris
301 compatibility.
302 .It Cm unplumb
303 Another name for the
304 .Cm destroy
305 parameter.
306 Included for
307 .Tn Solaris
308 compatibility.
309 .It Cm vlan Ar vlan_tag
310 If the interface is a vlan pseudo interface, set the vlan tag value
311 to
312 .Ar vlan_tag .
313 This value is a 16-bit number which is used to create an 802.1Q
314 vlan header for packets sent from the vlan interface.
315 Note that
316 .Cm vlan
317 and
318 .Cm vlandev
319 must both be set at the same time.
320 .It Cm vlandev Ar iface
321 If the interface is a vlan pseudo device, associate physical interface
322 .Ar iface
323 with it.
324 Packets transmitted through the vlan interface will be
325 diverted to the specified physical interface
326 .Ar iface
327 with 802.1Q vlan encapsulation.
328 Packets with 802.1Q encapsulation received
329 by the parent interface with the correct vlan tag will be diverted to
330 the associated vlan pseudo-interface.
331 The vlan interface is assigned a
332 copy of the parent interface's flags and the parent's ethernet address.
333 The
334 .Cm vlandev
335 and
336 .Cm vlan
337 must both be set at the same time.
338 If the vlan interface already has
339 a physical interface associated with it, this command will fail.
340 To
341 change the association to another physical interface, the existing
342 association must be cleared first.
343 .Pp
344 Note: if the hardware tagging capability
345 is set on the vlan interface, the vlan pseudo
346 interface's behavior changes:
347 the vlan interface recognizes that the
348 parent interface supports insertion and extraction of vlan tags on its
349 own (usually in firmware) and that it should pass packets to and from
350 the parent unaltered.
351 .It Fl vlandev Ar iface
352 If the driver is a vlan pseudo device, disassociate the physical interface
353 .Ar iface
354 from it.
355 This breaks the link between the vlan interface and its parent,
356 clears its vlan tag, flags and its link address and shuts the interface down.
357 .It Cm metric Ar n
358 Set the routing metric of the interface to
359 .Ar n ,
360 default 0.
361 The routing metric is used by the routing protocol
362 .Pq Xr routed 8 .
363 Higher metrics have the effect of making a route
364 less favorable; metrics are counted as addition hops
365 to the destination network or host.
366 .It Cm mtu Ar n
367 Set the maximum transmission unit of the interface to
368 .Ar n ,
369 default is interface specific.
370 The MTU is used to limit the size of packets that are transmitted on an
371 interface.
372 Not all interfaces support setting the MTU, and some interfaces have
373 range restrictions.
374 .It Cm netmask Ar mask
375 .\" (Inet and ISO.)
376 (Inet only.)
377 Specify how much of the address to reserve for subdividing
378 networks into sub-networks.
379 The mask includes the network part of the local address
380 and the subnet part, which is taken from the host field of the address.
381 The mask can be specified as a single hexadecimal number
382 with a leading
383 .Ql 0x ,
384 with a dot-notation Internet address,
385 or with a pseudo-network name listed in the network table
386 .Xr networks 5 .
387 The mask contains 1's for the bit positions in the 32-bit address
388 which are to be used for the network and subnet parts,
389 and 0's for the host part.
390 The mask should contain at least the standard network portion,
391 and the subnet field should be contiguous with the network
392 portion.
393 .Pp
394 The netmask can also be specified in CIDR notation after the address.
395 See the
396 .Ar address
397 option above for more information.
398 .It Cm prefixlen Ar len
399 (Inet6 only.)
400 Specify that
401 .Ar len
402 bits are reserved for subdividing networks into sub-networks.
403 The
404 .Ar len
405 must be integer, and for syntactical reason it must be between 0 to 128.
406 It is almost always 64 under the current IPv6 assignment rule.
407 If the parameter is omitted, 64 is used.
408 .\" see
409 .\" Xr eon 5 .
410 .\" .It Cm nsellength Ar n
411 .\" .Pf ( Tn ISO
412 .\" only)
413 .\" This specifies a trailing number of bytes for a received
414 .\" .Tn NSAP
415 .\" used for local identification, the remaining leading part of which is
416 .\" taken to be the
417 .\" .Tn NET
418 .\" (Network Entity Title).
419 .\" The default value is 1, which is conformant to US
420 .\" .Tn GOSIP .
421 .\" When an ISO address is set in an ifconfig command,
422 .\" it is really the
423 .\" .Tn NSAP
424 .\" which is being specified.
425 .\" For example, in
426 .\" .Tn US GOSIP ,
427 .\" 20 hex digits should be
428 .\" specified in the
429 .\" .Tn ISO NSAP
430 .\" to be assigned to the interface.
431 .\" There is some evidence that a number different from 1 may be useful
432 .\" for
433 .\" .Tn AFI
434 .\" 37 type addresses.
435 .It Cm remove
436 Another name for the
437 .Fl alias
438 parameter.
439 Introduced for compatibility
440 with
441 .Bsx .
442 .Sm off
443 .It Cm link Op Cm 0 No - Cm 2
444 .Sm on
445 Enable special processing of the link level of the interface.
446 These three options are interface specific in actual effect, however,
447 they are in general used to select special modes of operation.
448 An example
449 of this is to enable SLIP compression, or to select the connector type
450 for some Ethernet cards.
451 Refer to the man page for the specific driver
452 for more information.
453 .Sm off
454 .It Fl link Op Cm 0 No - Cm 2
455 .Sm on
456 Disable special processing at the link level with the specified interface.
457 .It Cm up
458 Mark an interface
459 .Dq up .
460 This may be used to enable an interface after an
461 .Dq Nm Cm down .
462 It happens automatically when setting the first address on an interface.
463 If the interface was reset when previously marked down,
464 the hardware will be re-initialized.
465 .El
466 .Pp
467 .Nm Ifconfig
468 displays the current configuration for a network interface
469 when no optional parameters are supplied.
470 If a protocol family is specified,
471 .Nm
472 will report only the details specific to that protocol family.
473 .Pp
474 If the driver does supports the media selection system, the supported
475 media list will be included in the output.
476 .Pp
477 If the
478 .Fl m
479 flag is passed before an interface name,
480 .Nm
481 will display all
482 of the supported media for the specified interface.
483 If
484 .Fl L
485 flag is supplied, address lifetime is displayed for IPv6 addresses,
486 as time offset string.
487 .Pp
488 Optionally, the
489 .Fl a
490 flag may be used instead of an interface name.
491 This flag instructs
492 .Nm
493 to display information about all interfaces in the system.
494 The
495 .Fl d
496 flag limits this to interfaces that are down, and
497 .Fl u
498 limits this to interfaces that are up.
499 When no arguments are given,
500 .Fl a
501 is implied.
502 .Pp
503 The
504 .Fl l
505 flag may be used to list all available interfaces on the system, with
506 no other additional information.
507 Use of this flag is mutually exclusive
508 with all other flags and commands, except for
509 .Fl d
510 (only list interfaces that are down)
511 and
512 .Fl u
513 (only list interfaces that are up).
514 .Pp
515 Only the super-user may modify the configuration of a network interface.
516 .Sh NOTES
517 The media selection system is relatively new and only some drivers support
518 it (or have need for it).
519 .Sh DIAGNOSTICS
520 Messages indicating the specified interface does not exist, the
521 requested address is unknown, or the user is not privileged and
522 tried to alter an interface's configuration.
523 .Sh BUGS
524 IPv6 link-local addresses are required for several basic communication
525 between IPv6 node.
526 If they are deleted by
527 .Nm
528 manually, the kernel might show very strange behavior.
529 So, such manual deletions are strongly discouraged.
530 .Sh SEE ALSO
531 .Xr netstat 1 ,
532 .Xr netintro 4 ,
533 .\" .Xr eon 5 ,
534 .Xr rc 8 ,
535 .Xr routed 8
536 .Sh HISTORY
537 The
538 .Nm
539 command appeared in
540 .Bx 4.2 .