# wpa_supplicant.conf is ignored and disconnecting



## comet (Dec 28, 2011)

Hello there, I'm actually working with a Google CR-48 Chromebook that I managed to get FreeBSD 9.0-RC3 installed. The OS works like a dream. The CR-48 uses a standard Atheros chipset for WiFi, but I'm having a couple issues.

First and foremost I will say that I'm connecting to a regular WPA network with a hidden SSID and a static IP address.

If I remove all networking components from rc.conf and boot up the system, I can get the network up and running for a couple minutes by enabling everything manually as such:


```
#ifconfig wlan0 create wlandev ath0
#wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan0
#ifconfig wlan0 inset 192.168.1.100 netmask 255.255.255.0
#route add default 192.168.1.1
```

The problem is if I try to automate this in any way using rc.conf. Here's what I currently have in there.


```
# rc.conf
wlans_ath0="wlan0"
defaultrouter="192.168.1.1"
ifconfig_wlan0="WPA inet 192.168.1.100 netmask 255.255.255.0"
```

And here's my wpa_supplicant.conf:


```
#wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant

network={
   ssid="my-hidden-ssid"
   scan_ssid=1
   psk=areallylongkeythatigeneratedwithwpa_passphrase
}
```

I've even tried adding 
	
	



```
wpa_supplicant_enable="YES"
```
 and 
	
	



```
wpa_supplicant_conf_file=/etc/wppa_supplicant.conf
```
 to the rc.conf file without any success.

Not sure why this isn't executing on startup. I can start wpa_supplicant manually no problem which leads me to believe my wpa_supplicant.conf file is correct and rc.conf isn't listening properly. Perhaps it is just taking an extraordinary long amount of time to connect?

One thing I noticed differently is that since I installed 9.0-RC3 I got the chance to experience the new sysinstall. I was super excited to see that I could setup a WiFi connection right through there. Unfortunately however, there was no option to connect to a network with a hidden SSID. Ahh well. Perhaps 9.0 is configuring the WiFi slightly different? 

Thanks in advance for your time and assistance.

FYI, I thought it was disconnecting randomly, but it seems to have sustained itself when I manually connect. It simply still won't connect when using rc.conf.

I wanted to mention as well that when I do the rc.conf method, wlan0 does indeed exist, and it gets the IP I specify. But the ssid is blank, and it does not connect to the router.


----------



## SNK (Dec 28, 2011)

Perhaps try it like this:

/etc/rc.conf

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

/etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
   ssid="my-hidden-ssid"
   bssid="..."
   key_mgmt=WPA-PSK
   proto=WPA
   psk="..."
   priority=5
}
```

-edit-

Oh, you wanted a static IP for the client?


----------



## comet (Dec 29, 2011)

No luck unfortunately. It needs to be 
	
	



```
wlans_ath0="wlan0"
```
 because it creates the device wlan0. If it is set as "YES" then it will create an interface called YES.

I did add the things you suggested in my wpa_supplicant.conf without any success. It seems like the startup process is completely bypassing the /etc/rc.d/wpa_supplicant script.


----------



## wblock@ (Dec 29, 2011)

After startup, do
`# service netif restart`

(I've been assured that this should not panic, but don't be surprised if it does.)

If the network works then, it's because of some delay.  Look skeptically at that "hidden" SSID.


----------



## Tarick (Dec 29, 2011)

I have the same WiFi setup that you described, and it works with:
/etc/rc.conf

```
wlan_run0="wlan0"
ifconfig_wlan0="inet 192.168.28.6 netmask 255.255.255.0 WPA mode 11g"
wpa_supplicant_enable="YES"
```

My wpa_supplicant.conf is the same (without ctrl_interface though), and network connects on the system start. I think the order of options in ifconfig_wlan0 matters here.


----------



## comet (Dec 30, 2011)

Tarick, that worked like a champ man. Thank you SO much. I don't know why it was effected like that, but now all is working great on startup! I appreciate your help!


----------

