I would like to connect 2 private LAN's via wireguard.
The private LAN's are using ipv4 while the connection between wireguard has to be ipv6.
Both sites are using the same hardware.
The internet connection is established via a AVM DSL-Router. The OpenWrt Router (NanoPi's) are configured as IPv6 exposed hosts and they are the only devices connected to the AVM devices.
The connections are up and running. When I login via ssh to the NanoPi I can ping or ssh to all devices at the remote site.
So I can confirm the connection is established as expected.
When I set "route_allowed_ips=0" then I can't access remote devices anymore.
Configuration site A
network.wg0=interface
network.wg0.proto='wireguard'
network.wg0.public_key='XXX'
network.wg0.private_key='XXX'
network.wg0.listen_port='22222'
network.wg0.addresses='172.16.0.20/32'
network.@wireguard_wg0[0]=wireguard_wg0
network.@wireguard_wg0[0].description='Site A'
network.@wireguard_wg0[0].public_key='XXX'
network.@wireguard_wg0[0].private_key='XXX'
network.@wireguard_wg0[0].endpoint_host='myipv6.dynv6.net'
network.@wireguard_wg0[0].endpoint_port='22122'
network.@wireguard_wg0[0].persistent_keepalive='25'
network.@wireguard_wg0[0].allowed_ips='172.16.0.10/32' '192.168.10.0/24'
network.@wireguard_wg0[0].route_allowed_ips='1'
But no device at the LAN site can access a device on the remote site. So I guess I had to add a (static) route rule to make this work.
But I can't figure out how to do this.
Found this, but with my limited knowledge and only a little english I did not understand what to do.
Specifies the logical interface name of the parent (or master) interface this route belongs to;
What interface I have to use?
LAN, as it is the LAN interface, used on both sites?
WG0, as it is the wireguard interface?
Ok "target" and "netmask" should be the values of the remote site.
i.e. 192.168.10.0 and 255.255.255.0
Network gateway. If omitted, the gateway from the parent interface is taken if any,
Hm, if omitted it's the gateway from the parent interface. But what is the parent interface? How to find out?
Is this the ip of the gateway defined for LAN? And if this is correct, why I have to specify?
Or should I use the ip of the wg0 interface here?
For the moment I have this. But I have testet dozens of combinations. But nothing worked.
network.@route[0].interface='lan'
network.@route[0].gateway='192.168.20.1'
network.@route[0].target='192.168.10.0'
network.@route[0].netmask='255.255.255.0'
begging for help now....
Henning