man/orig/ifconfig
Материал из Xgu.ru
Не указан параметр (1)
IFCONFIG(8) FreeBSD System Manager's Manual IFCONFIG(8)
Содержание |
[править] NAME
ifconfig — configure network interface parameters
[править] SYNOPSIS
ifconfig [-L] [-k] [-m] [-n] interface [create] address_family [address [dest_address]] [parameters] ifconfig interface destroy ifconfig -a [-L] [-d] [-m] [-u] [-v] [address_family] ifconfig -l [-d] [-u] [address_family] ifconfig [-L] [-d] [-k] [-m] [-u] [-v] [-C] ifconfig [-g groupname]
[править] DESCRIPTION
The ifconfig utility is used to assign an address to a network interface and/or configure network interface parameters. The ifconfig utility must be used at boot time to define the network address of each interface present on a machine; it may also be used at a later time to redefine an interface's address or other operating parameters.
The following options are available:
address For the DARPA-Internet family, the address is either a host name present in the host name data base, hosts(5), or a DARPA Internet address expressed in the Internet standard “dot notation”.
It is also possible to use the CIDR notation (also known as the slash notation) to include the netmask. That is, one can specify an address like 192.168.0.1/16.
For the “inet6” family, it is also possible to specify the prefix length using the slash notation, like ::1/128. See the prefixlen parameter below for more information.
The link-level (“link”) address is specified as a series of colon-separated hex digits. This can be used to e.g. set a new MAC address on an ethernet interface, though the mechanism used is not ethernet-specific. If the interface is already up when this option is used, it will be briefly brought down and then brought back up again in order to ensure that the receive filter in the underlying ethernet hardware is properly reprogrammed.
address_family Specify the address family which affects interpretation of the remaining parameters. Since an interface can receive transmis‐ sions in differing protocols with different naming schemes, spec‐ ifying the address family is recommended. The address or proto‐ col families currently supported are “inet”, “inet6”, “atalk”, “ipx”, and “link”. The default if available is “inet” or other‐ wise “link”. “ether” and “lladdr” are synonyms for “link”.
dest_address Specify the address of the correspondent on the other end of a point to point link.
interface This parameter is a string of the form “name unit”, for example, “ed0”.
groupname List the interfaces in the given group.
The following parameters may be set with ifconfig:
add Another name for the alias parameter. Introduced for compatibil‐ ity with BSD/OS.
alias Establish an additional network address for this interface. This is sometimes useful when changing network numbers, and one wishes to accept packets addressed to the old interface. If the address is on the same subnet as the first network address for this interface, a non-conflicting netmask must be given. Usually 0xffffffff is most appropriate.
-alias Remove the network address specified. This would be used if you incorrectly specified an alias, or it was no longer needed. If you have incorrectly set an NS address having the side effect of specifying the host portion, removing all NS addresses will allow you to respecify the host portion.
anycast (Inet6 only.) Specify that the address configured is an anycast address. Based on the current specification, only routers may configure anycast addresses. Anycast address will not be used as source address of any of outgoing IPv6 packets.
arp Enable the use of the Address Resolution Protocol (arp(4)) in mapping between network level addresses and link level addresses (default). This is currently implemented for mapping between DARPA Internet addresses and IEEE 802 48-bit MAC addresses (Eth‐ ernet, FDDI, and Token Ring addresses).
-arp Disable the use of the Address Resolution Protocol (arp(4)).
staticarp If the Address Resolution Protocol is enabled, the host will only reply to requests for its addresses, and will never send any requests.
-staticarp If the Address Resolution Protocol is enabled, the host will per‐ form normally, sending out requests and listening for replies.
broadcast (Inet only.) Specify the address to use to represent broadcasts to the network. The default broadcast address is the address with a host part of all 1's.
debug Enable driver dependent debugging code; usually, this turns on extra console error logging.
-debug Disable driver dependent debugging code.
promisc Put interface into permanently promiscuous mode.
-promisc Disable permanently promiscuous mode.
delete Another name for the -alias parameter.
description value, descr value Specify a description of the interface. This can be used to label interfaces in situations where they may otherwise be diffi‐ cult to distinguish.
-description, -descr Clear the interface description.
down Mark an interface “down”. When an interface is marked “down”, the system will not attempt to transmit messages through that interface. If possible, the interface will be reset to disable reception as well. This action does not automatically disable routes using the interface.
group group-name Assign the interface to a “group”. Any interface can be in mul‐ tiple groups.
Cloned interfaces are members of their interface family group by default. For example, a PPP interface such as ppp0 is a member of the PPP interface family group, ppp.
-group group-name Remove the interface from the given “group”.
eui64 (Inet6 only.) Fill interface index (lowermost 64bit of an IPv6 address) automatically.
fib fib_number Specify interface FIB. A FIB fib_number is assigned to all frames or packets received on that interface. The FIB is not inherited, e.g. vlans or other sub-interfaces will use the default FIB (0) irrespective of the parent interface's FIB. The kernel needs to be tuned to support more than the default FIB using the ROUTETABLES kernel configuration option, or the net.fibs tunable.
ipdst This is used to specify an Internet host who is willing to receive IP packets encapsulating IPX packets bound for a remote network. An apparent point to point link is constructed, and the address specified will be taken as the IPX address and network of the destination.
maclabel label If Mandatory Access Control support is enabled in the kernel, set the MAC label to label.
media type If the driver supports the media selection system, set the media type of the interface to type. Some interfaces support the mutu‐ ally exclusive use of one of several different physical media connectors. For example, a 10Mbit/s Ethernet interface might support the use of either AUI or twisted pair connectors. Set‐ ting the media type to 10base5/AUI would change the currently active connector to the AUI port. Setting it to 10baseT/UTP would activate twisted pair. Refer to the interfaces' driver specific documentation or man page for a complete list of the available types.
mediaopt opts If the driver supports the media selection system, set the speci‐ fied media options on the interface. The opts argument is a comma delimited list of options to apply to the interface. Refer to the interfaces' driver specific man page for a complete list of available options.
-mediaopt opts If the driver supports the media selection system, disable the specified media options on the interface.
mode mode If the driver supports the media selection system, set the speci‐ fied operating mode on the interface to mode. For IEEE 802.11 wireless interfaces that support multiple operating modes this directive is used to select between 802.11a (11a), 802.11b (11b), and 802.11g (11g) operating modes.
inst minst, instance minst Set the media instance to minst. This is useful for devices which have multiple physical layer interfaces (PHYs).
name name Set the interface name to name.
rxcsum, txcsum If the driver supports user-configurable checksum offloading, enable receive (or transmit) checksum offloading on the inter‐ face. Some drivers may not be able to enable these flags inde‐ pendently of each other, so setting one may also set the other. The driver will offload as much checksum work as it can reliably support, the exact level of offloading varies between drivers.
-rxcsum, -txcsum If the driver supports user-configurable checksum offloading, disable receive (or transmit) checksum offloading on the inter‐ face. These settings may not always be independent of each other.
tso If the driver supports tcp(4) segmentation offloading, enable TSO on the interface. Some drivers may not be able to support TSO for ip(4) and ip6(4) packets, so they may enable only one of them.
-tso If the driver supports tcp(4) segmentation offloading, disable TSO on the interface. It will always disable TSO for ip(4) and ip6(4).
lro If the driver supports tcp(4) large receive offloading, enable LRO on the interface.
-lro If the driver supports tcp(4) large receive offloading, disable LRO on the interface.
wol, wol_ucast, wol_mcast, wol_magic Enable Wake On Lan (WOL) support, if available. WOL is a facil‐ ity whereby a machine in a low power state may be woken in response to a received packet. There are three types of packets that may wake a system: ucast (directed solely to the machine's mac address), mcast (directed to a broadcast or multicast address), or magic (unicast or multicast frames with a ``magic contents). Not all devices support WOL, those that do indicate the mechanisms they support in their capabilities. wol is a syn‐ onym for enabling all available WOL mechanisms. To disable WOL use -wol.
vlanmtu, vlanhwtag, vlanhwfilter, vlanhwcsum, vlanhwtso If the driver offers user-configurable VLAN support, enable reception of extended frames, tag processing in hardware, frame filtering in hardware, checksum offloading, or TSO on VLAN, respectively. Note that this must be issued on a physical inter‐ face associated with vlan(4), not on a vlan(4) interface itself.
-vlanmtu, -vlanhwtag, -vlanhwfilter, -vlanhwtso If the driver offers user-configurable VLAN support, disable reception of extended frames, tag processing in hardware, frame filtering in hardware, or TSO on VLAN, respectively.
vnet jail Move the interface to the jail(8), specified by name or JID. If the jail has a virtual network stack, the interface will disap‐ pear from the current environment and become visible to the jail.
-vnet jail Reclaim the interface from the jail(8), specified by name or JID. If the jail has a virtual network stack, the interface will dis‐ appear from the jail, and become visible to the current network environment.
polling Turn on polling(4) feature and disable interrupts on the inter‐ face, if driver supports this mode.
-polling Turn off polling(4) feature and enable interrupt mode on the interface.
create Create the specified network pseudo-device. If the interface is given without a unit number, try to create a new device with an arbitrary unit number. If creation of an arbitrary device is successful, the new device name is printed to standard output unless the interface is renamed or destroyed in the same ifconfig invocation.
destroy Destroy the specified network pseudo-device.
plumb Another name for the create parameter. Included for Solaris com‐ patibility.
unplumb Another name for the destroy parameter. Included for Solaris compatibility.
metric n Set the routing metric of the interface to n, default 0. The routing metric is used by the routing protocol (routed(8)). Higher metrics have the effect of making a route less favorable; metrics are counted as additional hops to the destination network or host.
mtu n Set the maximum transmission unit of the interface to n, default is interface specific. The MTU is used to limit the size of packets that are transmitted on an interface. Not all interfaces support setting the MTU, and some interfaces have range restric‐ tions.
netmask mask (Inet only.) Specify how much of the address to reserve for sub‐ dividing networks into sub-networks. The mask includes the net‐ work part of the local address and the subnet part, which is taken from the host field of the address. The mask can be speci‐ fied as a single hexadecimal number with a leading ‘0x’, with a dot-notation Internet address, or with a pseudo-network name listed in the network table networks(5). The mask contains 1's for the bit positions in the 32-bit address which are to be used for the network and subnet parts, and 0's for the host part. The mask should contain at least the standard network portion, and the subnet field should be contiguous with the network portion.
The netmask can also be specified in CIDR notation after the address. See the address option above for more information.
prefixlen len (Inet6 only.) Specify that len bits are reserved for subdividing networks into sub-networks. The len must be integer, and for syntactical reason it must be between 0 to 128. It is almost always 64 under the current IPv6 assignment rule. If the parame‐ ter is omitted, 64 is used.
The prefix can also be specified using the slash notation after the address. See the address option above for more information.
range netrange Under appletalk, set the interface to respond to a netrange of the form startnet-endnet. Appletalk uses this scheme instead of netmasks though FreeBSD implements it internally as a set of net‐ masks.
remove Another name for the -alias parameter. Introduced for compati‐ bility with BSD/OS.
phase The argument following this specifies the version (phase) of the Appletalk network attached to the interface. Values of 1 or 2 are permitted.
link[0-2] Enable special processing of the link level of the interface. These three options are interface specific in actual effect, how‐ ever, they are in general used to select special modes of opera‐ tion. An example of this is to enable SLIP compression, or to select the connector type for some Ethernet cards. Refer to the man page for the specific driver for more information.
-link[0-2] Disable special processing at the link level with the specified interface.
monitor Put the interface in monitor mode. No packets are transmitted, and received packets are discarded after bpf(4) processing.
-monitor Take the interface out of monitor mode.
up Mark an interface “up”. This may be used to enable an interface after an “ifconfig down”. It happens automatically when setting the first address on an interface. If the interface was reset when previously marked down, the hardware will be re-initialized.
The following parameters are for ICMPv6 Neighbor Discovery Protocol. Note that the address family keyword “inet6” is needed for them:
accept_rtadv Set a flag to enable accepting ICMPv6 Router Advertisement mes‐ sages. The sysctl(8) variable net.inet6.ip6.accept_rtadv con‐ trols whether this flag is set by default or not.
-accept_rtadv Clear a flag accept_rtadv.
no_radr Set a flag to control whether routers from which the system accepts Router Advertisement messages will be added to the Default Router List or not. When the accept_rtadv flag is dis‐ abled, this flag has no effect. The sysctl(8) variable net.inet6.ip6.no_radr controls whether this flag is set by default or not.
-no_radr Clear a flag no_radr.
auto_linklocal Set a flag to perform automatic link-local address configuration when the interface becomes available. The sysctl(8) variable net.inet6.ip6.auto_linklocal controls whether this flag is set by default or not.
-auto_linklocal Clear a flag auto_linklocal.
defaultif Set the specified interface as the default route when there is no default router.
-defaultif Clear a flag defaultif.
ifdisabled Set a flag to disable all of IPv6 network communications on the specified interface. Note that if there are already configured IPv6 addresses on that interface, all of them are marked as “tentative” and DAD will be performed when this flag is cleared.
-ifdisabled Clear a flag ifdisabled. When this flag is cleared and auto_linklocal flag is enabled, automatic configuration of a link-local address is performed.
nud Set a flag to enable Neighbor Unreachability Detection.
-nud Clear a flag nud.
prefer_source Set a flag to prefer addresses on the interface as candidates of the source address for outgoing packets.
-prefer_source Clear a flag prefer_source.
The following parameters are specific to cloning IEEE 802.11 wireless interfaces with the create request:
wlandev device Use device as the parent for the cloned device.
wlanmode mode Specify the operating mode for this cloned device. mode is one of sta, ahdemo (or adhoc-demo ), ibss, (or adhoc ), ap, (or hostap ), wds, tdma, mesh, and monitor. The operating mode of a cloned interface cannot be changed. The tdma mode is actually implemented as an adhoc-demo interface with special properties.
wlanbssid bssid The 802.11 mac address to use for the bssid. This must be speci‐ fied at create time for a legacy wds device.
wlanaddr address The local mac address. If this is not specified then a mac address will automatically be assigned to the cloned device. Typically this address is the same as the address of the parent device but if the bssid parameter is specified then the driver will craft a unique address for the device (if supported).
wdslegacy Mark a wds device as operating in ``legacy mode. Legacy wds devices have a fixed peer relationship and do not, for example, roam if their peer stops communicating. For completeness a Dynamic WDS (DWDS) interface may marked as -wdslegacy.
bssid Request a unique local mac address for the cloned device. This is only possible if the device supports multiple mac addresses. To force use of the parent's mac address use -bssid.
beacons Mark the cloned interface as depending on hardware support to track received beacons. To have beacons tracked in software use -beacons. For hostap mode -beacons can also be used to indicate no beacons should be transmitted; this can be useful when creat‐ ing a WDS configuration but wds interfaces can only be created as companions to an access point.
The following parameters are specific to IEEE 802.11 wireless interfaces cloned with a create operation:
ampdu Enable sending and receiving AMPDU frames when using 802.11n (default). The 802.11n specification states a compliant station must be capable of receiving AMPDU frames but transmission is optional. Use -ampdu to disable all use of AMPDU with 802.11n. For testing and/or to work around interoperability problems one can use ampdutx and ampdurx to control use of AMPDU in one direc‐ tion.
ampdudensity density Set the AMPDU density parameter used when operating with 802.11n. This parameter controls the inter-packet gap for AMPDU frames. The sending device normally controls this setting but a receiving station may request wider gaps. Legal values for density are 0, .25, .5, 1, 2, 4, 8, and 16 (microseconds). A value of - is treated the same as 0.
ampdulimit limit Set the limit on packet size for receiving AMPDU frames when operating with 802.11n. Legal values for limit are 8192, 16384, 32768, and 65536 but one can also specify just the unique prefix: 8, 16, 32, 64. Note the sender may limit the size of AMPDU frames to be less than the maximum specified by the receiving station.
amsdu Enable sending and receiving AMSDU frames when using 802.11n. By default AMSDU is received but not transmitted. Use -amsdu to disable all use of AMSDU with 802.11n. For testing and/or to work around interoperability problems one can use amsdutx and amsdurx to control use of AMSDU in one direction.
amsdulimit limit Set the limit on packet size for sending and receiving AMSDU frames when operating with 802.11n. Legal values for limit are 7935 and 3839 (bytes). Note the sender may limit the size of AMSDU frames to be less than the maximum specified by the receiv‐ ing station. Note also that devices are not required to support the 7935 limit, only 3839 is required by the specification and the larger value may require more memory to be dedicated to sup‐ port functionality that is rarely used.
apbridge When operating as an access point, pass packets between wireless clients directly (default). To instead let them pass up through the system and be forwarded using some other mechanism, use -apbridge. Disabling the internal bridging is useful when traf‐ fic is to be processed with packet filtering.
authmode mode Set the desired authentication mode in infrastructure mode. Not all adapters support all modes. The set of valid modes is none, open, shared (shared key), 8021x (IEEE 802.1x), and wpa (IEEE WPA/WPA2/802.11i). The 8021x and wpa modes are only useful when using an authentication service (a supplicant for client opera‐ tion or an authenticator when operating as an access point). Modes are case insensitive.
bgscan Enable background scanning when operating as a station. Back‐ ground scanning is a technique whereby a station associated to an access point will temporarily leave the channel to scan for neighboring stations. This allows a station to maintain a cache of nearby access points so that roaming between access points can be done without a lengthy scan operation. Background scanning is done only when a station is not busy and any outbound traffic will cancel a scan operation. Background scanning should never cause packets to be lost though there may be some small latency if outbound traffic interrupts a scan operation. By default background scanning is enabled if the device is capable. To dis‐ able background scanning, use -bgscan. Background scanning is controlled by the bgscanidle and bgscanintvl parameters. Back‐ ground scanning must be enabled for roaming; this is an artifact of the current implementation and may not be required in the future.
bgscanidle idletime Set the minimum time a station must be idle (not transmitting or receiving frames) before a background scan is initiated. The idletime parameter is specified in milliseconds. By default a station must be idle at least 250 milliseconds before a back‐ ground scan is initiated. The idle time may not be set to less than 100 milliseconds.
bgscanintvl interval Set the interval at which background scanning is attempted. The interval parameter is specified in seconds. By default a back‐ ground scan is considered every 300 seconds (5 minutes). The interval may not be set to less than 15 seconds.
bintval interval Set the interval at which beacon frames are sent when operating in ad-hoc or ap mode. The interval parameter is specified in TU's (1024 usecs). By default beacon frames are transmitted every 100 TU's.
bmissthreshold count Set the number of consecutive missed beacons at which the station will attempt to roam (i.e., search for a new access point). The count parameter must be in the range 1 to 255; though the upper bound may be reduced according to d