I have set up Wireguard in LXC container in Proxmox on my home network. When I am in my parents house and activate connection while being on phone hotspot everything is fine, I can access every IP address like (192.168.1.1 as my router page or 192.168.220 as my OMV server). Unfortunately when I’m on my parents WiFi network and activate connection I cannot access that resources. It can only connect to 192.168.1.1 as their router page. How do I command VPN-connected devices to look for IPs inside VPN tunnel instead of local network?
Apparently you share the same network on both locations. I see two possibilities:
- Renumber one side and choose a not so common private network range. This would be my recommondation.
- Assuming you use a /24 network you can add two more specific routes into your smarthones AllowedIPs:
192.168.1.0/25
and192.168.1.128/25
. The router’s config page probably still won’t be accessible but the rest should work.
So You recommend that I change my local network adresses to let’s say 192.168.28.1 /24?
With number 2 you solved the problem I was having. Can you explain why adding “0.0.0.0/0, 192.168.1.0/25, 192.168.1.128/25” routes internet and lan through the vpn but simply adding “0.0.0.0/0” only works for internet?
Shouldn’t 0.0.0.0/0 be enough?
0.0.0.0/0 creates a new default route which has the lowest priority.
On your computer you have a route for your LANs /24 network. Therefore the default route is never evaluated, because your computer knows a better route. By adding two /25 netorks you create an even better route for your computer which is then preferred.
Hard to explain to be honest without deep diving into how IP routing works. Maybe google for “more specific route”. This should return a longer, better explanation.