Report this

What is the reason for this report?

Join 2 different subnets Wireguard VPN

Posted on March 10, 2021

I have setup a small Wireguard VPN network between 3 devices:

  • Digital Ocean VPS (server, 10.222.0.1)
  • Raspberry Pi on my home network (peer, 10.222.0.2)
  • iPhone 11 (peer, 10.222.0.3)

From any device, I can ping the others. The VPN is functional. What I want now is for the iPhone (which is outside of my home network) to see an IP camera on my home network which has an IP address of 192.168.1.64. This is beyond my capabilities to do alone so I was looking for some assistance.

Ultimately, I need the iPhone which his entering the Pi to be connected/routed from the 10.222.0.x subnet to the 192.168.1.x subnet.

Would appreciate an suggestions, thanks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi,

I believe the most convenient way to get an access to your camera (and the other home LAN nodes) through VPN would be to configure your home router to interconnect your home LAN and VPN. In that case, your router must have WireGuard VPN software implemented or must give you a chance to download, install, and configure it. Good example of latter ones are routers based on OpenWRT OS. However, there are another ways for some network brands, e.g. for Ubiquity router you can check relevant project on GitHub, for MikroTik you can check their beta 7.xx RouterOS that includes WireGuard VPN (since release 7.1beta2), etc. Having a router that supports WireGuard VPN, its configuration would be similar to any other peer in your VPN network. Additionally, you would have to open a particular port in its firewall, and add a static route for traffic from LAN to VPN, however, it may be added automatically during WireGuard (wg) interface configuration. You need to allow IPs of your home LAN subnet in iPhone’s WireGuard configuration as well.

If your router does not support WireGuard VPN software, it may still be possible to access your camera through VPN. Check if your camera embedded software allows you to add a static route. Then, you might use your Raspberry Pi as a gateway to VPN.

Hi there,

What I would usually do in this case is to setup PiVPN on the Raspberry Pi. That way you will be able to connect to the PiVPN directly and access all of the devices on your home network.

Regards, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.