Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wireguard VPN does not receive data from server [closed]

Tags:

wireguard

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?

like image 883
zhangjinzhou Avatar asked Nov 17 '22 07:11

zhangjinzhou


1 Answers

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

like image 137
Antonin GAVREL Avatar answered Jan 12 '23 04:01

Antonin GAVREL