0

I'm trying to use 2 WiFi networks at the same time on one Raspberry Pi 3. I have configured the interfaces file and wpa_supplicant.conf for both networks, and I am using the built-in WiFi and a WiFi adapter.

I now am unsure about how I can address different IP addresses that are on the different networks. One network will have 2 Pi zero's connected and the other network is connected to the internet.

So, I have wlan0 and wlan1 configured and both show up fine in ifconfig, but how do I address the different IP addresses? For example, ping a local IP on one network and then ping a local IP on the other network.

  • You can change the address with ifconfig. Or what do you mean by addressing the address. – Tomas By Feb 19 '18 at 20:35
  • Being able to ping local IP addresses on both networks. Can you change which one you want to use with ifconfig? – Elliot Feb 19 '18 at 20:41
  • As bobstro points out, if the routing is configured correctly (which hopefully the system takes care of) and you didn't do something silly, such as try and use the same subnet mask on both interfaces, i.e., if one is connected to a local network using 192.168.0..., then the other one should not be (unless you use a finer mask), everything will just work, you do not have to indicate the interface, just the IP address, since those are still unique (unless, as mentioned, you did something silly). – goldilocks Feb 19 '18 at 20:52
  • You give the address as a parameter to ping. I'm not sure why you think you need to do anything more. Generally, you can use both addresses at the same time (of course). – Tomas By Feb 19 '18 at 22:14
1

This is really a routing question. Your RPi has routes to any it network is directly connected to. So long as that "network with 2 Pi zero's" is directly connected, you will be able to access them with no problem. The same applies to any other devices on the same network as your Internet router.

To connect to the Internet or any other network which your RPi is not connected directly to, your RPi will use its default route. So long as all of the "unknown"networks are connected via the router your default route (default gateway) points to, your RPi will direct traffic to the router and let it sort it out. So far as the Internet goes, you're still in good shape.

You may run into problems if there are any devices not accessible via your default route, and which the RPi is not directly connected to.

From what you've described, it should work. Just be aware that if you have more networks on the non-Internet interface, it may get complicated.

  • This make sense now, thanks. I’m able to ping different IP address on different networks no problem. – Elliot Feb 21 '18 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.