1.\" $OpenBSD: ifmedia.4,v 1.17 2008/06/26 05:42:06 ray 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: June 26 2008 $ 33.Dt IFMEDIA 4 34.Os 35.Sh NAME 36.Nm ifmedia 37.Nd network interface media settings 38.Sh SYNOPSIS 39.Fd #include <sys/socket.h> 40.Fd #include <net/if.h> 41.Fd #include <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 51There are currently three link types 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.El 62.Pp 63The following sections describe the possible media settings for each 64link type. 65Not all of these are supported by every device; refer to 66your device's manual page for more information. 67.Pp 68The lists below provide the possible names of each media type or option. 69The first name in the list is the canonical name of the media type or 70option. 71Additional names are acceptable aliases for the media type or option. 72.Sh COMMON MEDIA TYPES AND OPTIONS 73The following media types are shared by all link types: 74.Pp 75.Bl -tag -offset indent -width IFM_MANUAL -compact 76.It Dv IFM_AUTO 77Autoselect the best media. 78[autoselect, auto] 79.It Dv IFM_MANUAL 80Jumper or switch on device selects media. 81[manual] 82.It Dv IFM_NONE 83Deselect all media. 84[none] 85.El 86.Pp 87The following media options are shared by all link types: 88.Bl -tag -offset indent -width IFM_FLAG0 89.It Dv IFM_FDX 90Place the device into full-duplex mode. 91This option only has meaning if the device is normally not full-duplex. 92.It Dv IFM_HDX 93Place the device into half-duplex mode. 94This option only has meaning if the device is normally not half-duplex. 95[half-duplex, hdx] 96.It Dv IFM_FLAG0 97Driver-defined flag. 98[flag0] 99.It Dv IFM_FLAG1 100Driver-defined flag. 101[flag1] 102.It Dv IFM_FLAG2 103Driver-defined flag. 104[flag2] 105.It Dv IFM_LOOP 106Place the device into hardware loopback mode. 107[loopback, hw-loopback, loop] 108.El 109.Sh MEDIA TYPES AND OPTIONS FOR ETHERNET 110The following media types are defined for Ethernet: 111.Bl -tag -offset indent -width IFM_1000_FX 112.It Dv IFM_10_T 11310BASE-T, 10Mb/s over unshielded twisted pair, RJ45 connector. 114[10baseT, UTP, 10UTP] 115.It Dv IFM_10_2 11610BASE2, 10Mb/s over coaxial cable, BNC connector; also called Thinnet. 117[10base2, BNC, 10BNC] 118.It Dv IFM_10_5 11910BASE5, 10Mb/s over 15-wire cables, DB15 connector; also called AUI. 120[10base5, AUI, 10AUI] 121.It Dv IFM_10_STP 12210BASE-STP, 10Mb/s over shielded twisted pair, DB9 connector. 123[10baseSTP, STP, 10STP] 124.It Dv IFM_10_FL 12510BASE-FL, 10Mb/s over fiber optic cables. 126[10baseFL, FL, 10FL] 127.It Dv IFM_100_TX 128100BASE-TX, 100Mb/s over unshielded twisted pair, RJ45 connector. 129[100baseTX, 100TX] 130.It Dv IFM_100_FX 131100BASE-FX, 100Mb/s over fiber optic cables. 132[100baseFX, 100FX] 133.It Dv IFM_100_T4 134100BASE-T4, 100Mb/s over 4-wire (category 3) unshielded twisted pair, RJ45 135connector. 136[100baseT4, 100T4] 137.It Dv IFM_100_T2 138100BASE-T2. 139[100baseT2, 100T2] 140.It Dv IFM_100_VG 141100VG-AnyLAN. 142[100baseVG, 100VG] 143.It Dv IFM_1000_SX 1441000BASE-SX, 1Gb/s over multi-mode fiber optic cables. 145[1000baseSX, 1000SX] 146.It Dv IFM_1000_LX 1471000BASE-LX, 1Gb/s over single-mode fiber optic cables. 148[1000baseLX, 1000LX] 149.It Dv IFM_1000_CX 1501000BASE-CX, 1Gb/s over shielded twisted pair. 151[1000baseCX, 1000CX] 152.It Dv IFM_1000_T 1531000BASE-T, 1Gb/s over category 5 unshielded twisted pair, RJ45 connector. 154[1000baseT, 1000T] 155.El 156.Pp 157The following media option is defined for Ethernet: 158.Bl -tag -offset indent -width IFM_ETH_MASTER 159.It Dv IFM_ETH_MASTER 160Configure a 1000BASE-T PHY as a MASTER PHY. 161.El 162.Sh MEDIA TYPES AND OPTIONS FOR FDDI 163The following media types are defined for FDDI: 164.Pp 165.Bl -tag -offset indent -width IFM_FDDI_SMF -compact 166.It Dv IFM_FDDI_SMF 167Single-mode fiber. 168[Single-mode, SMF] 169.It Dv IFM_FDDI_MMF 170Multi-mode fiber. 171[Multi-mode, MMF] 172.It Dv IFM_FDDI_UTP 173Unshielded twisted pair, RJ45 connector. 174[UTP, CDDI] 175.El 176.Pp 177The following media options are defined for FDDI: 178.Bl -tag -offset indent -width IFM_FDDI_DA 179.It Dv IFM_FDDI_DA 180Dual-attached station vs. Single-attached station. 181[dual-attach, das] 182.El 183.Sh MEDIA TYPES AND OPTIONS FOR IEEE802.11 WIRELESS LAN 184The following media types are defined for IEEE802.11 Wireless LAN: 185.Pp 186.Bl -tag -offset indent -width IFM_IEEE80211_OFDM22 -compact 187.It Dv IFM_IEEE80211_FH1 188Frequency Hopping 1Mbps. 189[FH1] 190.It Dv IFM_IEEE80211_FH2 191Frequency Hopping 2Mbps. 192[FH2] 193.It Dv IFM_IEEE80211_DS1 194Direct Sequence 1Mbps. 195[DS1] 196.It Dv IFM_IEEE80211_DS2 197Direct Sequence 2Mbps. 198[DS2] 199.It Dv IFM_IEEE80211_DS5 200Direct Sequence 5.5Mbps. 201[DS5] 202.It Dv IFM_IEEE80211_DS11 203Direct Sequence 11Mbps. 204[DS11] 205.It Dv IFM_IEEE80211_DS22 206Direct Sequence 22Mbps. 207[DS22] 208.It Dv IFM_IEEE80211_OFDM6 209Orthogonal Frequency Division Multiplexing (OFDM) 6Mbps. 210[OFDM6] 211.It Dv IFM_IEEE80211_OFDM9 212OFDM 9Mbps. 213[OFDM9] 214.It Dv IFM_IEEE80211_OFDM12 215OFDM 12Mbps. 216[OFDM12] 217.It Dv IFM_IEEE80211_OFDM18 218OFDM 18Mbps. 219[OFDM18] 220.It Dv IFM_IEEE80211_OFDM24 221OFDM 24Mbps. 222[OFDM24] 223.It Dv IFM_IEEE80211_OFDM36 224OFDM 36Mbps. 225[OFDM36] 226.It Dv IFM_IEEE80211_OFDM48 227OFDM 48Mbps. 228[OFDM48] 229.It Dv IFM_IEEE80211_OFDM54 230OFDM 54Mbps. 231[OFDM54] 232.It Dv IFM_IEEE80211_OFDM72 233OFDM 72Mbps. 234[OFDM72] 235.El 236.Pp 237The following media options are defined for IEEE802.11 Wireless LAN: 238.Pp 239.Bl -tag -offset indent -width IFM_IEEE80211_IBSSMASTER -compact 240.It Dv IFM_IEEE80211_ADHOC 241Ad-hoc mode. 242[adhoc] 243.It Dv IFM_IEEE80211_HOSTAP 244Host Access Point mode. 245[hostap] 246.It Dv IFM_IEEE80211_IBSS 247IBSS mode. 248[ibss] 249.It Dv IFM_IEEE80211_IBSSMASTER 250IBSS master mode. 251[ibssmaster] 252.It Dv IFM_IEEE80211_MONITOR 253Monitor mode. 254[monitor] 255.It Dv IFM_IEEE80211_TURBO 256Turbo mode. 257[turbo] 258.El 259.Pp 260The channels detailed below are defined for IEEE802.11 Wireless LAN. 261The list of available frequencies is dependent on radio regulations 262specified by regional authorities. 263Recognized regulatory authorities include 264the FCC (United States), ETSI (Europe), France, and Japan. 265Frequencies in the table are specified in MHz. 266.Pp 267.Bd -ragged -offset indent 268.Bl -column "Channel " "FCC" "ETSI" "France" "Japan" 269.Em "Channel FCC ETSI France Japan" 2701 2412 2412 - 2412 2712 2417 2417 - 2417 2723 2422 2422 - 2422 2734 2427 2427 - 2427 2745 2432 2432 - 2432 2756 2437 2437 - 2437 2767 2442 2442 - 2442 2778 2447 2447 - 2447 2789 2452 2452 - 2452 27910 2457 2457 2457 2457 28011 2462 2462 2462 2462 28112 - 2467 2467 2467 28213 - 2472 2472 2472 28314 - - - 2484 284.El 285.Ed 286.Pp 287Note that the channels do overlap; the bandwidth required for 288each channel is about 20MHz. 289When using multiple channels in close proximity it is suggested 290that channels be separated by at least 25MHz. 291In the US, this means that only channels 1, 6, and 11 may be used 292simultaneously without interference. 293.Sh SEE ALSO 294.Xr netintro 4 , 295.Xr ifconfig 8 296.Sh HISTORY 297The 298.Nm 299interface first appeared in 300.Bsx 3.0 . 301The implementation that appeared in 302.Nx 1.3 303was written by Jonathan Stone and Jason R. Thorpe to be compatible with 304the BSDI API. 305It has since gone through several revisions which have extended the 306API while maintaining backwards compatibility with the original API. 307.Pp 308Support for the 309.Sy IEEE802.11 Wireless LAN 310link type was added in 311.Nx 1.5 . 312.Pp 313.Sy Host AP 314mode was added in 315.Ox 3.1 . 316