# freebsd 8.0 beta1 wireless



## b7j0c (Jul 14, 2009)

does anyone have a simple minimal setup to get wireless working for a desktop in freebsd 8-beta1? 

i have an atheros nic that was supported in 7.x without patches. my 7.x configuration won't work in 8.0 beta1.

any insights appreciated, full /boot/loader.conf and /etc/rc.conf would be even better

thanks


----------



## aragon (Jul 14, 2009)

Well, the first hurdle is making sure your atheros card appears in an ifconfig listing.  Does it?


----------



## phoenix (Jul 14, 2009)

8.0 also includes the VAP (virtual access point) stuff, which splits all wireless drivers into two parts:  the hardware interface and the virtual interface(s).

Whereas in FreeBSD <= 7 you manipulate the wireless interface directly (ath0, wi0, wpi0, etc), in FreeBSD 8+ you first clone the interface and then manipulate the cloned interface.

You'll have something like an ath0 (the hardware interface) that you clone into a wlan0 (or whatever you want to call it).  Then you configure the wlan0 interface.

There should be comments in /etc/defaults/rc.conf that cover this.  If not, have a look at the man page for ath(4).  From the man page, the important part is this: `# ifconfig wlan0 create wlandev ath0`

Some other changes also happened with regards to the HAL and the rate modules.  IIRC, the rate modules were incorporated into the HAL module, so you don't load anything with _rate_ in the name (you still have to specify it in the kernel config if you are compiling the drivers into the kernel).

Browsing through the SVN repo for commits from Sam Leffler, I believe the following are what you need for an Atheros card:
*/boot/loader.conf*

```
ath_load="YES"
```

*/etc/rc.conf*

```
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
```

*/etc/wpa_supplicant.conf*
<The same settings you used before>

After booting, you should see wlan0 connect and get an IP.

Or, you can do it manually (after editing the above files):

```
# kldload if_ath
# ifconfig wlan0 create wlandev ath0
# /etc/rc.d/netif start wlan0
```

(Note:  none of the above has been tested, as I do not have any 8.x systems.  I've just done some googling and mailing list reading.)


----------



## b7j0c (Jul 14, 2009)

phoenix said:
			
		

> From the man page, the important part is this: `# ifconfig wlan0 create wlandev ath0`



i had seen this and my understanding was that this is not a persistent assignment...upon reboot wlan0 will need to be recreated. is my understanding  accurate? if so, are there further lines that must be added to /etc/rc.conf to initialize/create wlan0 at boot time?



			
				phoenix said:
			
		

> */etc/rc.conf*
> 
> ```
> wlans_ath0="wlan0"
> ...



regarding this, i also have a line in /etc/rc.conf to enable wpa_supplicant. does it matter what order i have this line with regard to the other lines you have above?

thanks so much for the detailed answer


----------



## phoenix (Jul 14, 2009)

This line (wlans_ath0="wlan0") creates the wlan0 virtual interface at every boot (actually, everytime /etc/rc.d/netif is run).

This line (ifconfig_wlan0="WPA DHCP") configures the wlan0 interface to use WPA, and starts wpa_supplicant, waits for a wireless link, and then runs dhclient to get the IP via DHCP.

Are you seeing any errors?  Is there anything in /var/log/messages or dmesg output?  Does ath0 and wlan0 appear in ifconfig output?  What shows up if you run *wpa_cli* to connect to wpa_supplicant?  Is wpa_supplicant running (check via *pgrep -lf wpa*)?

At this point, you'll need to provide info on what you have tried, what your current settings are, and what issues you're running into.


----------



## aragon (Jul 14, 2009)

I believe the correct directive should be "wlans_ath0".


----------



## b7j0c (Jul 15, 2009)

success! thanks to phoenix and aragon for helping.

relevant snippets:

/boot/loader.conf:


```
ath_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_Tkip_load="YES"
if_vlan_load="YES"
```

/etc/rc.conf:


```
vaps_ath0="wlan0"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
```

once again, thanks for everyone's help


----------



## ikbendeman (Dec 3, 2009)

When i try this configuration on my laptop, I get

```
ath0: device timeout
```
as a message on my first terminal. dmesg doesn't appear to show anything of importance, somebody please help! if I can find a solution I'll be sure to repost it. The handbook needs to be updated with more information for 8.0...


----------



## recus (Dec 31, 2009)

b7j0c said:
			
		

> success! thanks to phoenix and aragon for helping.


A most helpful thread! Thank you guys! 


> /etc/rc.conf:
> 
> 
> 
> ...


It's working. BUT... had to struggle for days to find the snag. I had compiled my kernel without "device bpf" (Berkeley packet filter). And that resulted in the following: 

```
wpa_supplicant[1035]: Failed to disable WPA in the driver.
root: /etc/rc.d/wpa_supplicant: WARNING: failed to start wpa_supplicant
```
Compiled with bpf and everything is working perfect. 


> 8.0 also includes the VAP (virtual access point) stuff, which splits all wireless drivers into two parts: the hardware interface and the virtual interface(s).


As for the VAP-stuff, can anyone explain the advantages of the concept?


----------



## anigma (Jan 18, 2010)

Great article. Really helped!


----------

