I have wireguard server and client configured as follows:
Server:
[Interface]
PrivateKey = <server private key>
Address = 192.168.2.4
ListenPort = 51821
[Peer]
PublicKey = <client public key>
AllowedIPs = 172.20.10.5/32
Client:
[Interface]
PrivateKey = <client private key>
Address = 172.20.10.5
[Peer]
PublicKey = <server public key>
AllowedIPs = 192.168.2.4/32
Endpoint = <Public IP>:51821
PersistentKeepalive = 25
When I start both of them, my client cannot ping any machine in the server's network. In the borowser, the ip is still client's internet IP. When I run wg
on client, it shows some data are sent while 0 data received in transfer info.
Is there any obvious error in my configuration? If not, what's a common way to troubleshoot?
Maybe try:
Server:
[Interface]
PrivateKey = <server private key>
Address = 10.200.200.1/24
ListenPort = 51821
[Peer]
PublicKey = <client public key>
AllowedIPs = 10.200.200.2/32
client:
[Interface]
PrivateKey = <client private key>
Address = 10.200.200.2/32
[Peer]
PublicKey = <server public key>
AllowedIPs = 10.200.200.1/24
Endpoint = <Public IP>:51821
PersistentKeepalive = 25
I have not tried with the AllowedIPs option so I cannot guarantee that it would work. I can guarantee that it works by removing these lines. But hopefully you have already figured out yourself!!
I have made a tutorial if it helps: https://github.com/agavrel/wireguard_cloud
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With