1.\" $OpenBSD: ifmedia.4,v 1.22 2016/01/12 09:28:09 stsp Exp $ 2.\" $NetBSD: ifmedia.4,v 1.14 2001/06/30 17:57:56 bjh21 Exp $ 3.\" 4.\" Copyright (c) 1998 The NetBSD Foundation, Inc. 5.\" All rights reserved. 6.\" 7.\" This code is derived from software contributed to The NetBSD Foundation 8.\" by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 9.\" NASA Ames Research Center. 10.\" 11.\" Redistribution and use in source and binary forms, with or without 12.\" modification, are permitted provided that the following conditions 13.\" are met: 14.\" 1. Redistributions of source code must retain the above copyright 15.\" notice, this list of conditions and the following disclaimer. 16.\" 2. Redistributions in binary form must reproduce the above copyright 17.\" notice, this list of conditions and the following disclaimer in the 18.\" documentation and/or other materials provided with the distribution. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30.\" POSSIBILITY OF SUCH DAMAGE. 31.\" 32.Dd $Mdocdate: January 12 2016 $ 33.Dt IFMEDIA 4 34.Os 35.Sh NAME 36.Nm ifmedia 37.Nd network interface media settings 38.Sh SYNOPSIS 39.In sys/socket.h 40.In net/if.h 41.In net/if_media.h 42.Sh DESCRIPTION 43The 44.Nm 45interface provides a consistent method for querying and setting 46network interface media and media options. 47The media is typically set using the 48.Xr ifconfig 8 49command. 50.Pp 51Currently these link types are supported by 52.Nm ifmedia : 53.Pp 54.Bl -tag -offset indent -width IFM_IEEE80211 -compact 55.It Dv IFM_ETHER 56Ethernet 57.It Dv IFM_FDDI 58FDDI 59.It Dv IFM_IEEE80211 60IEEE802.11 Wireless LAN 61.It Dv IFM_TDM 62Time Division Multiplex 63.It Dv IFM_CARP 64CARP 65.El 66.Pp 67The following sections describe the possible media settings for each 68link type. 69Not all of these are supported by every device; refer to 70your device's manual page for more information. 71.Pp 72The lists below provide the possible names of each media type or option. 73The first name in the list is the canonical name of the media type or 74option. 75Additional names are acceptable aliases for the media type or option. 76.Sh COMMON MEDIA TYPES AND OPTIONS 77The following media types are shared by all link types: 78.Pp 79.Bl -tag -offset indent -width IFM_MANUAL -compact 80.It Dv IFM_AUTO 81Autoselect the best media. 82[autoselect, auto] 83.It Dv IFM_MANUAL 84Jumper or switch on device selects media. 85[manual] 86.It Dv IFM_NONE 87Deselect all media. 88[none] 89.El 90.Pp 91The following media options are shared by all link types: 92.Bl -tag -offset indent -width IFM_FLAG0 93.It Dv IFM_FDX 94Place the device into full-duplex mode. 95This option only has meaning if the device is normally not full-duplex. 96.It Dv IFM_HDX 97Place the device into half-duplex mode. 98This option only has meaning if the device is normally not half-duplex. 99[half-duplex, hdx] 100.It Dv IFM_FLOW 101Enable hardware flow control on device. 102.It Dv IFM_FLAG0 103Driver-defined flag. 104[flag0] 105.It Dv IFM_FLAG1 106Driver-defined flag. 107[flag1] 108.It Dv IFM_FLAG2 109Driver-defined flag. 110[flag2] 111.It Dv IFM_LOOP 112Place the device into hardware loopback mode. 113[loopback, hw-loopback, loop] 114.El 115.Sh MEDIA TYPES AND OPTIONS FOR ETHERNET 116The following media types are defined for Ethernet: 117.Bl -tag -offset indent -width IFM_10G_SFP_CU 118.It Dv IFM_10_T 11910BASE-T, 10Mb/s over unshielded twisted pair, RJ45 connector. 120[10baseT, UTP, 10UTP] 121.It Dv IFM_10_2 12210BASE2, 10Mb/s over coaxial cable, BNC connector; also called Thinnet. 123[10base2, BNC, 10BNC] 124.It Dv IFM_10_5 12510BASE5, 10Mb/s over 15-wire cables, DB15 connector; also called AUI. 126[10base5, AUI, 10AUI] 127.It Dv IFM_10_STP 12810BASE-STP, 10Mb/s over shielded twisted pair, DB9 connector. 129[10baseSTP, STP, 10STP] 130.It Dv IFM_10_FL 13110BASE-FL, 10Mb/s over fiber optic cables. 132[10baseFL, FL, 10FL] 133.It Dv IFM_100_TX 134100BASE-TX, 100Mb/s over unshielded twisted pair, RJ45 connector. 135[100baseTX, 100TX] 136.It Dv IFM_100_FX 137100BASE-FX, 100Mb/s over fiber optic cables. 138[100baseFX, 100FX] 139.It Dv IFM_100_T4 140100BASE-T4, 100Mb/s over 4-wire (category 3) unshielded twisted pair, RJ45 141connector. 142[100baseT4, 100T4] 143.It Dv IFM_100_T2 144100BASE-T2. 145[100baseT2, 100T2] 146.It Dv IFM_100_VG 147100VG-AnyLAN. 148[100baseVG, 100VG] 149.It Dv IFM_1000_SX 1501000BASE-SX, 1Gb/s over multi-mode fiber optic cables. 151[1000baseSX, 1000SX] 152.It Dv IFM_1000_LX 1531000BASE-LX, 1Gb/s over single-mode fiber optic cables. 154[1000baseLX, 1000LX] 155.It Dv IFM_1000_CX 1561000BASE-CX, 1Gb/s over shielded twisted pair. 157[1000baseCX, 1000CX] 158.It Dv IFM_1000_T 1591000BASE-T, 1Gb/s over category 5 unshielded twisted pair, RJ45 connector. 160[1000baseT, 1000T] 161.It Dv IFM_1000_TX 162Compatibility for 1000BASE-T. 163[1000baseTX, 1000TX] 164.It Dv IFM_2500_SX 1652500BASE-SX, 2.5Gb/s over multi-mode fiber optic cables. 166[2500baseSX, 2500SX] 167.It Dv IFM_10G_CX4 16810GBASE-CX4, 10Gb/s over XAUI 4-lane PCS and copper cables. 169[10GbaseCX4, 10GCX4, 10GBASE-CX4] 170.It Dv IFM_10G_LR 17110GBASE-LR, 10Gb/s over single-mode fiber optic cables. 172[10GbaseLR, 10GLR, 10GBASE-LR] 173.It Dv IFM_10G_SFP_CU 17410GSFP+Cu, 10Gb/s over SFP+ Direct Attach cables. 175[10GSFP+Cu, 10GCu] 176.It Dv IFM_10G_SR 17710GBASE-SR, 10Gb/s over multi-mode fiber optic cables. 178[10GbaseSR, 10GSR, 10GBASE-SR] 179.It Dv IFM_10G_T 18010GBASE-T, 10Gb/s over unshielded twisted pair, RJ45 connector. 181[10GbaseT, 10GT, 10GBASE-T] 182.It Dv IFM_HPNA_1 183HomePNA 1.0, 1Mb/s over 2-wire (category 3) unshielded twisted pair 184[HomePNA1, HPNA1] 185.El 186.Pp 187The following media options are defined for Ethernet: 188.Bl -tag -offset indent -width IFM_ETH_RXPAUSE 189.It Dv IFM_ETH_MASTER 190Configure a 1000BASE-T PHY as a MASTER PHY. 191.It Dv IFM_ETH_RXPAUSE 192Receive flow control is enabled on the 1000BASE-T PHY. 193.It Dv IFM_ETH_TXPAUSE 194Transmit flow control is enabled on the 1000BASE-T PHY. 195.El 196.Sh MEDIA TYPES AND OPTIONS FOR FDDI 197The following media types are defined for FDDI: 198.Pp 199.Bl -tag -offset indent -width IFM_FDDI_SMF -compact 200.It Dv IFM_FDDI_SMF 201Single-mode fiber. 202[Single-mode, SMF] 203.It Dv IFM_FDDI_MMF 204Multi-mode fiber. 205[Multi-mode, MMF] 206.It Dv IFM_FDDI_UTP 207Unshielded twisted pair, RJ45 connector. 208[UTP, CDDI] 209.El 210.Pp 211The following media options are defined for FDDI: 212.Bl -tag -offset indent -width IFM_FDDI_DA 213.It Dv IFM_FDDI_DA 214Dual-attached station vs. Single-attached station. 215[dual-attach, das] 216.El 217.Sh MEDIA TYPES AND OPTIONS FOR IEEE802.11 WIRELESS LAN 218The following media types are defined for IEEE802.11 Wireless LAN: 219.Pp 220.Bl -tag -offset indent -width IFM_IEEE80211_OFDM22 -compact 221.It Dv IFM_IEEE80211_FH1 222Frequency Hopping 1Mbps. 223[FH1] 224.It Dv IFM_IEEE80211_FH2 225Frequency Hopping 2Mbps. 226[FH2] 227.It Dv IFM_IEEE80211_DS1 228Direct Sequence 1Mbps. 229[DS1] 230.It Dv IFM_IEEE80211_DS2 231Direct Sequence 2Mbps. 232[DS2] 233.It Dv IFM_IEEE80211_DS5 234Direct Sequence 5.5Mbps. 235[DS5] 236.It Dv IFM_IEEE80211_DS11 237Direct Sequence 11Mbps. 238[DS11] 239.It Dv IFM_IEEE80211_DS22 240Direct Sequence 22Mbps. 241[DS22] 242.It Dv IFM_IEEE80211_OFDM6 243Orthogonal Frequency Division Multiplexing (OFDM) 6Mbps. 244[OFDM6] 245.It Dv IFM_IEEE80211_OFDM9 246OFDM 9Mbps. 247[OFDM9] 248.It Dv IFM_IEEE80211_OFDM12 249OFDM 12Mbps. 250[OFDM12] 251.It Dv IFM_IEEE80211_OFDM18 252OFDM 18Mbps. 253[OFDM18] 254.It Dv IFM_IEEE80211_OFDM24 255OFDM 24Mbps. 256[OFDM24] 257.It Dv IFM_IEEE80211_OFDM36 258OFDM 36Mbps. 259[OFDM36] 260.It Dv IFM_IEEE80211_OFDM48 261OFDM 48Mbps. 262[OFDM48] 263.It Dv IFM_IEEE80211_OFDM54 264OFDM 54Mbps. 265[OFDM54] 266.It Dv IFM_IEEE80211_OFDM72 267OFDM 72Mbps. 268[OFDM72] 269.El 270.Pp 271The following media options are defined for IEEE802.11 Wireless LAN: 272.Pp 273.Bl -tag -offset indent -width IFM_IEEE80211_IBSSMASTER -compact 274.It Dv IFM_IEEE80211_ADHOC 275Ad-hoc mode. 276[adhoc] 277.It Dv IFM_IEEE80211_HOSTAP 278Host Access Point mode. 279[hostap] 280.It Dv IFM_IEEE80211_IBSS 281IBSS mode. 282[ibss] 283.It Dv IFM_IEEE80211_IBSSMASTER 284IBSS master mode. 285[ibssmaster] 286.It Dv IFM_IEEE80211_MONITOR 287Monitor mode. 288[monitor] 289.El 290.Pp 291The following media modes are defined for IEEE802.11 Wireless LAN: 292.Pp 293.Bl -tag -offset indent -width IFM_IEEE80211_11A -compact 294.It Dv IFM_IEEE80211_11A 2955Ghz, OFDM mode. 296[11a] 297.It Dv IFM_IEEE80211_11B 2982GHz, Direct Sequence mode. 299[11b] 300.It Dv IFM_IEEE80211_11G 3012GHz, CCK mode. 302[11g] 303.It Dv IFM_IEEE80211_FH 3042GHz, GFSK mode. 305[fh] 306.El 307.Pp 308The channels detailed below are defined for IEEE802.11 Wireless LAN. 309The list of available frequencies is dependent on radio regulations 310specified by regional authorities. 311Recognized regulatory authorities include 312the FCC (United States), ETSI (Europe), France, and Japan. 313Frequencies in the table are specified in MHz. 314.Bl -column "Channel " "2412" "ETSI" "France" "Japan" -offset indent 315.It Em Channel Ta Em FCC Ta Em ETSI Ta Em France Ta Em Japan 316.It 1 Ta 2412 Ta 2412 Ta - Ta 2412 317.It 2 Ta 2417 Ta 2417 Ta - Ta 2417 318.It 3 Ta 2422 Ta 2422 Ta - Ta 2422 319.It 4 Ta 2427 Ta 2427 Ta - Ta 2427 320.It 5 Ta 2432 Ta 2432 Ta - Ta 2432 321.It 6 Ta 2437 Ta 2437 Ta - Ta 2437 322.It 7 Ta 2442 Ta 2442 Ta - Ta 2442 323.It 8 Ta 2447 Ta 2447 Ta - Ta 2447 324.It 9 Ta 2452 Ta 2452 Ta - Ta 2452 325.It 10 Ta 2457 Ta 2457 Ta 2457 Ta 2457 326.It 11 Ta 2462 Ta 2462 Ta 2462 Ta 2462 327.It 12 Ta - Ta 2467 Ta 2467 Ta 2467 328.It 13 Ta - Ta 2472 Ta 2472 Ta 2472 329.It 14 Ta - Ta - Ta - Ta 2484 330.El 331.Pp 332Note that the channels do overlap; the bandwidth required for 333each channel is about 20MHz. 334When using multiple channels in close proximity it is suggested 335that channels be separated by at least 25MHz. 336In the US, this means that only channels 1, 6, and 11 may be used 337simultaneously without interference. 338.Sh MEDIA TYPES AND OPTIONS FOR TDM 339The following media types are defined for TDM: 340.Bl -tag -offset indent -width IFM_TDM_E1_G704_CRC4 341.It Dv IFM_TDM_E1 342E1, 2048kb/s HDB3 encoded, G.703 clearchannel serial line. 343[e1] 344.It Dv IFM_TDM_E1_AMI 345E1, 2048kb/s AMI encoded, G.703 clearchannel serial line. 346[e1-ami] 347.It Dv IFM_TDM_E1_AMI_G704 348E1, 2048kb/s AMI encoded, G.704 structured serial line. 349[e1-ami-g.704] 350.It Dv IFM_TDM_E1_G704 351E1, 2048kb/s HDB3 encoded, G.704 structured serial line. 352[e1-g.704] 353.It Dv IFM_TDM_E1_G704_CRC4 354E1, 2048kb/s HDB3 encoded, G.704 structured serial line with CRC4 checksum. 355[e1-g.704-crc4] 356.It Dv IFM_TDM_E3 357E3, 34368kb/s HDB3 encoded, G.703 clearchannel serial line. 358[e3] 359.It Dv IFM_TDM_E3_G751 360E3, 34368kb/s HDB3 encoded, G.751 structured serial line. 361[e3-g.751] 362.It Dv IFM_TDM_E3_G832 363E3, 34368kb/s HDB3 encoded, G.832 structured serial line. 364[e3-g.832] 365.It Dv IFM_TDM_T1 366T1, 1536xkb/s B8ZS encoded, extended super frame (ESF) structured serial line. 367[t1] 368.It Dv IFM_TDM_T1_AMI 369T1, 1536kb/s AMI encoded, super frame (SF) structured serial line. 370[t1-ami] 371.It Dv IFM_TDM_T3 372T3, 44736kb/s B3ZS, C-bit structured serial line. 373[t3] 374.It Dv IFM_TDM_T3_M13 375T3, 44736kb/s B3ZS, M13 structured serial line. 376[t3-m13] 377.El 378.Pp 379The following media options are defined for TDM: 380.Bl -tag -offset indent -width IFM_TDM_HDLC_CRC16 381.It Dv IFM_TDM_HDLC_CRC16 382Cisco HDLC with 16-bit CRC checksum encoding. 383[hdlc-crc16] 384.It Dv IFM_TDM_FR_ANSI 385ANSI/ITU Framerelay encoding. 386[framerelay-ansi, framerelay-itu] 387.It Dv IFM_TDM_FR_CISCO 388Cisco Framerelay encoding. 389[framerelay-cisco] 390.It Dv IFM_TDM_PPP 391PPP encoding. 392[ppp] 393.El 394.Pp 395By default TDM interfaces will use Cisco HDLC encoding with a 32-bit CRC 396checksum. 397.Pp 398The following media modes are defined for TDM: 399.Bl -tag -offset indent -width IFM_TDM_MASTER 400.It Dv IFM_TDM_MASTER 401Use local clock source as master clock. 402[master] 403.El 404.Sh MEDIA TYPES AND OPTIONS FOR CARP 405.Xr carp 4 406does not support any media types or options. 407.Sh SEE ALSO 408.Xr netintro 4 , 409.Xr ifconfig 8 410.Sh HISTORY 411The 412.Nm 413interface first appeared in 414.Bsx 3.0 . 415The implementation that appeared in 416.Nx 1.3 417was written by Jonathan Stone and Jason R. Thorpe to be compatible with 418the BSDI API. 419It has since gone through several revisions which have extended the 420API while maintaining backwards compatibility with the original API. 421.Pp 422Support for the 423.Sy IEEE802.11 Wireless LAN 424link type was added in 425.Nx 1.5 . 426.Pp 427.Sy Host AP 428mode was added in 429.Ox 3.1 . 430