# wireless: ath0 error, v7 vs v8?



## cbrace (Mar 5, 2010)

I recently upgraded my FreeBSD server from FreeBSD v7 to v8. Everything seems to be working OK, except the Atheros-based wireless network card, which I had configured as an access point and which worked fine under v7 for several years.

The command:

```
# ifconfig ath0 up
```
works fine, but anything else returns an error message. For example

```
# ifconfig ath0 192.168.3.1
ifconfig: ioctl (SIOCAIFADDR): Invalid argument
```
or this:

```
# ifconfig ath0 ssid freebsdap mode 11g mediaopt hostap inet 192.168.0.1 netmask 255.255.255.0
ifconfig: SIOCS80211: Invalid argument
```
I asked about this on the freebsd-questions list, and all I got was the terse reply: wireless has changed from v7 to v8; see the handbook.

Well, I copied & pasted the ifconfig line above *directly from the handbook*! Further, it is not indicated, AFAICT, exactly what things have changed from v7 with regard to wireless.

Any ideas on what is going on here?


----------



## lme@ (Mar 5, 2010)

Wireless has changed from 7 to 8.
In 8 you need to create a virtual device first:
`# ifconfig wlan0 create wlandev ath0 up`
Then you configure wlan0 just like you configured ath0 in 7.x.
The entries for /etc/rc.conf are:

```
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
```
That would setup wlan0 for use with DHCP and wpa_supplicant(8).

It would be very nice if you'd write a PR with send-pr(1) that the handbook needs to be updated.


----------



## DutchDaemon (Mar 5, 2010)

a.k.a. *Sticky: Important wireless networking change in FreeBSD 8*


----------



## cbrace (Mar 5, 2010)

Thanks Imea@

Via the sticky that DD refers to above, I came to the ath manpage which sorted me out.

This works for me:

```
ifconfig wlan0 create wlandev ath0 wlanmode hostap
ifconfig wlan0 inet 192.168.3.1 mode 11g channel 2 ssid venus
```

The tricky bit is you can't set everything in one command, as I was doing under 7

I was already using a start file to initialise the interface, */etc/start_if.ath0*, so I will just add those two lines to it. I assume it will also work under 8; will reboot shortly and find out.

I've never used send-pr, but I will give it a try.


----------

