qwj / python-vpn

VPN Server implemented in pure Python. (For Research Purposes Only)
MIT License
357 stars 101 forks source link

VPN not relaying any traffic #7

Open julianneswinoga opened 2 years ago

julianneswinoga commented 2 years ago

Running pvpn as a wireguard server:

$ .venv/bin/python -m pvpn -wg 51820 -v
Serving on UDP :500 :4500...
======== WIREGUARD SETTING ========
PublicKey: -----
===================================
Serving on UDP :51820 (WIREGUARD)...

I have a rule to forward all traffic to 1.2.3.4 through the wireguard interface (just for testing): ip route add "1.2.3.4/32" dev wg0 proto static

but when I try to get a webpage hosted on that server: $ wget 1.2.3.4

pvpn doesn't send any traffic back, it only spams verbose logs about a TCP connection from an ever increasing port:

login ('127.0.0.1', 35044) 225959148
TCP 127.0.0.1:53316 -> 162.247.224.52:80
TCP 127.0.0.1:53318 -> 162.247.224.52:80
TCP 127.0.0.1:53320 -> 162.247.224.52:80
TCP 127.0.0.1:53322 -> 162.247.224.52:80
TCP 127.0.0.1:53324 -> 162.247.224.52:80
TCP 127.0.0.1:53326 -> 162.247.224.52:80
TCP 127.0.0.1:53328 -> 162.247.224.52:80
TCP 127.0.0.1:53330 -> 162.247.224.52:80
<forever>

This is all running locally on one machine, I would expect that pvpn would simply act as a relay for the traffic. Am I misunderstanding something? Do I have a wrong configuration? I'm not really sure how the -r and -ur parameters are supposed to be used. :disappointed: