#"Subnet Routing" with Wireguard and CasaOS

35 messages · Page 1 of 1 (latest)

azure patrol
#

Hi everyone 👋. I've almost setup my wireguard perfectly but am missing 1 feature. I want to know how to access other devices kn my network.

Can anyone help me with my Wireguard problem. I've got it setup and it is working so I can access everything on my CasaOS (Jellyfin, Immich and Files) But I am wondering if it is possible while using WG-Easy if I can setup a "Subnet Route" so that I can turn on my Gaming PC with WOL and access it with Moonlight/Sunshine. And maybe even my orinter but OC is definatley the priority. Is this possible and if so what is it called / is there a guide?

Any help will be greatly appreciated.

hardy rose
#

With wireguard you tell in the configuration file which subnets you should be able to access via the tunnel.
This is called split-tunnel

#

its usually listed like: AllowedIPs = 0.0.0.0/0 <- means no split-tunnel and route all traffic through.
AllowedIPs = 192.168.0.0/24 <- means that only traffic destined for 192.168.0.XXX/24 is routed via the wireguard tunnel

azure patrol
#

Would I change my allowed ips in Wg0.conf?

slate bloomBOT
#

GG @azure patrol, you just advanced to level 1!

hardy rose
#

on the client side, it would potentially be wg0.conf

azure patrol
#

Okay so I should use a split tunnel to access my casa server and devices on my network???

hardy rose
#

this config allows this particular client access to 192.168.122.0/24

#

Yes, you should only route the traffic you want routed via the tunnel

azure patrol
#

What file was this in for you?

hardy rose
#

this would be the client side, Linux it would be /etc/wireguard/wg0.conf

azure patrol
#

Okay thank you... I have one more question. CasaOS overwrites any changes I make in that file. Should I change it on the Linux side? And not via the CasaOS webui

hardy rose
#

Are your goal here to have the CasaOS server to be the VPN endpoint (server) or as a Client?

azure patrol
#

Endpoint so I have WG setup on CasaOS, and have connected my device through the QR codes

hardy rose
#

Using the WG-Easy Application?

azure patrol
#

Yeah the one that is on the CasaOS appstore

hardy rose
#

Grand, so your device will then when you go via the QR Code, you will have to amend the client config for the allowedips

azure patrol
#

This ^

hardy rose
#

you need to remove 0.0.0.0/0

#

and ::0/0

azure patrol
#

I did that and it still isn't working do I need to add something in the server side?

slate bloomBOT
#

GG @azure patrol, you just advanced to level 2!

hardy rose
#

Are you doing these things while you are on mobile network and outside of the WiFi?

azure patrol
#

Yes... I changed it then resterted wireguard and disconnected and reconnected

hardy rose
#

What is the IP for the server/machine you want to connect to via VPN?

azure patrol
#

192.168.68.131 - CasaOS
192.168.68.112 - Gaming PC
192.168.68.111 - Phone

hardy rose
#

So, if you disconnect the phone from the wifi, and then attempt to do http://192.168.68.131 with the Wireguard tunnel active

azure patrol
#

Yes I'm able to access my CasaOS server via that IP when on data

hardy rose
#

Then your wireguard VPN connection is working 🙂

azure patrol
#

Omg it is cause I can also access my moonlight

#

Sorry I feel like I've waster your time

#

Thank you so so much for your help

hardy rose
#

You have not, sometimes it just takes some brain churning to get to the final destination