Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4848

Networking and servers • Re: Wifi Router w/ Wireguard VPN for IoT

$
0
0
Where I'm stuck is how to get the sensor data into my local network. I can ping wg0 from any device in my local network, but cannot reach the sensors.
That's probably because your Pi and your wireguard setup are not ready to handle the wireless network with sensors, which is a secondary network.
You can configure the Pi to route between both networks, and have wireguard pass traffic from hosts on both networks

Or simpler as you suggest, you could use a single network. For that you would:
  • create a network bridge interface, say br0
  • set usb0 and wlan0 as bridge members (aka slaves)
  • (most likely) set br0 and both wireless sensors to use DHCP
The state machine would look something like this:
  • At boot a br0 interface will be created, empty and in down state
  • When the access point gets started, interface wlan0 will be added to the bridge by the process that manages the AP (used to by wpa_supplicant, is it NM today?)
  • Br0 will come up with the first member interface up
  • When your phone gets tethered, interface usb0 will be created and added to br0
  • When the hotspot on your phone gets started, usb0 will come up
  • Br0 will acquire an IP address from the phone, through usb0
  • Sensors will acquire an IP address from the phone, through wlan0 and then usb0
  • When you start wireguard on the Pi the tunnel will get established and the 2 local networks (cf. br0, Fritzbox) will communicate though the tunnel
I assume the hotspot on your phone does not allow you to set the IP network to use nor to reserve IP addresses for specific MAC addresses. Could be a slight inconvenience, but in practice the hotspot should always reuse the same network and IP addresses for Pi (br0) and sensors. So configuring WG shouldn't be an issue

I'm afraid I've no idea how to implement all of that with Network Manager, sorry. For what I understand, br0 would be a "bridge" and wlan0 and usb0 would be "bridge-slaves."

HTH

PS: Leave bond* alone, these have nothing to do with your application.

Statistics: Posted by epoch1970 — Thu Aug 08, 2024 12:23 pm



Viewing all articles
Browse latest Browse all 4848

Trending Articles