Trigus42 / alpine-qbittorrentvpn

Multiarch docker image with the latest qBittorrent-nox client (WEB UI) and WireGuard/OpenVPN tunnel
GNU General Public License v3.0
73 stars 14 forks source link

Not connectable when using Wireguard #32

Closed vinhtq115 closed 1 year ago

vinhtq115 commented 1 year ago

@Trigus42 I have the same issue like you. Seems like it is not a bug from your VPN provider.

I'm hosting a Wireguard server (on a rented VPS) and it seems that while downloading works fine, my client (running on my Raspberry Pi 4 at my home) is not reachable like in the wiki. I tried port forwarding but it didn't work too.

[Interface]
PrivateKey = REDACTED
Address = 10.55.137.1/24
MTU = 1420
ListenPort = 51820

# Port forwarding
PreUp = iptables -t nat -A PREROUTING -p tcp --dport 51199 -j DNAT --to-destination 10.55.137.4
PostDown = iptables -t nat -D PREROUTING -p tcp --dport 51199 -j DNAT --to-destination 10.55.137.4

PreUp = iptables -t nat -A POSTROUTING -p tcp --dport 51199 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -p tcp --dport 51199 -j MASQUERADE

PreUp = iptables -t nat -A PREROUTING -p udp --dport 51199 -j DNAT --to-destination 10.55.137.4
PostDown = iptables -t nat -D PREROUTING -p udp --dport 51199 -j DNAT --to-destination 10.55.137.4

PreUp = iptables -t nat -A POSTROUTING -p udp --dport 51199 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -p udp --dport 51199 -j MASQUERADE

# Packet masquerading
#PreUp = iptables -A FORWARD -i wg0 -j ACCEPT
#PreUp = iptables -t nat -A POSTROUTING -o wg0 -j MASQUERADE
#PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
#PostDown = iptables -t nat -D POSTROUTING -o wg0 -j MASQUERADE

### begin Raspberry_Pi_4 ###
[Peer]
PublicKey = REDACTED
PresharedKey = REDACTED
AllowedIPs = 10.55.137.4/32
### end Raspberry_Pi_4 ###

I can confirm that my VPS' firewall is not the cause because I ran (on VPS) a python file that print received UDP packet on the 51199 port and it printed my test message sending from my Raspberry Pi (not in container).

Update: I followed this one and it seems to work. Port checking sites report that the port is open. However, tracker announcement speed is so slow.