this sets up the routing table for the allowed IPs to go through.
You should now be able to ping the VPS end of the connection, but only that /24 network because all other destinations (like 8.8.8.8) are not allowed (because they are not in the allowed IPs range).
Yes, I can ping 10.66.66.1 on OpenWrt now! Thanks!
So what do I need to do on my VPS to route 10.0.0.0/23 via 10.66.66.100?
Thanks a lot!
(If it'd take too much time to explain, knowing what keywords I can use to find what I want would really help too )
If I had to guess, you'd be adding the route using the linux route command (assuming your VPS is running linux). Something like this: $ ip route add 10.0.0.0/23/ via 10.66.66.100
On my VPS, I ran ip route add 10.0.0.0/23 via 10.66.66.100 dev wg0, the route was added to the routing table.
However, when I ping any address in 10.0.0.0/23, there's no response.
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
From 10.66.66.1 icmp_seq=1 Destination Host Unreachable
ping: sendmsg: Required key not available
I feel like this means that 10.0.0.10 is being send to 10.66.66.100, which instead of sending it back to OpenWrt, sends it to 10.66.66.1 as it's the gateway for 10.66.66.100. Am I correct?
I tried to use traceroute to have a clearer picture, but it wouldn't run.
traceroute to 10.0.0.10 (10.0.0.10), 30 hops max, 60 byte packets
send: Required key not available
What do I need to do to fix the routing table? Thanks!
Required key not available I think is a Wireguard error related to having the keys improperly installed.
Each site needs a unique private key. Derive the site's public key from that private key and install it in the peers section at the other end of the link. I think that preshared keys need not be unique. You can disable preshared keys entirely until things are working.
Then run wg at each site and confirm that handshakes are occurring.
Next, can you ping the tunnel 10.66.66 addresses from each site? This should work both from the VPS to or from a client, as well as from one client to another. The VPS will switch the packets through as long as the base 10.66.66.0/24 via wg0 route is in place. Specific routes are not needed to ping among the tunnels related to the same wg server.
I ssh-ed into the VPS and pinged 10.0.0.1 over there. I did this in order to see if the route ip route add 10.0.0.0/23 via 10.66.66.100 is working, and it's not .
Then run wg at each site and confirm that handshakes are occurring.
WireGuard is working, there are handshakes. From each client peer of WireGuard I can ping every other client (e.g. 10.66.66.10) without issue.
The Required key not available error only occurs when I ping a client of OpenWrt LAN from VPS (I ssh-ed into that server and pinged 10.0.0.1), which I think might be related to the route I created not working properly, but I'm not sure.
Yes, I understood the problem.
The issue is that you are not using any prefix length and it is implied that this address is a single host.
This is correct:
list allowed_ips '0.0.0.0/1'
list allowed_ips '::/0'
list allowed_ips '128.0.0.0/1'
Also on VPS allowed IPs for the peer must include the lan addresses AllowedIPs = 10.66.66.100/32,fd42:42:42::100/128,10.0.0.0/23'