Jump to content
TorGuard
  • 0

wireguard docker container port forwarding

Rate this question


sabot105mm
 Share

Question

Im trying to setup portfowarding inside linuxserver/wireguard docker container.

I have been successful in connecting and acquiring an IP address from the linuxserver/wireguard container, port forwarding however is proving very difficult. In the docker containers terminal shell typing curl ifconfig.io 146.70.51.98 gives me what I’m expecting, IP address for Miami - I am able to download at full speed of my internet connection, everything seems to work as I expect, except for portfowarding. Which brings to what I really need help with port forwarding. Inside qbittorrent in settings under Port used for incoming connections: 50201. 50201 is unreachable how can I fix?

 
 VVVVV Inside torguard.net VVVVV
  1. Request Port Forward
 
 
 
tcp:50201,udp:50201 146.70.51.98 Active
 
# TorGuard WireGuard Config
[Interface]
PrivateKey = XXX
ListenPort = 51820
MTU = 1292
DNS = 10.9.0.1,10.8.0.1
Address = 10.13.26.1/24
PostUp = FORWARDEDPORT=50201; iptables -A INPUT -i wg0 -p udp --dport $FORWARDEDPORT -j ACCEPT; iptables -A INPUT -i wg0 -p tcp --dport $FORWARDEDPORT -j ACCEPT; DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route add $HOMENET3 via $DROUTE;ip route add $HOMENET2 via $DROUTE; ip route add $HOMENET via $DROUTE;iptables -I OUTPUT -d $HOMENET -j ACCEPT;iptables -A OUTPUT -d $HOMENET2 -j ACCEPT; iptables -A OUTPUT -d $HOMENET3 -j ACCEPT;  iptables -A OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT
PreDown = FORWARDEDPORT=50201; iptables -D INPUT -i wg0 -p udp --dport $FORWARDEDPORT -j ACCEPT; iptables -D INPUT -i wg0 -p tcp --dport $FORWARDEDPORT -j ACCEPT; HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route del $HOMENET3 via $DROUTE;ip route del $HOMENET2 via $DROUTE; ip route del $HOMENET via $DROUTE; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -d $HOMENET -j ACCEPT; iptables -D OUTPUT -d $HOMENET2 -j ACCEPT; iptables -D OUTPUT -d $HOMENET3 -j ACCEPT
[Peer]
PublicKey = XXX
AllowedIPs = 0.0.0.0/0
Endpoint = 146.70.51.98:1443
PersistentKeepalive = 25
 
 
Docker-compose
version: "2.1"
services:
  wireguard:
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
    volumes:
      - /home/gary/docker/wireguard-client:/config
      - /lib/modules:/lib/modules
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent
    container_name: qbittorrent
    network_mode: service:wireguard
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/New_York
      - WEBUI_PORT=8088
    volumes:
      - /home/gary/docker/qbittorent:/config
      - /mnt/winshare:/downloads
    restart: unless-stopped
    ports:
      - 8088:8088 #qbittorrent gui port
      - 50201:50201 #Ports used for incoming connections: qbit listening port
      - 50201:50201/udp #Ports used for incoming connections: qbit listening port
 

Screen Shot 2022-07-17 at 4.13.16 PM.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

weirdly enough changing protocol from UDP to TCP in the setting for qbittorrent shows 50201 as reachable?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...