]> git.saurik.com Git - apple/network_cmds.git/blame - ifconfig.tproj/ifconfig.8
network_cmds-329.2.2.tar.gz
[apple/network_cmds.git] / ifconfig.tproj / ifconfig.8
CommitLineData
b7080c8e
A
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.
b7080c8e
A
12.\" 4. Neither the name of the University nor the names of its contributors
13.\" may be used to endorse or promote products derived from this software
14.\" without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
7ba0088d 28.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
8d01c344 29.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.142.2.6.2.1 2008/11/25 02:59:29 kensmith Exp $
b7080c8e 30.\"
8d01c344 31.Dd June 20, 2008
b7080c8e 32.Dt IFCONFIG 8
7ba0088d 33.Os
b7080c8e
A
34.Sh NAME
35.Nm ifconfig
36.Nd configure network interface parameters
37.Sh SYNOPSIS
7ba0088d
A
38.Nm
39.Op Fl L
40.Op Fl m
7f5b2e89 41.Op Fl r
7ba0088d
A
42.Ar interface
43.Op Cm create
44.Op Ar address_family
b7080c8e 45.Oo
8d01c344 46.Ar address
b7080c8e
A
47.Op Ar dest_address
48.Oc
49.Op Ar parameters
7ba0088d 50.Nm
b7080c8e 51.Ar interface
7ba0088d
A
52.Cm destroy
53.Nm
b7080c8e 54.Fl a
7ba0088d 55.Op Fl L
b7080c8e 56.Op Fl d
7ba0088d 57.Op Fl m
7f5b2e89 58.Op Fl r
b7080c8e 59.Op Fl u
8d01c344 60.Op Fl v
b7080c8e 61.Op Ar address_family
7ba0088d 62.Nm
b7080c8e
A
63.Fl l
64.Op Fl d
65.Op Fl u
66.Op Ar address_family
7ba0088d
A
67.Nm
68.Op Fl L
69.Op Fl d
70.Op Fl m
7f5b2e89 71.Op Fl r
7ba0088d 72.Op Fl u
8d01c344
A
73.Op Fl v
74.Op Fl C
2b484d24
A
75.Nm
76.Ar interface
77.Cm vlan
78.Ar vlan-tag
79.Cm vlandev
80.Ar iface
81.Nm
82.Ar interface
83.Cm -vlandev
84.Ar iface
85.Nm
86.Ar interface
87.Cm bonddev
88.Ar iface
89.Nm
90.Ar interface
91.Cm -bonddev
92.Ar iface
b8dff150
A
93.Nm
94.Ar interface
95.Cm bondmode
96.Ar lacp | static
b7080c8e 97.Sh DESCRIPTION
8d01c344
A
98The
99.Nm
100utility is used to assign an address
b7080c8e
A
101to a network interface and/or configure
102network interface parameters.
b7080c8e 103.Pp
7ba0088d
A
104The following options are available:
105.Bl -tag -width indent
106.It Ar address
b7080c8e 107For the
7ba0088d 108.Tn DARPA Ns -Internet
b7080c8e
A
109family,
110the address is either a host name present in the host name data
7ba0088d 111base,
b7080c8e
A
112.Xr hosts 5 ,
113or a
114.Tn DARPA
115Internet address expressed in the Internet standard
116.Dq dot notation .
7ba0088d
A
117.Pp
118It is also possible to use the CIDR notation (also known as the
119slash notation) to include the netmask.
120That is, one can specify an address like
121.Li 192.168.0.1/16 .
8d01c344
A
122.Pp
123For
124.Dq inet6
125family, it is also possible to specify the prefix length using the slash
126notation, like
127.Li ::1/128 .
128See the
129.Cm prefixlen
130parameter below for more information.
7ba0088d
A
131.\" For the Xerox Network Systems(tm) family,
132.\" addresses are
133.\" .Ar net:a.b.c.d.e.f ,
134.\" where
135.\" .Ar net
136.\" is the assigned network number (in decimal),
137.\" and each of the six bytes of the host number,
138.\" .Ar a
139.\" through
140.\" .Ar f ,
141.\" are specified in hexadecimal.
142.\" The host number may be omitted on IEEE 802 protocol
143.\" (Ethernet, FDDI, and Token Ring) interfaces,
144.\" which use the hardware physical address,
145.\" and on interfaces other than the first.
146.\" For the
147.\" .Tn ISO
148.\" family, addresses are specified as a long hexadecimal string,
149.\" as in the Xerox family.
150.\" However, two consecutive dots imply a zero
151.\" byte, and the dots are optional, if the user wishes to (carefully)
152.\" count out long strings of digits in network byte order.
8d01c344
A
153.Pp
154The link-level
155.Pq Dq link
156address
157is specified as a series of colon-separated hex digits.
158This can be used to
159e.g.\& set a new MAC address on an ethernet interface, though the
160mechanism used is not ethernet-specific.
161If the interface is already
162up when this option is used, it will be briefly brought down and
163then brought back up again in order to ensure that the receive
164filter in the underlying ethernet hardware is properly reprogrammed.
b7080c8e 165.It Ar address_family
7ba0088d
A
166Specify the
167address family
b7080c8e
A
168which affects interpretation of the remaining parameters.
169Since an interface can receive transmissions in differing protocols
7ba0088d 170with different naming schemes, specifying the address family is recommended.
b7080c8e
A
171The address or protocol families currently
172supported are
173.Dq inet ,
7ba0088d 174.Dq inet6 ,
8d01c344
A
175.\".Dq atalk ,
176.\".Dq ipx ,
177.\" .Dq iso ,
178and
179.Dq link .
7ba0088d
A
180.\" and
181.\" .Dq ns .
8d01c344
A
182The default is
183.Dq inet .
184.Dq ether
185and
186.Dq lladdr
187are synonyms for
188.Dq link .
7ba0088d
A
189.It Ar dest_address
190Specify the address of the correspondent on the other end
191of a point to point link.
192.It Ar interface
193This
b7080c8e
A
194parameter is a string of the form
195.Dq name unit ,
196for example,
7ba0088d 197.Dq Li en0 .
8d01c344 198\.El
b7080c8e 199.Pp
7ba0088d
A
200The following parameters may be set with
201.Nm :
202.Bl -tag -width indent
203.It Cm add
204Another name for the
205.Cm alias
206parameter.
207Introduced for compatibility
208with
209.Bsx .
b7080c8e 210.It Cm alias
7ba0088d
A
211Establish an additional network address for this interface.
212This is sometimes useful when changing network numbers, and
213one wishes to accept packets addressed to the old interface.
214If the address is on the same subnet as the first network address
8d01c344
A
215for this interface, a non-conflicting netmask must be given.
216Usually
7ba0088d 217.Li 0xffffffff
8d01c344 218is most appropriate.
7ba0088d
A
219.It Fl alias
220Remove the network address specified.
221This would be used if you incorrectly specified an alias, or it
222was no longer needed.
223If you have incorrectly set an NS address having the side effect
224of specifying the host portion, removing all NS addresses will
225allow you to respecify the host portion.
226.It Cm anycast
227(Inet6 only.)
228Specify that the address configured is an anycast address.
229Based on the current specification,
230only routers may configure anycast addresses.
231Anycast address will not be used as source address of any of outgoing
232IPv6 packets.
b7080c8e 233.It Cm arp
7ba0088d
A
234Enable the use of the Address Resolution Protocol
235.Pq Xr arp 4
236in mapping
b7080c8e
A
237between network level addresses and link level addresses (default).
238This is currently implemented for mapping between
239.Tn DARPA
240Internet
7ba0088d
A
241addresses and
242.Tn IEEE
243802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
b7080c8e 244.It Fl arp
7ba0088d
A
245Disable the use of the Address Resolution Protocol
246.Pq Xr arp 4 .
b7080c8e 247.It Cm broadcast
7ba0088d 248(Inet only.)
b7080c8e
A
249Specify the address to use to represent broadcasts to the
250network.
251The default broadcast address is the address with a host part of all 1's.
252.It Cm debug
253Enable driver dependent debugging code; usually, this turns on
254extra console error logging.
255.It Fl debug
256Disable driver dependent debugging code.
b7080c8e 257.It Cm delete
7ba0088d
A
258Another name for the
259.Fl alias
260parameter.
b7080c8e 261.It Cm down
7ba0088d
A
262Mark an interface
263.Dq down .
264When an interface is marked
265.Dq down ,
266the system will not attempt to
267transmit messages through that interface.
b7080c8e
A
268If possible, the interface will be reset to disable reception as well.
269This action does not automatically disable routes using the interface.
7ba0088d
A
270.It Cm ether
271Another name for the
272.Cm lladdr
273parameter.
274.\" .It Cm ipdst
275.\" This is used to specify an Internet host who is willing to receive
276.\" ip packets encapsulating NS packets bound for a remote network.
277.\" An apparent point to point link is constructed, and
278.\" the address specified will be taken as the NS address and network
279.\" of the destination.
280.\" IP encapsulation of
281.\" .Tn CLNP
282.\" packets is done differently.
283.It Cm lladdr Ar addr
284Set the link-level address on an interface.
285This can be used to
286e.g. set a new MAC address on an ethernet interface, though the
287mechanism used is not ethernet-specific.
288The address
289.Ar addr
290is specified as a series of colon-separated hex digits.
291If the interface is already
292up when this option is used, it will be briefly brought down and
293then brought back up again in order to ensure that the receive
294filter in the underlying ethernet hardware is properly reprogrammed.
295.It Cm media Ar type
296If the driver supports the media selection system, set the media type
297of the interface to
298.Ar type .
299Some interfaces support the mutually exclusive use of one of several
300different physical media connectors.
301For example, a 10Mb/s Ethernet
302interface might support the use of either
303.Tn AUI
304or twisted pair connectors.
305Setting the media type to
306.Dq 10base5/AUI
307would change the currently active connector to the AUI port.
308Setting it to
309.Dq 10baseT/UTP
310would activate twisted pair.
311Refer to the interfaces' driver
312specific documentation or man page for a complete list of the
313available types.
314.It Cm mediaopt Ar opts
315If the driver supports the media selection system, set the specified
316media options on the interface.
317The
318.Ar opts
319argument
320is a comma delimited list of options to apply to the interface.
321Refer to the interfaces' driver specific man page for a complete
322list of available options.
323.It Fl mediaopt Ar opts
324If the driver supports the media selection system, disable the
325specified media options on the interface.
7ba0088d
A
326.It Cm create
327Create the specified network pseudo-device.
328If the interface is given without a unit number, try to create a new
329device with an arbitrary unit number.
7902cf7e 330If creation of an arbitrary device is successful, the new device name is
8d01c344
A
331printed to standard output unless the interface is renamed or destroyed
332in the same
333.Nm
334invocation.
7ba0088d
A
335.It Cm destroy
336Destroy the specified network pseudo-device.
337.It Cm plumb
338Another name for the
339.Cm create
340parameter.
341Included for
342.Tn Solaris
343compatibility.
344.It Cm unplumb
345Another name for the
346.Cm destroy
347parameter.
348Included for
349.Tn Solaris
350compatibility.
b7080c8e
A
351.It Cm metric Ar n
352Set the routing metric of the interface to
353.Ar n ,
354default 0.
355The routing metric is used by the routing protocol
356.Pq Xr routed 8 .
357Higher metrics have the effect of making a route
8d01c344 358less favorable; metrics are counted as additional hops
b7080c8e 359to the destination network or host.
7ba0088d
A
360.It Cm mtu Ar n
361Set the maximum transmission unit of the interface to
362.Ar n ,
363default is interface specific.
364The MTU is used to limit the size of packets that are transmitted on an
365interface.
366Not all interfaces support setting the MTU, and some interfaces have
367range restrictions.
b7080c8e 368.It Cm netmask Ar mask
7ba0088d
A
369.\" (Inet and ISO.)
370(Inet only.)
b7080c8e
A
371Specify how much of the address to reserve for subdividing
372networks into sub-networks.
373The mask includes the network part of the local address
374and the subnet part, which is taken from the host field of the address.
375The mask can be specified as a single hexadecimal number
7ba0088d
A
376with a leading
377.Ql 0x ,
378with a dot-notation Internet address,
b7080c8e
A
379or with a pseudo-network name listed in the network table
380.Xr networks 5 .
381The mask contains 1's for the bit positions in the 32-bit address
382which are to be used for the network and subnet parts,
383and 0's for the host part.
384The mask should contain at least the standard network portion,
385and the subnet field should be contiguous with the network
386portion.
7ba0088d
A
387.Pp
388The netmask can also be specified in CIDR notation after the address.
389See the
390.Ar address
391option above for more information.
392.It Cm prefixlen Ar len
393(Inet6 only.)
394Specify that
395.Ar len
396bits are reserved for subdividing networks into sub-networks.
397The
398.Ar len
399must be integer, and for syntactical reason it must be between 0 to 128.
400It is almost always 64 under the current IPv6 assignment rule.
401If the parameter is omitted, 64 is used.
8d01c344
A
402.Pp
403The prefix can also be specified using the slash notation after the address.
404See the
405.Ar address
406option above for more information.
7ba0088d 407.\" see
b7080c8e 408.\" Xr eon 5 .
7ba0088d
A
409.\" .It Cm nsellength Ar n
410.\" .Pf ( Tn ISO
411.\" only)
412.\" This specifies a trailing number of bytes for a received
413.\" .Tn NSAP
414.\" used for local identification, the remaining leading part of which is
415.\" taken to be the
416.\" .Tn NET
417.\" (Network Entity Title).
418.\" The default value is 1, which is conformant to US
419.\" .Tn GOSIP .
420.\" When an ISO address is set in an ifconfig command,
421.\" it is really the
422.\" .Tn NSAP
423.\" which is being specified.
424.\" For example, in
425.\" .Tn US GOSIP ,
426.\" 20 hex digits should be
427.\" specified in the
428.\" .Tn ISO NSAP
429.\" to be assigned to the interface.
430.\" There is some evidence that a number different from 1 may be useful
431.\" for
432.\" .Tn AFI
433.\" 37 type addresses.
434.It Cm remove
435Another name for the
436.Fl alias
437parameter.
438Introduced for compatibility
439with
440.Bsx .
441.Sm off
442.It Cm link Op Cm 0 No - Cm 2
443.Sm on
b7080c8e
A
444Enable special processing of the link level of the interface.
445These three options are interface specific in actual effect, however,
7ba0088d
A
446they are in general used to select special modes of operation.
447An example
448of this is to enable SLIP compression, or to select the connector type
449for some Ethernet cards.
450Refer to the man page for the specific driver
451for more information.
452.Sm off
453.It Fl link Op Cm 0 No - Cm 2
454.Sm on
b7080c8e
A
455Disable special processing at the link level with the specified interface.
456.It Cm up
7ba0088d
A
457Mark an interface
458.Dq up .
459This may be used to enable an interface after an
460.Dq Nm Cm down .
b7080c8e
A
461It happens automatically when setting the first address on an interface.
462If the interface was reset when previously marked down,
463the hardware will be re-initialized.
8d01c344 464.El
2b484d24 465.Pp
8d01c344
A
466The following parameters are specific to link aggregate interfaces:
467.Bl -tag -width indent
468.It Cm bonddev Ar iface
469If the interface is a bond pseudo device, associate physical interface
470.Ar iface
471with it. By default, the bond pseudo device is in LACP
472(Link Aggregation Control Protocol) mode (see \fBbondmode\fR below). In
473this mode, the device conforms to the IEEE 802.3ad Link Aggregation
474specification.
475.Pp
476If this is the first physical interface to be associated with the bond
477interface, the bond interface inherits the ethernet address from the
478physical interface. Physical interfaces that are added to the bond have
479their ethernet address re-programmed so that all members of the bond have
480the same ethernet address. If the physical interface is subsequently
481removed from the bond using
482.Fl bonddev ,
483a new ethernet address is chosen from the remaining interfaces, and all
484interfaces are re-programmed again with the new ethernet address. If no
485remaining interfaces exist, the bond interface's ethernet address is cleared.
2b484d24 486.Pp
8d01c344 487If the specified physical interface
2b484d24 488.Ar iface
8d01c344
A
489is not capable of having its ethernet address re-programmed, the
490.Cm bonddev
491command will fail.
492.Pp
493Once the physical interface
494.Ar iface
495is successfully associated with the bond interface, all received packets
496are diverted to the bond interface. The physical interface is no longer
497useable on its own, and remains that way until it is removed from the bond using
498.Fl bonddev .
499.Pp
500It is possible that the specified interface
501.Ar iface
502is not capable of aggregating, and may remain unused until the operating
503conditions change.
504.Pp
505The link status of the bond interface depends on the state of link aggregation.
506If no active partner is detected, the link status will remain inactive.
2b484d24 507.Pp
8d01c344
A
508To monitor the 802.3ad Link Aggregation state, use the
509.Fl b
510option.
511.Pp
512A physical interface that is associated with a vlan pseudo device cannot
513at the same time be associated with a bond pseudo device. A physical interface
514cannot be associated with more than one bond pseudo device at the same time.
515.Pp
516It is not possible to associate a bond with pseudo interfaces such as vlan.
517Only physical ethernet interfaces may be associated with a bond.
518.It Fl bonddev Ar iface
519If the interface is a bond pseudo device, disassociate the physical interface
520.Ar iface
521from it. Before the interface is removed from the bond, the bond device
522announces to the link partner that the interface is now individual and
523no longer aggregatable.
524If the physical
525.Ar iface
526is the last interface in the bond, the bond interface clears its link address.
527.It Cm bondmode Ar lacp | static
528If the interface is a bond pseudo device, this option will set the \fImode\fR
529on the bond interface. The two currently supported modes are
530.Ar lacp
531and
532.Ar static .
533The default mode is
534.Ar lacp .
535.Pp
536To enable static mode (and turn off LACP), specify
537.Ar static .
538In static mode, a member interface is made an active part of the
539link aggregate as long as the link status is active.
540.Pp
541To re-enable LACP mode, specify
542.Ar lacp .
543.El
544.Pp
545The following parameters are specific to IP tunnel interfaces,
546.Xr gif 4 :
547.Bl -tag -width indent
548.It Cm tunnel Ar src_addr dest_addr
549Configure the physical source and destination address for IP tunnel
550interfaces.
551The arguments
552.Ar src_addr
553and
554.Ar dest_addr
555are interpreted as the outer source/destination for the encapsulating
556IPv4/IPv6 header.
557.It Fl tunnel
558Unconfigure the physical source and destination address for IP tunnel
559interfaces previously configured with
560.Cm tunnel .
561.It Cm deletetunnel
562Another name for the
563.Fl tunnel
564parameter.
565.El
566.Pp
567The following parameters are specific to bridge interfaces:
568.Bl -tag -width indent
569.It Cm addm Ar interface
570Add the interface named by
571.Ar interface
572as a member of the bridge.
573The interface is put into promiscuous mode
574so that it can receive every packet sent on the network.
575.It Cm deletem Ar interface
576Remove the interface named by
577.Ar interface
578from the bridge.
579Promiscuous mode is disabled on the interface when
580it is removed from the bridge.
581.It Cm maxaddr Ar size
582Set the size of the bridge address cache to
583.Ar size .
584The default is 100 entries.
585.It Cm timeout Ar seconds
586Set the timeout of address cache entries to
587.Ar seconds
588seconds.
589If
590.Ar seconds
591is zero, then address cache entries will not be expired.
592The default is 240 seconds.
593.It Cm addr
594Display the addresses that have been learned by the bridge.
595.It Cm static Ar interface-name Ar address
596Add a static entry into the address cache pointing to
597.Ar interface-name .
598Static entries are never aged out of the cache or re-placed, even if the
599address is seen on a different interface.
600.It Cm deladdr Ar address
601Delete
602.Ar address
603from the address cache.
604.It Cm flush
605Delete all dynamically-learned addresses from the address cache.
606.It Cm flushall
607Delete all addresses, including static addresses, from the address cache.
608.It Cm discover Ar interface
609Mark an interface as a
610.Dq discovering
611interface.
612When the bridge has no address cache entry
613(either dynamic or static)
614for the destination address of a packet,
615the bridge will forward the packet to all
616member interfaces marked as
617.Dq discovering .
618This is the default for all interfaces added to a bridge.
619.It Cm -discover Ar interface
620Clear the
621.Dq discovering
622attribute on a member interface.
623For packets without the
624.Dq discovering
625attribute, the only packets forwarded on the interface are broadcast
626or multicast packets and packets for which the destination address
627is known to be on the interface's segment.
628.It Cm learn Ar interface
629Mark an interface as a
630.Dq learning
631interface.
632When a packet arrives on such an interface, the source
633address of the packet is entered into the address cache as being a
634destination address on the interface's segment.
635This is the default for all interfaces added to a bridge.
636.It Cm -learn Ar interface
637Clear the
638.Dq learning
639attribute on a member interface.
640.It Cm sticky Ar interface
641Mark an interface as a
642.Dq sticky
643interface.
644Dynamically learned address entries are treated at static once entered into
645the cache.
646Sticky entries are never aged out of the cache or replaced, even if the
647address is seen on a different interface.
648.It Cm -sticky Ar interface
649Clear the
650.Dq sticky
651attribute on a member interface.
652.It Cm private Ar interface
653Mark an interface as a
654.Dq private
655interface.
656A private interface does not forward any traffic to any other port that is also
657a private interface.
658.It Cm -private Ar interface
659Clear the
660.Dq private
661attribute on a member interface.
662.It Cm span Ar interface
663Add the interface named by
664.Ar interface
665as a span port on the bridge.
666Span ports transmit a copy of every frame received by the bridge.
667This is most useful for snooping a bridged network passively on
668another host connected to one of the span ports of the bridge.
669.It Cm -span Ar interface
670Delete the interface named by
671.Ar interface
672from the list of span ports of the bridge.
673.It Cm stp Ar interface
674Enable Spanning Tree protocol on
675.Ar interface .
676The
677.Xr if_bridge 4
678driver has support for the IEEE 802.1D Spanning Tree protocol (STP).
679Spanning Tree is used to detect and remove loops in a network topology.
680.It Cm -stp Ar interface
681Disable Spanning Tree protocol on
682.Ar interface .
683This is the default for all interfaces added to a bridge.
684.It Cm edge Ar interface
685Set
686.Ar interface
687as an edge port.
688An edge port connects directly to end stations cannot create bridging
689loops in the network, this allows it to transition straight to forwarding.
690.It Cm -edge Ar interface
691Disable edge status on
692.Ar interface .
693.It Cm autoedge Ar interface
694Allow
695.Ar interface
696to automatically detect edge status.
697This is the default for all interfaces added to a bridge.
698.It Cm -autoedge Ar interface
699Disable automatic edge status on
700.Ar interface .
701.It Cm ptp Ar interface
702Set the
703.Ar interface
704as a point to point link.
705This is required for straight transitions to forwarding and
706should be enabled on a direct link to another RSTP capable switch.
707.It Cm -ptp Ar interface
708Disable point to point link status on
709.Ar interface .
710This should be disabled for a half duplex link and for an interface
711connected to a shared network segment,
712like a hub or a wireless network.
713.It Cm autoptp Ar interface
714Automatically detect the point to point status on
715.Ar interface
716by checking the full duplex link status.
717This is the default for interfaces added to the bridge.
718.It Cm -autoptp Ar interface
719Disable automatic point to point link detection on
720.Ar interface .
721.It Cm maxage Ar seconds
722Set the time that a Spanning Tree protocol configuration is valid.
723The default is 20 seconds.
724The minimum is 6 seconds and the maximum is 40 seconds.
725.It Cm fwddelay Ar seconds
726Set the time that must pass before an interface begins forwarding
727packets when Spanning Tree is enabled.
728The default is 15 seconds.
729The minimum is 4 seconds and the maximum is 30 seconds.
730.It Cm hellotime Ar seconds
731Set the time between broadcasting of Spanning Tree protocol
732configuration messages.
733The hello time may only be changed when operating in legacy stp mode.
734The default is 2 seconds.
735The minimum is 1 second and the maximum is 2 seconds.
736.It Cm priority Ar value
737Set the bridge priority for Spanning Tree.
738The default is 32768.
739The minimum is 0 and the maximum is 61440.
740.It Cm proto Ar value
741Set the Spanning Tree protocol.
742The default is rstp.
743The available options are stp and rstp.
744.It Cm holdcnt Ar value
745Set the transmit hold count for Spanning Tree.
746This is the number of packets transmitted before being rate limited.
747The default is 6.
748The minimum is 1 and the maximum is 10.
749.It Cm ifpriority Ar interface Ar value
750Set the Spanning Tree priority of
751.Ar interface
752to
753.Ar value .
754The default is 128.
755The minimum is 0 and the maximum is 240.
756.It Cm ifpathcost Ar interface Ar value
757Set the Spanning Tree path cost of
758.Ar interface
759to
760.Ar value .
761The default is calculated from the link speed.
762To change a previously selected path cost back to automatic, set the
763cost to 0.
764The minimum is 1 and the maximum is 200000000.
765.It Cm ifmaxaddr Ar interface Ar size
766Set the maximum number of hosts allowed from an interface, packets with unknown
767source addresses are dropped until an existing host cache entry expires or is
768removed.
769Set to 0 to disable.
770.El
771.Pp
772The following parameters are specific to vlan interfaces:
773.Bl -tag -width indent
774.It Cm vlan Ar vlan_tag
775Set the VLAN tag value to
776.Ar vlan_tag .
777This value is a 16-bit number which is used to create an 802.1Q
778VLAN header for packets sent from the
779.Xr vlan 4
780interface.
781Note that
782.Cm vlan
783and
784.Cm vlandev
785must both be set at the same time.
786.It Cm vlandev Ar iface
787Associate the physical interface
788.Ar iface
789with a
790.Xr vlan 4
791interface.
792Packets transmitted through the
793.Xr vlan 4
794interface will be
795diverted to the specified physical interface
796.Ar iface
797with 802.1Q VLAN encapsulation.
798Packets with 802.1Q encapsulation received
799by the parent interface with the correct VLAN tag will be diverted to
800the associated
801.Xr vlan 4
802pseudo-interface.
803The
804.Xr vlan 4
805interface is assigned a
2b484d24 806copy of the parent interface's flags and the parent's ethernet address.
8d01c344
A
807The
808.Cm vlandev
809and
810.Cm vlan
811must both be set at the same time.
812If the
813.Xr vlan 4
814interface already has
2b484d24
A
815a physical interface associated with it, this command will fail.
816To
817change the association to another physical interface, the existing
8d01c344
A
818association must be cleared first.
819.Pp
820Note: if the hardware tagging capability
821is set on the parent interface, the
822.Xr vlan 4
823pseudo
824interface's behavior changes:
825the
826.Xr vlan 4
827interface recognizes that the
828parent interface supports insertion and extraction of VLAN tags on its
829own (usually in firmware) and that it should pass packets to and from
830the parent unaltered.
831.It Fl vlandev Op Ar iface
832If the driver is a
833.Xr vlan 4
834pseudo device, disassociate the parent interface from it.
835This breaks the link between the
836.Xr vlan 4
837interface and its parent,
838clears its VLAN tag, flags and its link address and shuts the interface down.
839The
2b484d24 840.Ar iface
8d01c344 841argument is useless and hence deprecated.
b7080c8e
A
842.El
843.Pp
8d01c344
A
844The
845.Nm
846utility displays the current configuration for a network interface
b7080c8e
A
847when no optional parameters are supplied.
848If a protocol family is specified,
7ba0088d
A
849.Nm
850will report only the details specific to that protocol family.
851.Pp
8d01c344 852If the
7ba0088d 853.Fl m
8d01c344
A
854flag is passed before an interface name,
855.Nm
856will display the capability list and all
857of the supported media for the specified interface.
2b484d24 858.Pp
7ba0088d
A
859If
860.Fl L
861flag is supplied, address lifetime is displayed for IPv6 addresses,
862as time offset string.
863.Pp
864Optionally, the
865.Fl a
866flag may be used instead of an interface name.
867This flag instructs
868.Nm
869to display information about all interfaces in the system.
870The
871.Fl d
872flag limits this to interfaces that are down, and
873.Fl u
874limits this to interfaces that are up.
875When no arguments are given,
876.Fl a
877is implied.
878.Pp
879The
880.Fl l
881flag may be used to list all available interfaces on the system, with
882no other additional information.
883Use of this flag is mutually exclusive
884with all other flags and commands, except for
885.Fl d
886(only list interfaces that are down)
887and
888.Fl u
889(only list interfaces that are up).
890.Pp
8d01c344
A
891The
892.Fl v
893flag may be used to get more verbose status for an interface.
894.Pp
895The
896.Fl C
897flag may be used to list all of the interface cloners available on
898the system, with no additional information.
899Use of this flag is mutually exclusive with all other flags and commands.
900.Pp
7f5b2e89
A
901The
902.Fl r
903flag may be used to show additional information related to the count of route references on the network interface.
904.Pp
8d01c344
A
905For bridge interfaces, the list of addresses learned by the bridge is not shown when displaying information about
906all interfaces except when the
907.Fl v
908flag is used.
909.Pp
b7080c8e 910Only the super-user may modify the configuration of a network interface.
7ba0088d
A
911.Sh NOTES
912The media selection system is relatively new and only some drivers support
913it (or have need for it).
8d01c344
A
914.Sh EXAMPLES
915Assign the IPv4 address
916.Li 192.0.2.10 ,
917with a network mask of
918.Li 255.255.255.0 ,
919to the interface
920.Li en0 :
921.Dl # ifconfig en0 inet 192.0.2.10 netmask 255.255.255.0
b8dff150 922.Pp
8d01c344
A
923Add the IPv4 address
924.Li 192.0.2.45 ,
925with the CIDR network prefix
926.Li /28 ,
927to the interface
928.Li en0 ,
929using
930.Cm add
931as a synonym for the canonical form of the option
932.Cm alias :
933.Dl # ifconfig en0 inet 192.0.2.45/28 add
934.Pp
935Remove the IPv4 address
936.Li 192.0.2.45
937from the interface
938.Li en0 :
939.Dl # ifconfig en0 inet 192.0.2.45 -alias
940.Pp
941Add the IPv6 address
942.Li 2001:DB8:DBDB::123/48
943to the interface
944.Li en0 :
945.Dl # ifconfig en0 inet6 2001:db8:bdbd::123 prefixlen 48 alias
946Note that lower case hexadecimal IPv6 addresses are acceptable.
947.Pp
948Remove the IPv6 address added in the above example,
949using the
950.Li /
951character as shorthand for the network prefix,
952and using
953.Cm delete
954as a synonym for the canonical form of the option
955.Fl alias :
956.Dl # ifconfig en0 inet6 2001:db8:bdbd::123/48 delete
957.Pp
958Configure the interface
959.Li en1 ,
960to use 100baseTX, full duplex Ethernet media options:
961.Dl # ifconfig en1 media 100baseTX mediaopt full-duplex
962.Pp
963Create the software network interface
964.Li gif1 :
965.Dl # ifconfig gif1 create
966.Pp
967Destroy the software network interface
968.Li gif1 :
969.Dl # ifconfig gif1 destroy
b7080c8e 970.Sh DIAGNOSTICS
7ba0088d 971Messages indicating the specified interface does not exist, the
b7080c8e
A
972requested address is unknown, or the user is not privileged and
973tried to alter an interface's configuration.
974.Sh SEE ALSO
975.Xr netstat 1 ,
976.Xr netintro 4 ,
8d01c344 977.Xr sysctl 8
b7080c8e
A
978.Sh HISTORY
979The
980.Nm
8d01c344 981utility appeared in
b7080c8e 982.Bx 4.2 .
8d01c344
A
983.Sh BUGS
984Basic IPv6 node operation requires a link-local address on each
985interface configured for IPv6.
986Normally, such an address is automatically configured by the
987kernel on each interface added to the system; this behaviour may
988be disabled by setting the sysctl MIB variable
989.Va net.inet6.ip6.auto_linklocal
990to 0.
991.Pp
992If you delete such an address using
993.Nm ,
994the kernel may act very odd.
995Do this at your own risk.