From d92f9c2d6ecd38c8331de78ea792b1475fa4013f Mon Sep 17 00:00:00 2001 From: Marc Fonvieille Date: Tue, 24 Aug 2010 21:01:44 +0000 Subject: [PATCH] Wireless section: Many fixes and updates (mostly on AP part) to match 8.X. It's still a work in progress. --- .../handbook/advanced-networking/chapter.sgml | 149 ++++++++++-------- 1 file changed, 83 insertions(+), 66 deletions(-) diff --git a/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml b/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml index 68d4df79d7..97f966914a 100644 --- a/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml +++ b/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml @@ -908,9 +908,9 @@ device wlan_scan_sta # 802.11 STA mode scanning about the wireless device in the boot messages, like this: - ath0: <Atheros 5212> mem 0xff9f0000-0xff9fffff irq 17 at device 2.0 on pci2 -ath0: Ethernet address: 00:11:95:d5:43:62 -ath0: mac 7.9 phy 4.5 radio 5.6 + ath0: <Atheros 5212> mem 0x88000000-0x8800ffff irq 11 at device 0.0 on cardbus1 +ath0: [ITHREAD] +ath0: AR2413 mac 7.9 RF2413 phy 4.5 @@ -939,7 +939,7 @@ ath0: mac 7.9 phy 4.5 radio 5.6 &prompt.root; ifconfig wlan0 create wlandev ath0 &prompt.root; ifconfig wlan0 up scan -SSID BSSID CHAN RATE S:N INT CAPS +SSID/MESH ID BSSID CHAN RATE S:N INT CAPS dlinkap 00:13:46:49:41:76 11 54M -90:96 100 EPS WPA WME freebsdap 00:11:95:c3:0d:ac 1 54M -83:96 100 EPS WPA @@ -1211,7 +1211,7 @@ wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 point: wlans_ath0="wlan0" -ifconfig_wlan0="ssid your_ssid_here inet 192.168.1.100 netmask 255.255.255.0" +ifconfig_wlan0="inet 192.168.1.100 netmask 255.255.255.0 ssid your_ssid_here" @@ -1716,8 +1716,8 @@ wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ifconfig: &prompt.root; ifconfig wlan0 create wlandev ath0 -&prompt.root; ifconfig wlan0 ssid my_net wepmode on weptxkey 3 wepkey 3:0x3456789012 \ - inet 192.168.1.100 netmask 255.255.255.0 +&prompt.root; ifconfig wlan0 inet 192.168.1.100 netmask 255.255.255.0 \ + ssid my_net wepmode on weptxkey 3 wepkey 3:0x3456789012 @@ -1782,16 +1782,17 @@ Associated with 00:13:46:49:41:76 On the box A: - &prompt.root; ifconfig wlan0 create wlandev ath0 -&prompt.root; ifconfig wlan0 ssid freebsdap mediaopt adhoc inet 192.168.0.1 netmask 255.255.255.0 + &prompt.root; ifconfig wlan0 create wlandev ath0 wlanmode adhoc +&prompt.root; ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap &prompt.root; ifconfig wlan0 - wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 + wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 ether 00:11:95:c3:0d:ac inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <adhoc>) - status: associated - ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac - authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100 + media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <adhoc> + status: running + ssid freebsdap channel 2 (2417 Mhz 11g) bssid 02:11:95:c3:0d:ac + country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60 + protmode CTS wme burst The adhoc parameter indicates the interface is running in the IBSS mode. @@ -1799,25 +1800,26 @@ Associated with 00:13:46:49:41:76 On B, we should be able to detect A: - &prompt.root; ifconfig wlan0 up scan - SSID BSSID CHAN RATE S:N INT CAPS - freebsdap 02:11:95:c3:0d:ac 2 54M -90:-96 100 IS + &prompt.root; ifconfig wlan0 create wlandev ath0 wlanmode adhoc +&prompt.root; ifconfig wlan0 up scan + SSID/MESH ID BSSID CHAN RATE S:N INT CAPS + freebsdap 02:11:95:c3:0d:ac 2 54M -64:-96 100 IS WME The I in the output confirms the machine A is in ad-hoc mode. We just have to configure B with a different IP address: - &prompt.root; ifconfig wlan0 create wlandev ath0 -&prompt.root; ifconfig wlan0 ssid freebsdap mediaopt adhoc inet 192.168.0.2 netmask 255.255.255.0 + &prompt.root; ifconfig wlan0 inet 192.168.0.2 netmask 255.255.255.0 ssid freebsdap &prompt.root; ifconfig wlan0 - wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 + wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 ether 00:11:95:d5:43:62 inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 - media: IEEE 802.11 Wireless Ethernet autoselect <adhoc> (autoselect <adhoc>) - status: associated - ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac - authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100 + media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <adhoc> + status: running + ssid freebsdap channel 2 (2417 Mhz 11g) bssid 02:11:95:c3:0d:ac + country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60 + protmode CTS wme burst Both A and B are now ready to exchange informations. @@ -1851,43 +1853,54 @@ Associated with 00:13:46:49:41:76 check if your wireless device supports the host-based access point mode (also know as hostap mode): - &prompt.root; ifconfig ath0 list caps -ath0=783ed0f<WEP,TKIP,AES,AES_CCM,IBSS,HOSTAP,AHDEMO,TXPMGT,SHSLOT,SHPREAMBLE,MONITOR,TKIPMIC,WPA1,WPA2,BURST,WME> + &prompt.root; ifconfig wlan0 create wlandev ath0 +&prompt.root; ifconfig wlan0 list caps +drivercaps=6f85edc1<STA,FF,TURBOP,IBSS,HOSTAP,AHDEMO,TXPMGT,SHSLOT,SHPREAMBLE,MONITOR,MBSS,WPA1,WPA2,BURST,WME,WDS,BGSCAN,TXFRAG> +cryptocaps=1f<WEP,TKIP,AES,AES_CCM,TKIPMIC> This output displays the card capabilities; the HOSTAP word confirms this wireless card can act as an Access Point. Various supported ciphers are - also mentioned: WEP, TKIP, WPA2, etc., these informations + also mentioned: WEP, TKIP, AES, etc., these informations are important to know what security protocols could be set on the Access Point. - The wireless device can now be put into hostap mode and - configured with the correct SSID and IP address: + The wireless device can only be put into hostap mode + during the creation of the network pseudo-device, so + previous created device must be destroyed first: - &prompt.root; ifconfig ath0 ssid freebsdap mode 11g mediaopt hostap inet 192.168.0.1 netmask 255.255.255.0 + &prompt.root; ifconfig wlan0 destroy + + then regenerated with the correct option before setting + the other parameters: + + &prompt.root; ifconfig wlan0 create wlandev ath0 wlanmode hostap +&prompt.root; ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mode 11g channel 1 Use again ifconfig to see the status - of the ath0 interface: + of the wlan0 interface: - &prompt.root; ifconfig ath0 - ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 - inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4 + &prompt.root; ifconfig wlan0 + wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 ether 00:11:95:c3:0d:ac + inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap> - status: associated - ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac - authmode OPEN privacy OFF txpowmax 38 bmiss 7 protmode CTS burst dtimperiod 1 bintval 100 + status: running + ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac + country US ecm authmode OPEN privacy OFF txpower 21.5 scanvalid 60 + protmode CTS wme burst dtimperiod 1 -dfs The hostap parameter indicates the interface is running in the host-based access point mode. The interface configuration can be done automatically at - boot time by adding the following line to + boot time by adding the following lines to /etc/rc.conf: - ifconfig_ath0="ssid freebsdap mode 11g mediaopt hostap inet 192.168.0.1 netmask 255.255.255.0" + wlans_ath0="wlan0" +create_args_wlan0="wlanmode hostap" +ifconfig_wlan0="inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mode 11g channel 1" @@ -1903,23 +1916,25 @@ ath0=783ed0f<WEP,TKIP,AES,AES_CCM,IBSS,HOSTAP,AHDEMO,TXPMGT,SHSLOT,SHPREAMBLE possible from another wireless machine to initiate a scan to find the AP: - &prompt.root; ifconfig ath0 up scan -SSID BSSID CHAN RATE S:N INT CAPS -freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 ES + &prompt.root; ifconfig wlan0 create wlandev ath0 +&prompt.root; ifconfig wlan0 up scan +SSID/MESH ID BSSID CHAN RATE S:N INT CAPS +freebsdap 00:11:95:c3:0d:ac 1 54M -66:-96 100 ES WME The client machine found the Access Point and can be associated with it: - &prompt.root; ifconfig ath0 ssid freebsdap inet 192.168.0.2 netmask 255.255.255.0 -&prompt.root; ifconfig ath0 - ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1 - inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 + &prompt.root; ifconfig wlan0 inet 192.168.0.2 netmask 255.255.255.0 ssid freebsdap +&prompt.root; ifconfig wlan0 + wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 ether 00:11:95:d5:43:62 - media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps) + inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255 + media: IEEE 802.11 Wireless Ethernet OFDM/54Mbps mode 11g status: associated - ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac - authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100 + ssid freebsdap channel 1 (2412 Mhz 11g) bssid 00:11:95:c3:0d:ac + country US ecm authmode OPEN privacy OFF txpower 21.5 bmiss 7 + scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 + roam:rate 5 protmode CTS wme burst @@ -1957,7 +1972,7 @@ freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 ES The configuration is done in the /etc/hostapd.conf file: - interface=ath0 + interface=wlan0 debug=1 ctrl_interface=/var/run/hostapd ctrl_interface_group=wheel @@ -2041,8 +2056,8 @@ wpa_pairwise=CCMP TKIP &prompt.root /etc/rc.d/hostapd forcestart - &prompt.root; ifconfig ath0 - ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2290 + &prompt.root; ifconfig wlan0 + wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2290 inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4 ether 00:11:95:c3:0d:ac @@ -2055,7 +2070,7 @@ wpa_pairwise=CCMP TKIP associated with it, see for more details. It is possible to see the stations associated with the AP using - the ifconfig ath0 list + the ifconfig wlan0 list sta command. @@ -2073,8 +2088,9 @@ wpa_pairwise=CCMP TKIP The wireless device can now be put into hostap mode and configured with the correct SSID and IP address: - &prompt.root; ifconfig ath0 ssid freebsdap wepmode on weptxkey 3 wepkey 3:0x3456789012 mode 11g mediaopt hostap \ - inet 192.168.0.1 netmask 255.255.255.0 + &prompt.root; ifconfig wlan0 create wlandev ath0 wlanmode hostap +&prompt.root; ifconfig wlan0 inet 192.168.0.1 netmask 255.255.255.0 \ + ssid freebsdap wepmode on weptxkey 3 wepkey 3:0x3456789012 mode 11g @@ -2096,22 +2112,23 @@ wpa_pairwise=CCMP TKIP Use again ifconfig to see the status - of the ath0 interface: + of the wlan0 interface: - &prompt.root; ifconfig ath0 - ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 - inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 - inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4 + &prompt.root; ifconfig wlan0 + wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 ether 00:11:95:c3:0d:ac + inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255 media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap> - status: associated - ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac - authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit txpowmax 36 protmode CTS dtimperiod 1 bintval 100 + status: running + ssid freebsdap channel 4 (2427 Mhz 11g) bssid 00:11:95:c3:0d:ac + country US ecm authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit + txpower 21.5 scanvalid 60 protmode CTS wme burst dtimperiod 1 -dfs From another wireless machine, it is possible to initiate a scan to find the AP: - &prompt.root; ifconfig ath0 up scan + &prompt.root; ifconfig wlan0 create wlandev ath0 +&prompt.root; ifconfig wlan0 up scan SSID BSSID CHAN RATE S:N INT CAPS freebsdap 00:11:95:c3:0d:ac 1 54M 22:1 100 EPS