OpenBSD 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.

Currently these link types are supported by ifmedia:

Ethernet
FDDI
IEEE802.11 Wireless LAN
Time Division Multiplex
CARP

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.
Place the device into half-duplex mode. This option only has meaning if the device is normally not half-duplex. [half-duplex, hdx]
Enable hardware flow control on device.
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:

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. [1000baseSX, 1000SX]
1000BASE-LX, 1Gb/s over single-mode fiber optic cables. [1000baseLX, 1000LX]
1000BASE-CX, 1Gb/s over shielded twisted pair. [1000baseCX, 1000CX]
1000BASE-T, 1Gb/s over category 5 unshielded twisted pair, RJ45 connector. [1000baseT, 1000T]
Compatibility for 1000BASE-T. [1000baseTX, 1000TX]
2500BASE-SX, 2.5Gb/s over multi-mode fiber optic cables. [2500baseSX, 2500SX]
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]
10GSFP+Cu, 10Gb/s over SFP+ Direct Attach cables. [10GSFP+Cu, 10GCu]
10GBASE-SR, 10Gb/s over multi-mode fiber optic cables. [10GbaseSR, 10GSR, 10GBASE-SR]
10GBASE-T, 10Gb/s over unshielded twisted pair, RJ45 connector. [10GbaseT, 10GT, 10GBASE-T]
HomePNA 1.0, 1Mb/s over 2-wire (category 3) unshielded twisted pair [HomePNA1, HPNA1]

The following media options are defined for Ethernet:

Configure a 1000BASE-T PHY as a MASTER PHY.
Receive flow control is enabled on the 1000BASE-T PHY.
Transmit flow control is enabled on the 1000BASE-T PHY.

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 5.5Mbps. [DS5]
Direct Sequence 11Mbps. [DS11]
Direct Sequence 22Mbps. [DS22]
Orthogonal Frequency Division Multiplexing (OFDM) 6Mbps. [OFDM6]
OFDM 9Mbps. [OFDM9]
OFDM 12Mbps. [OFDM12]
OFDM 18Mbps. [OFDM18]
OFDM 24Mbps. [OFDM24]
OFDM 36Mbps. [OFDM36]
OFDM 48Mbps. [OFDM48]
OFDM 54Mbps. [OFDM54]
OFDM 72Mbps. [OFDM72]

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

Ad-hoc mode. [adhoc]
Host Access Point mode. [hostap]
IBSS mode. [ibss]
IBSS master mode. [ibssmaster]
Monitor mode. [monitor]
Turbo mode. [turbo]

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

5Ghz, OFDM mode. [11a]
2GHz, Direct Sequence mode. [11b]
2GHz, CCK mode. [11g]
2GHz, GFSK mode. [fh]

The channels detailed below are defined for IEEE802.11 Wireless LAN. The list of available frequencies is dependent on radio regulations specified by regional authorities. Recognized regulatory authorities include the FCC (United States), ETSI (Europe), France, and Japan. Frequencies in the table are specified in MHz.

1 2412 2412 - 2412
2 2417 2417 - 2417
3 2422 2422 - 2422
4 2427 2427 - 2427
5 2432 2432 - 2432
6 2437 2437 - 2437
7 2442 2442 - 2442
8 2447 2447 - 2447
9 2452 2452 - 2452
10 2457 2457 2457 2457
11 2462 2462 2462 2462
12 - 2467 2467 2467
13 - 2472 2472 2472
14 - - - 2484

Note that the channels do overlap; the bandwidth required for each channel is about 20MHz. When using multiple channels in close proximity it is suggested that channels be separated by at least 25MHz. In the US, this means that only channels 1, 6, and 11 may be used simultaneously without interference.

The following media types are defined for TDM:

E1, 2048kb/s HDB3 encoded, G.703 clearchannel serial line. [e1]
E1, 2048kb/s AMI encoded, G.703 clearchannel serial line. [e1-ami]
E1, 2048kb/s AMI encoded, G.704 structured serial line. [e1-ami-g.704]
E1, 2048kb/s HDB3 encoded, G.704 structured serial line. [e1-g.704]
E1, 2048kb/s HDB3 encoded, G.704 structured serial line with CRC4 checksum. [e1-g.704-crc4]
E3, 34368kb/s HDB3 encoded, G.703 clearchannel serial line. [e3]
E3, 34368kb/s HDB3 encoded, G.751 structured serial line. [e3-g.751]
E3, 34368kb/s HDB3 encoded, G.832 structured serial line. [e3-g.832]
T1, 1536xkb/s B8ZS encoded, extended super frame (ESF) structured serial line. [t1]
T1, 1536kb/s AMI encoded, super frame (SF) structured serial line. [t1-ami]
T3, 44736kb/s B3ZS, C-bit structured serial line. [t3]
T3, 44736kb/s B3ZS, M13 structured serial line. [t3-m13]

The following media options are defined for TDM:

Cisco HDLC with 16-bit CRC checksum encoding. [hdlc-crc16]
ANSI/ITU Framerelay encoding. [framerelay-ansi, framerelay-itu]
Cisco Framerelay encoding. [framerelay-cisco]
PPP encoding. [ppp]

By default TDM interfaces will use Cisco HDLC encoding with a 32-bit CRC checksum.

The following media modes are defined for TDM:

Use local clock source as master clock. [master]

carp(4) does not support any media types or options.

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.

mode was added in OpenBSD 3.1.

September 3, 2011 OpenBSD-5.6