# Multiple Wireless Networks in FreeBSD 9.1



## giridharangm (Jun 17, 2013)

Hii all,

I'm new to *F*reeBSD. During the installation, I was able to set up my home wireless network (auth: WPA) and it is working without any problems. But at my office, there is a hidden wireless network encrypted with WPA2 personal. The problem is I can't connect to that network.

I've tried modifying /etc/wpa_supplicant.conf and /etc/rc.conf (up to my knowledge and some random search results) still not working.

Anyone can help me to set up this office network? (from the basics) I want to connect to these (office and home) network automatically.


----------



## phoenix (Jun 17, 2013)

Please post your wpa_supplicant.conf and rc.conf.  You can scramble the WPA passphrases, but leave any IPs if listed.


----------



## giridharangm (Jun 18, 2013)

*Y*esterday, due to some boot problems, *I* had to reinstall freebsd FreeBSD. *D*uring installation, *I* configured my home network and it is working. *S*ince it was a fresh install, the code below is it's default. I I haven't added anything to these files. Now, what are the modifications needed to connect to a second network? *O*ffice network is hidden, protected by WPA and has DHCP.

*H*ere is my /etc/wpa_supplicant.conf

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

network={
	ssid="linksys" //my home network
	psk="psk goes here"
	priority=5
}
network={
	priority=5
	key_mgmt=NONE
}
```
and here goes /etc/rc.conf

```
hostname=freebsd91
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
#Set dumdev to "AUTO" to enable crash dumps, "NO" to disable
dumdev="AUTO"
```


----------



## phoenix (Jun 18, 2013)

Just add another network={} block with the information for the office network, same as you have for your home network (SSID, PSK, etc).  And there's an extra entry you need to add to tell it that it's a hidden SSID: scan_ssid=1

So, your file would look something like:

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

network={
	ssid="linksys" //my home network
	psk="psk goes here"
	priority=5
}

network={
	ssid="office-network"
	psk="office-key"
        scan_ssid=1
	priority=5
}

network={
	priority=5
	key_mgmt=NONE
}
```


----------



## giridharangm (Jun 18, 2013)

*T*hanks! *I*'ve already tried this way two days ago. *E*xcept *I* forgot to add scan_ssid=1. *N*ow that *I*'ve added it, it works like a charm! *T*hanks... *I* had to reboot the system for the changes to take effect. The `service netif start` didn't work. Or was that a wrong command?

Now one more help, how can *I* scan for other networks and connect to those networks via terminal? I'm a beginner, that's why these silly doubts.


----------



## phoenix (Jun 19, 2013)

`# service wpa_supplicant restart`


----------

