Hello everyone. I start this by saying I'm a total noob on vpn & wireguard things & iptables in general
I've read on various tutorial about using wireguard to do a tunnel NAT-NAT (or LAN to LAN?) between two openwrt/lede routers.
This would be awesome for my use case (shop + home) but I struggle to understand how to configure it
I've set house lan to 192.168.0.x range and shop lan to 192.168.1.x range and set-up like this:
I also added wireguard interface to the lan firewall zone on both.
The two routers look like to be connected (handshake sent and bytes transfered) but can't ping any host of "other side"
I imagine I've got to add routes to allow traffic to get router through wireguard but I don't really know how. I've tried several times but I obtain only whole lan traffic to travel to wg instance (cutting down my web connection) so if anyone can help with correct steps it would be awesome (and I think useful for other people too maybe)
Yes, you can do this on the LuCI web GUI at Network > Static Routes, or by making route config in /etc/config/network:
on the Shop router, you make a route to 192.168.1.0/24 via Wireguard
then, on the Home router, you make a route to 192.168.3.0/24 via Wireguard
make sure Masquerade is NOT checked on the Wireguard firewall zones
don't forget to ALLOW FORWARD from LAN to your Wireguard zone on BOTH routers
If you do this, you can disable the "Route Allowed IPs" option when configuring the Interfaces
Lastly create routes to the subnets that will be at the far-end of the tunnel (i.e. allowed 192.168.3.0/24 on the home router and allowed 192.168.1.0/24 on shop)
And also tried to route 192.168.1.0 with 255.255.255.0 netmask to wireguard interface on shop network but as soon as I do that I loose any access to router / wan (I guess that any traffic in lan goes through WG only and not in local anymore?)
So I had to restart router and kill network connection to be able to access router and remove the route
I need to figure out what I did wrong, thanks for the help!
Oh so it only needs to have different subnets?
Then I think it should be ok like it is
Shop: 192.168.1.x for lan
House: 192.168.0.x for lan
I used 192.168.3.x only for wireguard interface assigned ip (on both routers)
There are no other devices on different subnets
The problem as said is if i route 192.168.1.x (lan addresses) to wg interface on shop everything gets locked down
Same at house (just tried) if i route 192.168.0.x (lan addresses) to wg interface, everything locked down
With "lock down" I mean I cannot even ping router anymore, there is no lan or wan access
This is the thing I cannot seem able to understand. I should route my own lan ip addresses to wg interface on both routers and it should work... like if I then ping from house a 192.168.1.1 address I should get it from the "shop lan"
Thank you! This final post was perfectly clear and solved the issue
I added routes to the other end, also added firewall forward TO lan (I only used "from lan" before)
Deactivated "add routing for allowed ips" from wireguard and all works fine! ^^
Sorry for taking so much but I finally understood
I can't believe I was so stupid
If you travel to Italy a pizza and beer is waiting, haha