0

I have installed Wireguard server on my raspberry pi using pivpn. Everything works well except for one thing. The raspberry server has ip adress 10.6.0.1. I have a simple socket messenger written in python, if I run the server of this messenger on my rasberry pi, which has ip adress 10.6.0.1, then other clients of the VPN network cannot connect to it. Moreover, if I start the messenger server on a machine with ip 10.6.0.2, then other clients of the VPN network will be able to connect safely. The router has forwarded port 1776 for wireguard and 9090 for the messenger server. Is there any way to fix this? My wg0 config looks like this:

[Interface]
PrivateKey = private key
Address = 10.6.0.1/24
ListenPort = 1776

[Peer]
PublicKey = 5CxlSHSk/0i4FmqLq4xitCfVDXioW3oYOGpxsfunxXQ=
PresharedKey = preshared key
AllowedIPs = 10.6.0.2/32 

Client config:

[Interface]
PrivateKey = private key
Address = 10.6.0.2/24
DNS = 8.8.8.8, 8.8.4.4

[Peer]
PublicKey = PFcJ1oSvCoIZxjxJzVk+aczXiYXE7wPiCDDXBjEMk1c=
PresharedKey = preshared key
Endpoint = mydomain.com:1776
AllowedIPs = 0.0.0.0/0, ::0/0 

Netstat outuput(https://i.stack.imgur.com/C19ja.jpg)

20
  • Your router would not (and could not) be forwarding port 9090 to 10.6.0.1, it would be forwarding to your regular LAN IP address (192.168.x.x most likely) - so, if your messenger server is only listening on 192.168.x.x then of course your messenger clients can't connect to 10.6.0.1 and expect to get connected Feb 3 at 22:26
  • @Jaromanda X So is there any way to fix it?
    – Traa1134
    Feb 4 at 6:36
  • no idea, because I have no idea what your messenger server is listening to ... do you know? Feb 4 at 9:42
  • @Jaromanda X on the router the rule looks like ip=10.6.0.1 port=9090 And in the massager code there are these lines host = 10.6.0.1 port = 9090
    – Traa1134
    Feb 4 at 9:58
  • how does your router know what computer 10.6.0.1 is? Feb 4 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.