1 .\" $NetBSD: ifconfig.8,v 1.100 2009/08/07 20:13:12 dyoung Exp $
3 .\" Copyright (c) 1983, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94
37 .Nd configure network interface parameters
41 .Ar interface address_family
50 .Op Ar protocol_family
54 .Op Ar protocol_family
65 is used to assign an address
66 to a network interface and/or configure
67 network interface parameters.
69 must be used at boot time to define the network address
70 of each interface present on a machine; it may also be used at
71 a later time to redefine an interface's address
72 or other operating parameters.
74 Available operands for
81 the address is either a host name present in the host name data
86 Internet address expressed in the Internet standard
88 For the Xerox Network Systems(tm) family,
93 is the assigned network number
95 and each of the six bytes of the host number,
99 are specified in hexadecimal.
100 The host number may be omitted on Ethernet interfaces,
101 which use the hardware physical address,
102 and on interfaces other than the first.
105 family, addresses are specified as a long hexadecimal string,
106 as in the Xerox family.
107 However, two consecutive dots imply a zero
108 byte, and the dots are optional, if the user wishes to
110 count out long strings of digits in network byte order.
111 .It Ar address_family
114 which affects interpretation of the remaining parameters.
115 Since an interface can receive transmissions in differing protocols
116 with different naming schemes, specifying the address family is recommended.
117 The address or protocol families currently
128 parameter is a string of the form
134 The following parameters may be set with
136 .Bl -tag -width dest_addressxx
138 This keyword applies when
140 adds or modifies any link-layer address.
146 Activation makes an address the default source for transmissions
148 You may not delete the active address from an interface.
149 You must activate some other address, first.
153 pseudo-device, set the base advertisement interval to
156 This ia an 8-bit number; the default value is 1 second.
160 pseudo-device, skew the advertisement interval by
162 This is an 8-bit number; the default value is 0.
166 indicate how frequently, in seconds, the host will advertise the fact that it
167 considers itself the master of the virtual host.
173 If the master does not advertise within three times this interval, this host
174 will begin advertising as master.
176 Establish an additional network address for this interface.
177 This is sometimes useful when changing network numbers, and
178 one wishes to accept packets addressed to the old interface.
180 Remove the specified network address alias.
182 Enable the use of the Address Resolution Protocol in mapping
183 between network level addresses and link level addresses
185 This is currently implemented for mapping between
188 addresses and Ethernet addresses.
190 Disable the use of the Address Resolution Protocol.
193 Set the IPv6 anycast address bit.
196 Clear the IPv6 anycast address bit.
197 .It Cm broadcast Ar mask
199 Specify the address to use to represent broadcasts to the
201 The default broadcast address is the address with a host part of all 1's.
202 .It Cm carpdev Ar iface
205 pseudo-device, attach it to
207 If not specified, the kernel will attempt to select an interface with
208 a subnet matching that of the carp interface.
210 Enable driver dependent debugging code; usually, this turns on
211 extra console error logging.
213 Disable driver dependent debugging code.
215 Remove the network address specified.
216 This would be used if you incorrectly specified an alias, or it
217 was no longer needed.
218 If you have incorrectly set an NS address having the side effect
219 of specifying the host portion, removing all NS addresses will
220 allow you to respecify the host portion.
222 does not work for IPv6 addresses.
225 with explicit IPv6 address instead.
227 Specify the address of the correspondent on the other end
228 of a point to point link.
230 Mark an interface ``down''.
232 marked ``down'', the system will not attempt to
233 transmit messages through that interface.
234 If possible, the interface will be reset to disable reception as well.
235 This action does not automatically disable routes using the interface.
237 This is used to specify an Internet host who is willing to receive
238 ip packets encapsulating NS packets bound for a remote network.
239 An apparent point to point link is constructed, and
240 the address specified will be taken as the NS address and network
244 packets is done differently.
246 Set the media type of the interface to
248 Some interfaces support the mutually exclusive use of one of several
249 different physical media connectors.
250 For example, a 10Mb/s Ethernet
251 interface might support the use of either
253 or twisted pair connectors.
254 Setting the media type to
258 would change the currently active connector to the AUI port.
263 would activate twisted pair.
264 Refer to the interfaces' driver
265 specific man page for a complete list of the available types
268 manual page for a list of media types.
272 .It Cm mediaopt Ar opts
273 Set the specified media options on the interface.
275 is a comma delimited list of options to apply to the interface.
276 Refer to the interfaces' driver specific man page for a complete
277 list of available options.
280 manual page for a list of media options.
281 .It Fl mediaopt Ar opts
282 Disable the specified media options on the interface.
284 If the driver supports the media selection system, set the specified
285 operating mode on the interface to
287 For IEEE 802.11 wireless interfaces that support multiple operating modes
288 this directive is used to select between 802.11a
295 .It Cm instance Ar minst
296 Set the media instance to
298 This is useful for devices which have multiple physical layer interfaces
300 Setting the instance on such devices may not be strictly required
301 by the network interface driver as the driver may take care of this
302 automatically; see the driver's manual page for more information.
304 Set the routing metric of the interface to
307 The routing metric is used by the routing protocol
309 Higher metrics have the effect of making a route
310 less favorable; metrics are counted as addition hops
311 to the destination network or host.
313 Set the maximum transmission unit of the interface to
315 Most interfaces don't support this option.
316 .It Cm netmask Ar mask
317 .Pq inet, inet6, and ISO
318 Specify how much of the address to reserve for subdividing
319 networks into sub-networks.
320 The mask includes the network part of the local address
321 and the subnet part, which is taken from the host field of the address.
322 The mask can be specified as a single hexadecimal number
323 with a leading 0x, with a dot-notation Internet address,
324 or with a pseudo-network name listed in the network table
326 The mask contains 1's for the bit positions in the 32-bit address
327 which are to be used for the network and subnet parts,
328 and 0's for the host part.
329 The mask should contain at least the standard network portion,
330 and the subnet field should be contiguous with the network
333 For INET and INET6 addresses, the netmask can also be given with
334 slash-notation after the address
335 .Pq e.g 192.168.17.3/24 .
338 .It Cm nsellength Ar n
341 This specifies a trailing number of bytes for a received
343 used for local identification, the remaining leading part of which is
346 .Pq Network Entity Title .
347 The default value is 1, which is conformant to US
349 When an ISO address is set in an ifconfig command,
352 which is being specified.
355 20 hex digits should be
358 to be assigned to the interface.
359 There is some evidence that a number different from 1 may be useful
363 .It Cm state Ar state
366 pseudo-device to enter this state.
372 .It Cm frag Ar threshold
373 .Pq IEEE 802.11 devices only
374 Configure the fragmentation threshold for IEEE 802.11-based wireless
376 .It Cm rts Ar threshold
377 .Pq IEEE 802.11 devices only
378 Configure the RTS/CTS threshold for IEEE 802.11-based wireless
380 This controls the number of bytes used for the RTS/CTS handshake boundary.
383 can be any value between 0 and 2347.
384 The default is 2347, which indicates the RTS/CTS mechanism should not be used.
386 .Pq IEEE 802.11 devices only
387 Configure the Service Set Identifier (a.k.a. the network name)
388 for IEEE 802.11-based wireless network interfaces.
391 can either be any text string up to 32 characters in length,
392 or a series of up to 64 hexadecimal digits preceded by
396 to the empty string allows the interface to connect to any available
402 .Pq IEEE 802.11 devices only
403 When operating as an access point, do not broadcast the SSID
404 in beacon frames or respond to probe request frames unless
405 they are directed to the ap (i.e., they include the ap's SSID).
406 By default, the SSID is included in beacon frames and
407 undirected probe request frames are answered.
409 .Pq IEEE 802.11 devices only
410 When operating as an access point, broadcast the SSID
411 in beacon frames and answer and respond to undirected probe
412 request frames (default).
414 .Pq IEEE 802.11 devices only
415 Enable WEP encryption for IEEE 802.11-based wireless network interfaces
420 can either be a string, a series of hexadecimal digits preceded by
422 or a set of keys in the form
426 specifies which of keys will be used for all transmitted packets,
431 are configured as WEP keys.
432 Note that the order must be match within same network if multiple keys
434 For IEEE 802.11 wireless network, the length of each key is restricted to
435 40 bits, i.e. 5-character string or 10 hexadecimal digits,
436 while the WaveLAN/IEEE Gold cards accept the 104 bits
439 .It Cm nwkey Cm persist
440 .Pq IEEE 802.11 devices only
441 Enable WEP encryption for IEEE 802.11-based wireless network interfaces
442 with the persistent key written in the network card.
443 .It Cm nwkey Cm persist: Ns Ar key
444 .Pq IEEE 802.11 devices only
447 to the persistent memory of the network card, and
448 enable WEP encryption for IEEE 802.11-based wireless network interfaces
452 .Pq IEEE 802.11 devices only
453 Disable WEP encryption for IEEE 802.11-based wireless network interfaces.
455 .Pq IEEE 802.11 devices only
456 When operating as an access point, pass packets between
457 wireless clients directly (default).
459 .Pq IEEE 802.11 devices only
460 When operating as an access point, pass packets through
461 the system so that they can be forwared using some other mechanism.
462 Disabling the internal bridging is useful when traffic
463 is to be processed with packet filtering.
464 .It Cm pass Ar passphrase
467 pseudo-device, set the authentication key to
469 There is no passphrase by default
471 .Pq IEEE 802.11 devices only
472 Enable 802.11 power saving mode.
474 .Pq IEEE 802.11 devices only
475 Disable 802.11 power saving mode.
476 .It Cm powersavesleep Ar duration
477 .Pq IEEE 802.11 devices only
478 Set the receiver sleep duration in milliseconds for 802.11 power saving mode.
479 .It Cm bssid Ar bssid
480 .Pq IEEE 802.11 devices only
481 Set the desired BSSID for IEEE 802.11-based wireless network interfaces.
483 .Pq IEEE 802.11 devices only
484 Unset the desired BSSID for IEEE 802.11-based wireless network interfaces.
485 The interface will automatically select a BSSID in this mode, which is
488 .Pq IEEE 802.11 devices only
491 to be used for IEEE 802.11-based wireless network interfaces.
493 .Pq IEEE 802.11 devices only
494 Unset the desired channel to be used
495 for IEEE 802.11-based wireless network interfaces.
496 It doesn't affect the channel to be created for IBSS or hostap mode.
498 .Pq IEEE 802.11 devices only
499 Display the access points and/or ad-hoc neighbors
500 located in the vicinity.
503 flag may be used to display long SSIDs.
505 also causes received information elements to be displayed symbolicaly.
506 Only the super-user can use this command.
507 .It Cm tunnel Ar src_addr Ns Op Ar ,src_port
508 .Ar dest_addr Ns Op Ar ,dest_port
509 .Pq IP tunnel devices only
510 Configure the physical source and destination address for IP tunnel
511 interfaces, including
517 are interpreted as the outer source/destination for the encapsulating
522 interface in UDP mode, the arguments
526 are interpreted as the outer source/destination port for the encapsulating
529 Unconfigure the physical source and destination address for IP tunnel
530 interfaces previously configured with
533 Create the specified network pseudo-device.
535 Destroy the specified network pseudo-device.
538 Set preferred lifetime for the address.
539 .It Cm prefixlen Ar n
540 .Pq inet and inet6 only
543 but you can specify by prefix length by digits.
546 Set the IPv6 deprecated address bit.
549 Clear the IPv6 deprecated address bit.
552 Set the IPv6 tentative address bit.
555 Clear the IPv6 tentative address bit.
559 .Pq lowermost 64bit of an IPv6 address
562 Enable special processing of the link level of the interface.
563 These three options are interface specific in actual effect, however,
564 they are in general used to select special modes of operation.
566 of this is to enable SLIP compression, or to select the connector type
567 for some Ethernet cards.
568 Refer to the man page for the specific driver
569 for more information.
571 Disable special processing at the link level with the specified interface.
573 Mark an interface ``up''.
574 This may be used to enable an interface after an ``ifconfig down.''
575 It happens automatically when setting the first address on an interface.
576 If the interface was reset when previously marked down,
577 the hardware will be re-initialized.
581 pseudo-device, set the virtual host ID to
583 Acceptable values are 1 to 255.
585 If the interface is a
587 pseudo-interface, set the VLAN identifier to
589 These are the first 12 bits (0-4095) from a 16-bit integer used
590 to create an 802.1Q VLAN header for packets sent from the
597 must be set at the same time.
598 .It Cm vlanif Ar iface
599 If the interface is a
601 pseudo-interface, associate the physical interface
604 Packets transmitted through the
606 interface will be diverted to the specified physical interface
608 with 802.1Q VLAN encapsulation.
609 Packets with 802.1Q encapsulation received
610 by the physical interface with the correct VLAN tag will be diverted to the
614 The VLAN interface is assigned a copy of the physical
615 interface's flags and
620 interface already has a physical interface associated with it, this command
622 To change the association to another physical interface, the
623 existing association must be cleared first.
628 must be set at the same time.
629 .It Cm agrport Ar iface
635 .It Cm -agrport Ar iface
643 Set valid lifetime for the address.
646 .Dq ip4csum-tx ip4csum-rx
649 .Dq -ip4csum-tx -ip4csum-rx
652 .Dq tcp4csum-tx tcp4csum-rx
655 .Dq -tcp4csum-tx -tcp4csum-rx
658 .Dq udp4csum-tx udp4csum-rx
661 .Dq -udp4csum-tx -udp4csum-rx
664 .Dq tcp6csum-tx tcp6csum-rx
667 .Dq -tcp6csum-tx -tcp6csum-rx
670 .Dq udp6csum-tx udp6csum-rx
673 .Dq -udp6csum-tx -udp6csum-rx
675 Enable hardware-assisted IPv4 header checksums for the out-bound direction.
677 Disable hardware-assisted IPv4 header checksums for the out-bound direction.
679 Enable hardware-assisted IPv4 header checksums for the in-bound direction.
681 Disable hardware-assisted IPv4 header checksums for the in-bound direction.
683 Enable hardware-assisted TCP/IPv4 checksums for the out-bound direction.
685 Disable hardware-assisted TCP/IPv4 checksums for the out-bound direction.
687 Enable hardware-assisted TCP/IPv4 checksums for the in-bound direction.
689 Disable hardware-assisted TCP/IPv4 checksums for the in-bound direction.
691 Enable hardware-assisted UDP/IPv4 checksums for the out-bound direction.
693 Disable hardware-assisted UDP/IPv4 checksums for the out-bound direction.
695 Enable hardware-assisted UDP/IPv4 checksums for the in-bound direction.
697 Disable hardware-assisted UDP/IPv4 checksums for the in-bound direction.
699 Enable hardware-assisted TCP/IPv6 checksums for the out-bound direction.
701 Disable hardware-assisted TCP/IPv6 checksums for the out-bound direction.
703 Enable hardware-assisted TCP/IPv6 checksums for the in-bound direction.
705 Disable hardware-assisted TCP/IPv6 checksums for the in-bound direction.
707 Enable hardware-assisted UDP/IPv6 checksums for the out-bound direction.
709 Disable hardware-assisted UDP/IPv6 checksums for the out-bound direction.
711 Enable hardware-assisted UDP/IPv6 checksums for the in-bound direction.
713 Disable hardware-assisted UDP/IPv6 checksums for the in-bound direction.
715 Enable hardware-assisted TCP/IPv4 segmentation on interfaces that
718 Disable hardware-assisted TCP/IPv4 segmentation on interfaces that
721 Enable hardware-assisted TCP/IPv6 segmentation on interfaces that
724 Disable hardware-assisted TCP/IPv6 segmentation on interfaces that
729 pseudo-device, indicate the maximum number
730 of updates for a single state which can be collapsed into one.
731 This is an 8-bit number; the default value is 128.
732 .It Cm syncdev Ar iface
735 pseudo-device, use the specified interface
736 to send and receive pfsync state synchronisation messages.
740 pseudo-device, stop sending pfsync state
741 synchronisation messages over the network.
742 .It Cm syncpeer Ar peer_address
745 pseudo-device, make the pfsync link point-to-point rather than using
746 multicast to broadcast the state synchronisation messages.
747 The peer_address is the IP address of the other host taking part in
751 traffic can be protected using
756 pseudo-device, broadcast the packets using multicast.
760 displays the current configuration for a network interface
761 when no optional parameters are supplied.
762 If a protocol family is specified,
764 will report only the details specific to that protocol
769 flag is passed before an interface name,
771 will attempt to query the interface for its media status.
773 interface supports reporting media status, and it reports that it does
774 not appear to be connected to a network,
776 will exit with status of 1
778 otherwise, it will exit with a
782 Not all interface drivers support media
787 flag is passed before an interface name,
789 will display all of the supported media for the specified interface.
792 flag is supplied, address lifetime is displayed for IPv6 addresses,
793 as time offset string.
797 flag may be used instead of an interface name.
800 to display information about all interfaces in the system.
802 limits this to interfaces that are down,
804 limits this to interfaces that are up,
806 limits this to broadcast interfaces, and
808 omits interfaces which appear not to be connected to a network.
812 flag may be used to list all available interfaces on the system, with
813 no other additional information.
814 Use of this flag is mutually exclusive
815 with all other flags and commands, except for
817 .Pq only list interfaces that are down ,
819 .Pq only list interfaces that are up ,
821 .Pq only list interfaces that may be connected ,
823 .Pq only list broadcast interfaces .
827 flag may be used to list all of the interface cloners available on
828 the system, with no additional information.
830 mutually exclusive with all other flags and commands.
834 flag prints statistics on packets sent and received on the given
838 is used in conjunction with
840 the byte statistics will be printed in "human-readable" format.
843 flag is identical to the
845 flag except that it zeros the interface input and output statistics
850 flag is just the opposite of the
858 to try to resolve numbers to hostnames or to service names.
861 behavior is to print numbers instead of names.
863 Only the super-user may modify the configuration of a network interface.
865 Add a link-layer (MAC) address to an Ethernet:
867 .Ic ifconfig sip0 link 00:11:22:33:44:55
869 Add and activate a link-layer (MAC) address:
871 .Ic ifconfig sip0 link 00:11:22:33:44:55 active
873 Messages indicating the specified interface does not exist, the
874 requested address is unknown, or the user is not privileged and
875 tried to alter an interface's configuration.