0

Is it possible to have a Raspberry Pi connect to two different WiFi networks? I want the built-in wlan0 to connect to a LAN, and wlan1 (using a USB wifi dongle I have) to connect to the internet.

Basically, what I want to do is have the Pi send files to a local device via wlan0, and then also be able to connect to the internet via wlan1. (The local device creates a wifi network for a LAN that the Pi can connect to, but the local device is not itself able to connect to the internet)

Any thoughts and help would be much appreciated!

Thank you!

J.S.
  • 1
  • 1

2 Answers2

2

If you like to use systemd-networkd you can create two instances of wpa_supplicant that each can be managed completely independent from the other as service. How to do it you may have a look at 2 Wifi NIC's that each only connect to one (different from each other) network.

Ingo
  • 40,606
  • 15
  • 76
  • 189
0

See Use different wpa_supplicant files in How to set up networking/WiFi

HOWEVER I recommend you DO NOT use wlan1 but implement Predictable Network Interface Names if you want the interfaces to reliably connect to specific networks. (This doesn't matter if you don't care which interface connects to which network - but is desirable any time you have multiple interfaces.)

There are other factors to consider - specifically the network interfaces should be independent, but you have specified insufficient detail.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • brilliant! that worked! thank you! I had done the separate wpa_supplicant files, but had not turned Predictable Network Interface Names on. – J.S. Dec 11 '20 at 05:55