NewPi
Posts: 66
Joined: Sat Aug 18, 2012 2:52 pm

How to configure Rpi on two wireless networks ?

Mon Oct 01, 2012 4:39 am

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 ?
Raspberry Pi Howto, Tips, Tricks and Tools -> http://bit.ly/RPiTricks

RussoNC
Posts: 48
Joined: Fri Sep 07, 2012 6:53 am
Location: New Caledonia
Contact: Website

Re: How to configure Rpi on two wireless networks ?

Tue Oct 02, 2012 7:13 am

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.
Whant to see MySQL, nginx in action on the Raspberry pi ? Check my site: www.pirepository.com

NewPi
Posts: 66
Joined: Sat Aug 18, 2012 2:52 pm

Re: How to configure Rpi on two wireless networks ?

Wed Oct 03, 2012 3:02 pm

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.
Raspberry Pi Howto, Tips, Tricks and Tools -> http://bit.ly/RPiTricks

User avatar
Lob0426
Posts: 2198
Joined: Fri Aug 05, 2011 4:30 pm
Location: Susanville CA.
Contact: Website

Re: How to configure Rpi on two wireless networks ?

Wed Oct 03, 2012 8:15 pm

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.
512MB version 2.0 as WordPress Server
Motorola Lapdock with Pi2B
Modded Rev 1.0 with pin headers at USB

http://rich1.dyndns.tv/
(RS)Allied ships old stock to reward its Customers for long wait!

NewPi
Posts: 66
Joined: Sat Aug 18, 2012 2:52 pm

Re: How to configure Rpi on two wireless networks ?

Thu Oct 11, 2012 4:03 am

Image

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

Thanks :)
Raspberry Pi Howto, Tips, Tricks and Tools -> http://bit.ly/RPiTricks

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: How to configure Rpi on two wireless networks ?

Thu Oct 11, 2012 4:31 pm

I'd be interested in what the interfaces file looks like for this config. Or maybe wicd holds all that info.

NewPi
Posts: 66
Joined: Sat Aug 18, 2012 2:52 pm

Re: How to configure Rpi on two wireless networks ?

Sat Oct 13, 2012 4:43 pm

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
}

Raspberry Pi Howto, Tips, Tricks and Tools -> http://bit.ly/RPiTricks

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: How to configure Rpi on two wireless networks ?

Sat Oct 13, 2012 4:56 pm

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.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

thogue
Posts: 131
Joined: Wed Sep 19, 2012 2:16 am

Re: How to configure Rpi on two wireless networks ?

Sat Oct 13, 2012 6:19 pm

Config is showing dhcp config a, did you setup reservations or am I missing something ? My configs look just like this.

NewPi
Posts: 66
Joined: Sat Aug 18, 2012 2:52 pm

Re: How to configure Rpi on two wireless networks ?

Sun Oct 14, 2012 2:18 am

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.
Raspberry Pi Howto, Tips, Tricks and Tools -> http://bit.ly/RPiTricks

Return to “Beginners”