0

I want to setup multiple network for wifi. One for my home and another for my office. I took the reference from stackoverflow but it did not work in mine. It works if i use the ethernet but not when using wifi dongle. Here how i setup for multiple wifi

/etc/network/interfaces

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf  /etc/wpa_supplicant/wpa_supplicant.conf


allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf  /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplement/wpa_supplement.conf

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

network={
        scan_ssid=1
        ssid="MiRouter"
        psk="4444333221"
        id_str="home"
        priority=1
        key_mgmt=WPA-PSK
}

network={
        ssid="companyssid"
        psk="password"
        id_str="office"
        priority=2
}

I am using raspberry pi 2 and OS is raspbian stretch. What have i missed here?

Before the configuration was following and it was working

source-directory /etc/network/interfaces.d

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0


iface wlan0 inet dhcp
wpa-scan-ssid 1
   wpa-ap-scan 1
   wpa-key-mgmt WPA-PSK
   wpa-proto RSN WPA
   wpa-pairwise CCMP TKIP
   wpa-group CCMP TKIP
        wpa-ssid "MiRouter"
        wpa-psk "4444333221"
iface default inet dhcp
milan
  • 135
  • 1
  • 7

1 Answers1

1

If you are using Stretch you SHOULD NOT modify /etc/network/interfaces (indeed you can just delete it).

Your wpa_supplicant looks OK, although it contains un-necessary lines.

You should set Wi-Fi country e.g country=AU - not sure if absolutely necessary for Pi2, but still should be set.

See How to set up networking/WiFi which shows the correct contents of the files.

Milliways
  • 62,573
  • 32
  • 113
  • 225