man.bsd.lv manual page server

Manual Page Search Parameters

IFMEDIA(4) Device Drivers Manual IFMEDIA(4)

ifmedianetwork interface media settings

#include <sys/socket.h>
#include <net/if.h>
#include <net/if_media.h>

The ifmedia interface provides a consistent method for querying and setting network interface media and media options. The media is typically set using the ifconfig(8) command.

There are currently four link types supported by ifmedia:

Ethernet
Token Ring
FDDI
IEEE802.11 Wireless LAN

The following sections describe the possible media settings for each link type. Not all of these are supported by every device; refer to your device's manual page for more information.

The lists below provide the possible names of each media type or option. The first name in the list is the canonical name of the media type or option. Additional names are acceptable aliases for the media type or option.

The following media types are shared by all link types:

Autoselect the best media. [autoselect, auto]
Jumper or switch on device selects media. [manual]
Deselect all media. [none]

The following media options are shared by all link types:

Place the device into full-duplex mode. This option only has meaning if the device is normally not full-duplex. [full-duplex, fdx]
Place the device into half-duplex mode. This option only has meaning if the device is normally not half-duplex. [half-duplex, hdx]
Hardware flow control support. [flowcontrol, flow]
Driver-defined flag. [flag0]
Driver-defined flag. [flag1]
Driver-defined flag. [flag2]
Place the device into hardware loopback mode. [loopback, hw-loopback, loop]

The following media types are defined for Ethernet:

HomePNA 1.0, 1Mb/s. [HomePNA1, HPNA1]
10BASE-T, 10Mb/s over unshielded twisted pair, RJ45 connector. [10baseT, UTP, 10UTP]
10BASE2, 10Mb/s over coaxial cable, BNC connector, also called Thinnet. [10base2, BNC, 10BNC]
10BASE5, 10Mb/s over 15-wire cables, DB15 connector, also called AUI. [10base5, AUI, 10AUI]
10BASE-STP, 10Mb/s over shielded twisted pair, DB9 connector. [10baseSTP, STP, 10STP]
10BASE-FL, 10Mb/s over fiber optic cables. [10baseFL, FL, 10FL]
100BASE-TX, 100Mb/s over unshielded twisted pair, RJ45 connector. [100baseTX, 100TX]
100BASE-FX, 100Mb/s over fiber optic cables. [100baseFX, 100FX]
100BASE-T4, 100Mb/s over 4-wire (category 3) unshielded twisted pair, RJ45 connector. [100baseT4, 100T4]
100BASE-T2. [100baseT2, 100T2]
100VG-AnyLAN. [100baseVG, 100VG]
1000BASE-SX, 1Gb/s over multi-mode fiber optic cables. (short waves) [1000baseSX, 1000SX]
1000BASE-LX, 1Gb/s over single-mode fiber or multi-mode fiber optic cables. (long waves) [1000baseLX, 1000LX]
1000BASE-BX10, 1Gb/s over bidirectional fiber optic cables. (long waves) [1000BASE-BX10]
1000BASE-CX, 1Gb/s over shielded twisted pair. (twinax) [1000baseCX, 1000CX]
1000BASE-T, 1Gb/s over category 5 unshielded twisted pair, 802.3ab, RJ45 connector. [1000baseT, 1000T]
1000BASE-KX, 1Gb/s backplane. [1000BASE-KX, 1000baseKX]
2500BASE-SX, 2.5Gb/s over multi-mode fiber optic cables. [2500baseSX, 2500SX]
2.5GBASE-T, 2.5Gb/s over category 5e. [2.5GBASE-T, 2500baseT]
2500BASE-KX, 2.5Gb/s backplane. [2500BASE-KX, 2500baseKX]
5GBASE-T, 5Gb/s over category 6. [5GBASE-T, 5GbaseT]
10GBASE-CX4, 10Gb/s over XAUI 4-lane PCS and copper cables. [10GbaseCX4, 10GCX4, 10GBASE-CX4]
10GBASE-LR, 10Gb/s over single-mode fiber optic cables. [10GbaseLR, 10GLR]
10GBASE-LR, 10Gb/s over single-mode fiber optic cables. [10GbaseLRM]
10GBASE-SR, 10Gb/s over multi-mode fiber optic cables. [10GbaseSR, 10GSR, 10GBASE-SR]
10GBASE-T, 10Gb/s over unshielded twisted pair, RJ45 connector. [10Gbase-T]
SFP+ direct attach, 10Gb/s over twinaxial cable. [10Gbase-Twinax]

The following media option is defined for Ethernet:

Configure a 1000BASE-T PHY as the clock master for a 1000BASE-T link. This option has no effect (shows current status only) if the media is IFM_AUTO.
Configure the device to send PAUSE (flow control) frames. This option has no effect (shows current status only) if the media is IFM_AUTO.
Configure the device to receive PAUSE (flow control) frames. This option has no effect (shows current status only) if the media is IFM_AUTO.

The following media types are defined for Token Ring:

4Mb/s, shielded twisted pair, DB9 connector. [DB9/4Mbit, 4STP]
16Mb/s, shielded twisted pair, DB9 connector. [DB9/16Mbit, 16STP]
4Mb/s, unshielded twisted pair, RJ45 connector. [UTP/4Mbit, 4UTP]
16Mb/s, unshielded twisted pair, RJ45 connector. [UTP/16Mbit, 16UTP]

The following media options are defined for Token Ring:

Early token release. [EarlyTokenRelease, ETR]
Enable source routing features. [SourceRouting, SRCRT]
All routes vs. single route broadcast. [AllRoutes, ALLR]

The following media types are defined for FDDI:

Single-mode fiber. [Single-mode, SMF]
Multi-mode fiber. [Multi-mode, MMF]
Unshielded twisted pair, RJ45 connector. [UTP, CDDI]

The following media options are defined for FDDI:

Dual-attached station vs. Single-attached station. [dual-attach, das]

The following media types are defined for IEEE802.11 Wireless LAN:

Frequency Hopping 1Mbps. [FH1]
Frequency Hopping 2Mbps. [FH2]
Direct Sequence 1Mbps. [DS1]
Direct Sequence 2Mbps. [DS2]
Direct Sequence 5Mbps. [DS5]
Direct Sequence 11Mbps. [DS11]
Direct Sequence 22Mbps. [DS22]
Orthogonal Frequency Division Multiplexing 6Mbps. [OFDM6]
Orthogonal Frequency Division Multiplexing 9Mbps. [OFDM9]
Orthogonal Frequency Division Multiplexing 12Mbps. [OFDM12]
Orthogonal Frequency Division Multiplexing 18Mbps. [OFDM18]
Orthogonal Frequency Division Multiplexing 24Mbps. [OFDM24]
Orthogonal Frequency Division Multiplexing 36Mbps. [OFDM36]
Orthogonal Frequency Division Multiplexing 48Mbps. [OFDM48]
Orthogonal Frequency Division Multiplexing 54Mbps. [OFDM54]
Orthogonal Frequency Division Multiplexing 72Mbps. [OFDM72]

The following media options are defined for IEEE802.11 Wireless LAN:

Ad-hoc (IBSS) mode. [adhoc, ibss]

In some drivers, it may be used with the IFM_FLAG0 [flag0] media option to specify non-standard ad-hoc demo mode.

Access Point mode [hostap]
Monitor mode [monitor]
Turbo mode [turbo]

netintro(4), ifconfig(8)

The ifmedia interface first appeared in BSD/OS 3.0. The implementation that appeared in NetBSD 1.3 was written by Jonathan Stone and Jason R. Thorpe to be compatible with the BSDI API. It has since gone through several revisions which have extended the API while maintaining backwards compatibility with the original API.

Support for the link type was added in NetBSD 1.5.

August 3, 2018 NetBSD-9.2