# WPA wireless networking ral0



## kramg (May 11, 2011)

This is my first attempt at a full-blown FreeBSD install that will act as a web server. I've run into a problem with the wireless networking with a Rosewill g300ex wireless nic. It uses the ral chipset and the generic kernel recognizes the nic. However, I've been unable to connect it to my wireless access point. The access point is configured for wpa-personal with AES encryption. Neither dhcp nor static IPs work. Thanks in advance for any help.

That being said here is my /boot/loader.conf:


```
if_ral_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```
/etc/rc.conf:


```
defaultrouter="192.168.11.1"
hostname="freebsd.xxxx.local"

ifconfig_vr0="inet 192.168.11.110  netmask 255.255.255.0"
sshd_enable="YES"
wlans_ral0="wlan0"
ifconfig_wlan0="SYNCDHCP WPA ssid xxxx mode 11g channel 8"
```

/etc/wpa_supplicant.conf:


```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
ssid="xxxx"
key_mgmt=WPA-PSK
group=CCMP
psk="nopsksoupforyou"
}
```

*ifconfig*


```
ral0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether ff:ff:ff:ff:ff:ff
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: associated
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:16:17:10:1f:f2
        inet 192.168.11.110 netmask 0xffffff00 broadcast 192.168.11.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether ff:ff:ff:ff:ff:ff
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: no carrier
        ssid xxxx channel 8 (2447 MHz 11g)
        country US authmode WPA1+WPA2/802.11i privacy ON deftxkey UNDEF
        txpower 0 bmiss 7 scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250
        roam:rssi 7 roam:rate 5 protmode CTS roaming MANUAL bintval 0
```


----------



## SirDice (May 11, 2011)

WLAN0 has a "no carrier" status. That means that wpa_supplicant is failing. If that fails DHCP and everything else will fail too.

Fix the issue with wpa_supplicant first, you need to be connected before getting/setting an IP address.


----------



## bbzz (May 11, 2011)

Try with removing "group" from network configuration. Then manually run

```
#wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
```
and see what you get.


----------



## wblock@ (May 11, 2011)

Don't set SSID in rc.conf.  Let wpa_supplicant(8) handle that on its own.  Also leave out mode and channel, at least until you've got the basic stuff working.


----------



## kramg (May 12, 2011)

So I made the suggested changes. Below is my current configuration:

/etc/rc.conf

```
ifconfig_vr0="inet 192.168.11.110  netmask 255.255.255.0"
sshd_enable="YES"
wlans_ral0="wlan0"
ifconfig_wlan0="SYNCDHCP"
```

/etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
ssid="hammer"
key_mgmt=WPA-PSK

psk="abalone781"
}
```

When I ran `# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf` the output I received:


```
freebsd# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
ioctl[SIOCS80211, op 103, len 128]: Device not configured
Failed to initiate AP scan.
ioctl[SIOCS80211, op 103, len 128]: Device not configured
Failed to initiate AP scan.
ioctl[SIOCS80211, op 103, len 128]: Device not configured
Failed to initiate AP scan.
```

*ifconfig*

```
ral0: flags=8803<UP,BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether ff:ff:ff:ff:ff:ff
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:16:17:10:1f:f2
        inet 192.168.11.110 netmask 0xffffff00 broadcast 192.168.11.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether ff:ff:ff:ff:ff:ff
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 1 (2412 MHz 11b)
        country US authmode WPA1+WPA2/802.11i privacy OFF txpower 0 bmiss 7
        scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7
        roam:rate 1 bintval 0
```

As you can see it doesn't pick up the ssid from wpa_supplicant.conf. By the way, I did not change the ether address to ff:. 

As a side note heres my *uname -a*:

```
FreeBSD freebsd.xxxx.local 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011
     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```


----------



## bbzz (May 12, 2011)

Only leave

```
network={
ssid="hammer"
psk="abalone781"
}
```
in wpa_supplicant.
Make sure there isn't wlan0 already created. If it is,

```
#ifconfig wlan0 destroy
```

Then try running all again manually:

```
# ifconfig wlan0 create wlandev vr0
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
```
Make sure wlan0 is up..


----------



## wblock@ (May 12, 2011)

ral0 is the correct interface.  The driver may have problems with this particular card.

Incidentally, tabs are free, and make /etc/wpa_supplicant.conf easier to read.


----------



## kramg (May 16, 2011)

Thanks so far for everyone's suggestions. I've gone a different route though. I've replaced the ralink chipset wireless card with an atheros chipset wireless card. The card is recognized by the system and I've made the suggested changes.

Here is my scan:


```
#ifconfig wlan0 scan 
0x08071b000...  00:1d:73:b4:6c:e3    8   54M -53:-96  100 EPS  WPA WME MESHCONF HTCAP ATH
```

/etc/wpa_supplicant.conf


```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
        ssid="pick"
        psk="lobster650"
        }
```

/etc/rc.conf

```
sshd_enable="YES"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
ifconfig_vr0="inet 192.168.11.110  netmask 255.255.255.0"
defaultrouter="192.168.11.1"
hostname="xxx.xxx"
```

So what sticks out to me is the ascii for my ssid. I verified the MAC address that shows in the scan is the MAC address of my router. And as of now I'm still unable to retrieve an address via dhcp.


```
#ifconfig
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:22:b0:69:60:7f
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: associated
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:16:17:10:1f:f2
        inet 192.168.11.110 netmask 0xffffff00 broadcast 192.168.11.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:22:b0:69:60:7f
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 5 (2432 MHz 11g)
        regdomain FCC3 indoor ecm authmode WPA1+WPA2/802.11i privacy ON
        deftxkey UNDEF txpower 21 bmiss 7 scanvalid 450 bgscan bgscanintvl 300
        bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme burst
        roaming MANUAL
```


----------



## wblock@ (May 16, 2011)

When using DHCP with the wireless, don't set a defaultrouter in /etc/rc.conf.  As far as the SSID goes, I'd check the access point.  Are other machines or operating systems successfully attached to it?  Does it have the worse-than-useless "hidden SSID" mode enabled?


----------



## kramg (May 17, 2011)

As a genius Kazakhstanian once said "Great Success!" So I reloaded the firmware on my router as well as reconfiguring all the wireless settings on the router. A quick reboot of the server and fingers being crossed I ran *dhclient wlan0* and successfully pulled an address. I then configured wlan0 with a static ip address and could successfully ping the static address. Then the true test I was able to successfully connect via ssh.

A side note *ifconfig wlan0 scan* still returns an ascii ssid. Must be something to do with my Buffalo router with dd-wrt

Regardless thanks all for your help.


----------



## wblock@ (May 17, 2011)

Just checked here.  With an Atheros card and dd-wrt on the router, the SSID displays correctly.  Don't know what's causing it to appear in hex above.


----------

