Page 1 of 1

How to configure Rpi on two wireless networks ?

Posted: Mon Oct 01, 2012 4:39 am
by NewPi
Hi,

I have two wireless networks - one at Home and one at office, I used wpa_gui to configure my Home WiFi with RPi and connected successfully. My current "interfaces" config is :

Code: Select all

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Now, I want to connect to my office wifi network and configure both wlan connections to have static IP's. Pls. guide how to achieve this ?

Re: How to configure Rpi on two wireless networks ?

Posted: Tue Oct 02, 2012 7:13 am
by RussoNC
Mmhh... seems like you want to do an VPN? If is that, you can use this tutorial that another user post:
http://www.raspberrypi.org/phpBB3/viewt ... 36&t=14535
Hope this is usefull, if not, tell me and I'll try to help you.

Re: How to configure Rpi on two wireless networks ?

Posted: Wed Oct 03, 2012 3:02 pm
by NewPi
RussoNC wrote:Mmhh... seems like you want to do an VPN? If is that, you can use this tutorial that another user post:
http://www.raspberrypi.org/phpBB3/viewt ... 36&t=14535
Hope this is usefull, if not, tell me and I'll try to help you.
No I did not wanted an VPN, I wanted my Pi to have the same static IP address in wlan when connected to any one of the two wifi's.

Re: How to configure Rpi on two wireless networks ?

Posted: Wed Oct 03, 2012 8:15 pm
by Lob0426
Your best bet might be to use one of the network managers. They allow settings for multiple networks. The new Raspbian has one installed. I use network-manager-gnome. There are others out there also.

Re: How to configure Rpi on two wireless networks ?

Posted: Thu Oct 11, 2012 4:03 am
by NewPi
Image

Some Google searching and WICD Network Manager did the trick :)

Thanks :)

Re: How to configure Rpi on two wireless networks ?

Posted: Thu Oct 11, 2012 4:31 pm
by thogue
I'd be interested in what the interfaces file looks like for this config. Or maybe wicd holds all that info.

Re: How to configure Rpi on two wireless networks ?

Posted: Sat Oct 13, 2012 4:43 pm
by NewPi
thogue wrote:I'd be interested in what the interfaces file looks like for this config. Or maybe wicd holds all that info.
Here's the /etc/network/interfaces file :

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
The /etc/wpa_supplicant/wpa_supplicant.conf file :

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
	ssid="MyOfficeWifi"
	psk="areyoukiddingme"
	proto=RSN
	key_mgmt=WPA-PSK
	pairwise=CCMP
	auth_alg=OPEN
}

network={
	ssid="Home_Network"
	psk="reallyiwillpostithere"
	proto=RSN
	key_mgmt=WPA-PSK
	pairwise=CCMP
	auth_alg=OPEN
}


Re: How to configure Rpi on two wireless networks ?

Posted: Sat Oct 13, 2012 4:56 pm
by Dweeber
You can also add priorities when you have say a temporary hotspot that you use for testing at a location where you have a normal access point.

By adding priority...

Code: Select all

network={
        ssid="HouseDefault"
        psk="password"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
        priority=5
}
network={
        ssid="Rezound4G"
        psk="password"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
        priority=9
}
If both HouseDefault an Rezound4G are active at the location the Rezound SSID will be used because it has a higher default value. There are some great portable reasons to do this in a headless environment.

Re: How to configure Rpi on two wireless networks ?

Posted: Sat Oct 13, 2012 6:19 pm
by thogue
Config is showing dhcp config a, did you setup reservations or am I missing something ? My configs look just like this.

Re: How to configure Rpi on two wireless networks ?

Posted: Sun Oct 14, 2012 2:18 am
by NewPi
thogue wrote:Config is showing dhcp config a, did you setup reservations or am I missing something ? My configs look just like this.
No, I did no manual config. First set-upped using wpa_config and then used WICD to allot an static ip.
I guess WICD takes over to load the static IP while booting.