Hi, since I do not have a public IP address in my garden I want to connect my remote LAN (192.168.125.0/24) via OpenWRT LTE router with my home Fritzbox (this has a public ip) LAN (192.168.123.0/24), because I need to access a device in my remote LAN (garden with LTE) from my home LAN and other way round.
I managed to establish a connection from OpenWRT router via Wireguard to my Fritzbox, but in my Fritzbox network overview the remote devices do not appear, even not the OpenWRT Router. Did I miss sth. in the network configuration?
I am not that good in the routing topic, so many thanks for some ideas or help.
Here is a schematic how it should be (there is a pi, cause earlier the pi did the vpn tunnel to my Fritzbox, but also there I did not manage to make the 192.168.125.0/24 devices visible in my 192.168.123.0/24 network.
Names starting with wlan should be reserved for automatic assignment by the wifi UCI system.
option type bridge in a config interface is deprecated. The new syntax requires declaring bridges separately-- see br-lan and lan for an example.
Do not reference wifi devices in /etc/config/network. They are attached to network interfaces (or bridges) using option network in /etc/config/wireless.
Do you really need a separate network for the garden wifi. At least for initial testing, you may want to just add an AP to the existing lan in the garden router.
Now on to Wireguard:
If you give your wg0 interface an IP address (which is optional for point to point, but it helps greatly with testing) it needs to be a separate subnet from all of your other LANs. On the peer, configure a different IP address in the same subnet so you can test by pinging directly through the tunnel.
On the peer config, allowed_ips should be the other lan and route_allowed_ips should be on.
For testing, place the wg interface in the lan firewall zone, though this limits options for security compared to giving it a separate zone.
To be honest I mainly use the web interface and this is the output from it. I don't know, what UCI is and what is best practice. I try to follow your instructions. Do you mean that I should use the same ip network range in my remote lan like my home lan?
The two LANs have to be different such as 123 and 125 like you have. The tunnel endpoints need to be in the same subnet range as each other, but different from the other networks. For example:
House LAN 192.168.123.1/24
House wg0 192.168.200.123/24
Allowed IPs 192.168.125.0/24
Garden LAN 192.168.125.1/24
Garden wg0 192.168.200.125/24
Allowed IPs 192.168.123.0/24
Hmhh, I did not get it to work. I understand your idea, but I think this does not work in my environment, because:
your setup needs 2 OpenWrt Routers, where both routers have their wireguard configurations like you mentioned (allowed IPs etc.)
both sides need a public IP address
I have only one OpenWrt router (no public IP) and a Fritzbox 7590 (public IP) with the latest lab version. It's hard to make detailed configurations for wireguard (e. g. set the IP address of the tunnel interface). Maybe I need to add a second OpenWrt Router behind that Fritzbox, where I
connect only the devices, which have to talk through the VPN tunnel, so they only use the OpenWrt Router as default gateway
make the configurations like you mentioned on both OpenWrt routers, where the OpenWrt router behind the Fritzbox uses the Fritzbox as WAN (PPoE?)
Somewhere I read that maybe I have to make extra routing adjustments or activate masquerading in the firewall section.
So momentary I am a little stucked, but I will see. One thing is clear, I will learn something
Only one site needs a public IP. The other one makes an outgoing connection and it can do that through NAT from a private IP.
The Wireguard instance that is listening for a connection (some might call it the server) at the site with the public IP will have a listen_port configured and that port open for UDP from the Internet through the router firewall(s).
If the machine running Wireguard at the site with the pubilc IP is not the main router at that site, you will need to forward the incoming VPN port through the main router, and also install a route to the remote LAN in that main router.