---
name: "ifmedia"
section: "4"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/ifmedia"
---

# ifmedia(4)

network interface media settings

## NAME

**ifmedia** – network interface media settings

## SYNOPSIS

**#include \<sys/socket.h\>**

**#include \<net/if.h\>**

**#include \<net/if\_media.h\>**

## DESCRIPTION

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)](/ifconfig/8.md) command.

Currently these link types are supported by **ifmedia**:

- IFM\_ETHER

  Ethernet

- IFM\_FDDI

  FDDI

- IFM\_IEEE80211

  IEEE802.11 Wireless LAN

- IFM\_TDM

  Time Division Multiplex

- IFM\_CARP

  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.

## COMMON MEDIA TYPES AND OPTIONS

The following media types are shared by all link types:

- IFM\_AUTO

  Autoselect the best media. \[autoselect, auto\]

- IFM\_MANUAL

  Jumper or switch on device selects media. \[manual\]

- IFM\_NONE

  Deselect all media. \[none\]

The following media options are shared by all link types:

- IFM\_FDX

  Place the device into full-duplex mode. This option only has meaning if the device is normally not full-duplex.

- IFM\_HDX

  Place the device into half-duplex mode. This option only has meaning if the device is normally not half-duplex. \[half-duplex, hdx\]

- IFM\_FLOW

  Enable hardware flow control on device.

- IFM\_FLAG0

  Driver-defined flag. \[flag0\]

- IFM\_FLAG1

  Driver-defined flag. \[flag1\]

- IFM\_FLAG2

  Driver-defined flag. \[flag2\]

- IFM\_LOOP

  Place the device into hardware loopback mode. \[loopback, hw-loopback, loop\]

## MEDIA TYPES AND OPTIONS FOR ETHERNET

The following media types are defined for Ethernet:

- IFM\_10\_T

  10BASE-T, 10Mb/s over unshielded twisted pair, RJ45 connector. \[10baseT, UTP, 10UTP\]

- IFM\_10\_2

  10BASE2, 10Mb/s over coaxial cable, BNC connector; also called Thinnet. \[10base2, BNC, 10BNC\]

- IFM\_10\_5

  10BASE5, 10Mb/s over 15-wire cables, DB15 connector; also called AUI. \[10base5, AUI, 10AUI\]

- IFM\_10\_STP

  10BASE-STP, 10Mb/s over shielded twisted pair, DB9 connector. \[10baseSTP, STP, 10STP\]

- IFM\_10\_FL

  10BASE-FL, 10Mb/s over fiber optic cables. \[10baseFL, FL, 10FL\]

- IFM\_100\_TX

  100BASE-TX, 100Mb/s over unshielded twisted pair, RJ45 connector. \[100baseTX, 100TX\]

- IFM\_100\_FX

  100BASE-FX, 100Mb/s over fiber optic cables. \[100baseFX, 100FX\]

- IFM\_100\_T4

  100BASE-T4, 100Mb/s over 4-wire (category 3) unshielded twisted pair, RJ45 connector. \[100baseT4, 100T4\]

- IFM\_100\_T2

  100BASE-T2. \[100baseT2, 100T2\]

- IFM\_100\_VG

  100VG-AnyLAN. \[100baseVG, 100VG\]

- IFM\_1000\_SX

  1000BASE-SX, 1Gb/s over multi-mode fiber optic cables. \[1000baseSX, 1000SX\]

- IFM\_1000\_LX

  1000BASE-LX, 1Gb/s over single-mode fiber optic cables. \[1000baseLX, 1000LX\]

- IFM\_1000\_CX

  1000BASE-CX, 1Gb/s over shielded twisted pair. \[1000baseCX, 1000CX\]

- IFM\_1000\_T

  1000BASE-T, 1Gb/s over category 5 unshielded twisted pair, RJ45 connector. \[1000baseT, 1000T\]

- IFM\_1000\_TX

  Compatibility for 1000BASE-T. \[1000baseTX, 1000TX\]

- IFM\_2500\_SX

  2500BASE-SX, 2.5Gb/s over multi-mode fiber optic cables. \[2500baseSX, 2500SX\]

- IFM\_2500\_T

  2500BASE-T, 2.5Gb/s over unshielded twisted pair, RJ45 connector. \[2500baseT, 2500BASE-T\]

- IFM\_10G\_CX4

  10GBASE-CX4, 10Gb/s over XAUI 4-lane PCS and copper cables. \[10GbaseCX4, 10GCX4, 10GBASE-CX4\]

- IFM\_10G\_LR

  10GBASE-LR, 10Gb/s over single-mode fiber optic cables. \[10GbaseLR, 10GLR, 10GBASE-LR\]

- IFM\_10G\_SFP\_CU

  10GSFP+Cu, 10Gb/s over SFP+ Direct Attach cables. \[10GSFP+Cu, 10GCu\]

- IFM\_10G\_SR

  10GBASE-SR, 10Gb/s over multi-mode fiber optic cables. \[10GbaseSR, 10GSR, 10GBASE-SR\]

- IFM\_10G\_T

  10GBASE-T, 10Gb/s over unshielded twisted pair, RJ45 connector. \[10GbaseT, 10GT, 10GBASE-T\]

- IFM\_HPNA\_1

  HomePNA 1.0, 1Mb/s over 2-wire (category 3) unshielded twisted pair \[HomePNA1, HPNA1\]

The following media options are defined for Ethernet:

- IFM\_ETH\_MASTER

  Configure a 1000BASE-T PHY as a MASTER PHY.

- IFM\_ETH\_RXPAUSE

  Receive flow control is enabled on the 1000BASE-T PHY.

- IFM\_ETH\_TXPAUSE

  Transmit flow control is enabled on the 1000BASE-T PHY.

## MEDIA TYPES AND OPTIONS FOR FDDI

The following media types are defined for FDDI:

- IFM\_FDDI\_SMF

  Single-mode fiber. \[Single-mode, SMF\]

- IFM\_FDDI\_MMF

  Multi-mode fiber. \[Multi-mode, MMF\]

- IFM\_FDDI\_UTP

  Unshielded twisted pair, RJ45 connector. \[UTP, CDDI\]

The following media options are defined for FDDI:

- IFM\_FDDI\_DA

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

## MEDIA TYPES AND OPTIONS FOR IEEE802.11 WIRELESS LAN

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

- IFM\_IEEE80211\_11A

  5GHz, OFDM mode. \[11a\]

- IFM\_IEEE80211\_11B

  2GHz, DSSS/CCK mode. \[11b\]

- IFM\_IEEE80211\_11G

  2GHz, DSSS/CCK/OFDM mode. \[11g\]

- IFM\_IEEE80211\_FH

  2GHz, GFSK mode. \[fh\]

- IFM\_IEEE80211\_11N

  2GHz/5GHz, HT mode. \[11n\]

- IFM\_IEEE80211\_11AC

  5GHz, VHT mode. \[11ac\]

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

- IFM\_IEEE80211\_ADHOC

  Ad-hoc mode. \[adhoc\]

- IFM\_IEEE80211\_HOSTAP

  Host Access Point mode. \[hostap\]

- IFM\_IEEE80211\_IBSS

  IBSS mode. \[ibss\]

- IFM\_IEEE80211\_IBSSMASTER

  IBSS master mode. \[ibssmaster\]

- IFM\_IEEE80211\_MONITOR

  Monitor mode. \[monitor\]

All of the above media options are mutually exclusive. If no media option is used, the wireless interface will try to find an access point to connect to. **hostap** mode allows the wireless interface to act as an access point for other 802.11 devices. **ibss** mode is the standardized method of operating without an access point, with each participating device taking on part of the role of an access point. **adhoc** mode, more accurately known as *ad-hoc* *demo* *mode*, is not specified by the IEEE 802.11 standard and only works with [wi(4)](/wi/4.md) devices. Likewise, **ibssmaster** mode only works with [wi(4)](/wi/4.md) devices. On standard 802.11 networks the IBSS master role is assigned automatically.

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

| | | | |
| --- | --- | --- | --- |
| *Channel* | *FCC* | *ETSI* | *Japan* |
| 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 |
| 11 | 2462 | 2462 | 2462 |
| 12 | - | 2467 | 2467 |
| 13 | - | 2472 | 2472 |
| 14 | - | - | 2484 |

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.

Channels in the 5GHz band are too numerous to list here. Regulation of their use, particularly outdoors, varies between countries. Users are advised to inform themselves about applicable regulations before configuring wireless LAN devices for use in the 5GHz band.

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

- IFM\_IEEE80211\_FH1

  Frequency Hopping 1Mbps. \[FH1\]

- IFM\_IEEE80211\_FH2

  Frequency Hopping 2Mbps. \[FH2\]

- IFM\_IEEE80211\_DS1

  Direct Sequence 1Mbps. \[DS1\]

- IFM\_IEEE80211\_DS2

  Direct Sequence 2Mbps. \[DS2\]

The above media types were first introduced in the IEEE 802.11-1997 standard and are used in the 2.4GHz band only. Frequency Hopping Spread Spectrum modulation is incompatible with modern 802.11 networks. Direct Sequence Spread Spectrum modulation (DSSS) frames can still be used if backwards compatibility to 802.11b is enabled.

- IFM\_IEEE80211\_DS5

  Direct Sequence 5.5Mbps. \[DS5\]

- IFM\_IEEE80211\_DS11

  Direct Sequence 11Mbps. \[DS11\]

- IFM\_IEEE80211\_DS22

  Direct Sequence 22Mbps. \[DS22\]

The above media types were first introduced in the IEEE 802.11b-1999 standard and are used in the 2.4GHz band only. They use Complementary Code Keying (CCK) which, compared to frames sent at 1Mbps or 2Mbps, reduces the possible distance between transmitter and receiver.

Modern 802.11 networks remain compatible with 802.11b, even though DSSS frames are incompatible with modern 802.11 frames using OFDM. Co-existence with 802.11b requires OFDM transmitters to either risk frame collisions or “reserve” the medium with a separate preceding transmission that DSSS receivers are able to decode. This causes additional overhead which some 802.11 deployments avoid by deliberately disabling backwards compatibility with 802.11b.

- IFM\_IEEE80211\_OFDM6

  OFDM 6Mbps. \[OFDM6\]

- IFM\_IEEE80211\_OFDM9

  OFDM 9Mbps. \[OFDM9\]

- IFM\_IEEE80211\_OFDM12

  OFDM 12Mbps. \[OFDM12\]

- IFM\_IEEE80211\_OFDM18

  OFDM 18Mbps. \[OFDM18\]

- IFM\_IEEE80211\_OFDM24

  OFDM 24Mbps. \[OFDM24\]

- IFM\_IEEE80211\_OFDM36

  OFDM 36Mbps. \[OFDM36\]

- IFM\_IEEE80211\_OFDM48

  OFDM 48Mbps. \[OFDM48\]

- IFM\_IEEE80211\_OFDM54

  OFDM 54Mbps. \[OFDM54\]

- IFM\_IEEE80211\_OFDM72

  OFDM 72Mbps. \[OFDM72\]

The above media types were first introduced in the IEEE 802.11a-1999 standard for the 5GHz band, and in the IEEE 802.11g-2003 standard for the 2.4GHz band. OFDM with 72Mbps is a proprietary extension and was never standardized by IEEE.

Orthogonal Frequency Division Multiplexing (OFDM) is the current standard modulation technique for 802.11. Each 20MHz channel used by 802.11a and 802.11g provides space for 48 OFDM sub-carriers for data. The sub-carriers use BPSK, QPSK, 16QAM, or 64QAM modulation, combined with a particular coding rate for error correction at the receiver. The coding rate specifies how many data bits in a frame are transmitted without redundancy.

| | | |
| --- | --- | --- |
| *Modulation* | *Coding* *Rate* | *Mbit/s* |
| BPSK | 1/2 | 6 |
| BPSK | 3/4 | 9 |
| QPSK | 1/2 | 12 |
| QPSK | 3/4 | 18 |
| 16QAM | 1/2 | 24 |
| 16QAM | 3/4 | 36 |
| 64QAM | 1/2 | 48 |
| 64QAM | 3/4 | 52 |

The IEEE 802.11n-2009 standard for “High Throughput” (HT) wireless LAN defines additional sub-carriers, modulations, and coding rates. The channel bandwidth for data frame transmissions was optionally extended to 40MHz, with full backwards compatibility to 802.11a/b/g devices which cannot decode 40MHz transmissions. Several additional features were introduced, most notably MIMO (multiple-input, multiple-output). With MIMO, a data stream is divided across up to 4 “spatial streams”, which are transmitted in parallel by a corresponding amount of antennas. Each spatial stream is received with a dedicated antenna, and the spatial streams are de-multiplexed to obtain the original data stream.

802\.11n assigns a numeric identifier to all possible combinations of modulation, coding rate, and number of spatial streams. This results in 77 distinct modulation and coding schemes, abbreviated as “MCS”.

**ifmedia** supports HT\_MCS0 up to HT\_MCS31:

- IFM\_IEEE80211\_HT\_MCSx

  HT OFDM MCS x (where x is in the range 0 - 31, inclusive). \[HT-MCSx\]

In practice, only MCS-0 to MCS-32 are supported by commonly available devices. The remaining MCS define combinations where distinct spatial streams employ distinct modulations, a feature which was not widely implemented by hardware vendors.

The IEEE 802.11ac-2013 standard for “Very High Throughput” (VHT) wireless LAN operates in the 5GHz band only. The channel bandwidth for data frame transmissions can be up to 160MHz wide. The MCS identifiers were redefined and vastly reduced in number. As a result, only VHT\_MCS0 to VHT\_MCS9 are defined for 802.11ac:

- IFM\_IEEE80211\_VHT\_MCSx

  VHT OFDM MCS x (where x is in the range 0 - 9, inclusive). \[VHT-MCSx\]

The number of spatial streams is no longer associated with a given VHT MCS identifier and must be specified as a separate “NSS” parameter. This parameter is not yet implemented by **ifmedia**.

## MEDIA TYPES AND OPTIONS FOR TDM

The following media types are defined for TDM:

- IFM\_TDM\_E1

  E1, 2048kb/s HDB3 encoded, G.703 clearchannel serial line. \[e1\]

- IFM\_TDM\_E1\_AMI

  E1, 2048kb/s AMI encoded, G.703 clearchannel serial line. \[e1-ami\]

- IFM\_TDM\_E1\_AMI\_G704

  E1, 2048kb/s AMI encoded, G.704 structured serial line. \[e1-ami-g.704\]

- IFM\_TDM\_E1\_G704

  E1, 2048kb/s HDB3 encoded, G.704 structured serial line. \[e1-g.704\]

- IFM\_TDM\_E1\_G704\_CRC4

  E1, 2048kb/s HDB3 encoded, G.704 structured serial line with CRC4 checksum. \[e1-g.704-crc4\]

- IFM\_TDM\_E3

  E3, 34368kb/s HDB3 encoded, G.703 clearchannel serial line. \[e3\]

- IFM\_TDM\_E3\_G751

  E3, 34368kb/s HDB3 encoded, G.751 structured serial line. \[e3-g.751\]

- IFM\_TDM\_E3\_G832

  E3, 34368kb/s HDB3 encoded, G.832 structured serial line. \[e3-g.832\]

- IFM\_TDM\_T1

  T1, 1536xkb/s B8ZS encoded, extended super frame (ESF) structured serial line. \[t1\]

- IFM\_TDM\_T1\_AMI

  T1, 1536kb/s AMI encoded, super frame (SF) structured serial line. \[t1-ami\]

- IFM\_TDM\_T3

  T3, 44736kb/s B3ZS, C-bit structured serial line. \[t3\]

- IFM\_TDM\_T3\_M13

  T3, 44736kb/s B3ZS, M13 structured serial line. \[t3-m13\]

The following media options are defined for TDM:

- IFM\_TDM\_HDLC\_CRC16

  Cisco HDLC with 16-bit CRC checksum encoding. \[hdlc-crc16\]

- IFM\_TDM\_FR\_ANSI

  ANSI/ITU Framerelay encoding. \[framerelay-ansi, framerelay-itu\]

- IFM\_TDM\_FR\_CISCO

  Cisco Framerelay encoding. \[framerelay-cisco\]

- IFM\_TDM\_PPP

  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:

- IFM\_TDM\_MASTER

  Use local clock source as master clock. \[master\]

## MEDIA TYPES AND OPTIONS FOR CARP

[carp(4)](/carp/4.md) does not support any media types or options.

## SEE ALSO

[netintro(4)](/netintro/4.md), [ifconfig(8)](/ifconfig/8.md)

## HISTORY

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 **IEEE802.11** **Wireless** **LAN** link type was added in NetBSD 1.5.

**Host** **AP** mode was added in OpenBSD 3.1.
