# what is the difference between using rc.conf and manual for setting up wifi.



## miniqq (Jun 4, 2011)

The handbook suggests: 

```
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
```
put them in /etc/rc.conf for setting up wifi.

But I always change place and need connecting to different AP. So, I just remove the rc.conf lines above. When I boot the machine, start up the desktop, I just run these commands instead:

```
ifconfig ath0 up
ifconfig wlan0 create wlandev ath0
ifconfig wlan0 up
## I will change the network(/etc/wpa_supplicant.conf) for this time using wpa_cli
/etc/rc.d/wpa_supplicant start wlan0
sleep 1
dhclient -b wlan0
sleep 2
pfctl -Fa -f /etc/pf/here.conf
```
I put them in a script, run every time I enter the desktop!

So, what is the difference?

Is it good, if I always create the wlan0 after I login system?


----------



## wblock@ (Jun 4, 2011)

rc.conf just automates the steps.  You can enter multiple networks in wpa_supplicant.conf and it will connect to any that are available.


----------

