binhex / arch-rtorrentvpn

Docker build script for Arch Linux base with ruTorrent, rTorrent, autodl-irssi, Privoxy and OpenVPN
GNU General Public License v3.0
238 stars 35 forks source link

How to open external ports? #186

Closed rudnypc closed 2 years ago

rudnypc commented 2 years ago

I would like to open rutorrent gateway, tried to change LAN_NETWORK to my public IP, ip docker network... I can open rutorrent interface but vpn can't check port, but when a flush all nat commands , Rutorrent is accessible only with airvpn ip:port, and the incoming works, but within my network the rutorrent stops accessing.

When I flush all iptables, the incoming port works but the rutorrent is not acessible in local network:

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

my command:

docker run -d \
    --cap-add=NET_ADMIN \
     --privileged=true \
    -p 9080:9080 \
    -p 9443:9443 \
    -p 8118:8118 \
    --name=rtorrentvpn \
    -v /data/rtorrent/data:/data \
    -v /data/rtorrent/config:/config \
    -v /etc/localtime:/etc/localtime:ro \
    -e VPN_ENABLED=yes \
    -e VPN_PROV=airvpn \
    -e VPN_CLIENT=openvpn \
    -e ENABLE_PRIVOXY=yes \
    -e ENABLE_AUTODL_IRSSI=yes \
    -e ENABLE_RPC2=yes \
    -e ENABLE_RPC2_AUTH=yes \
    -e ENABLE_WEBUI_AUTH=yes \
    -e RPC2_USER=admin \
    -e RPC2_PASS=PASSWORD\
    -e WEBUI_USER=admin \
    -e WEBUI_PASS=PASSWORD\
    -e LAN_NETWORK=172.17.0.0/16 \
    -e NAME_SERVERS=209.222.18.222,84.200.69.80,37.235.1.174,1.1.1.1,209.222.18.218,37.235.1.177,84.200.70.40,1.0.0.1 \
    -e VPN_INPUT_PORTS=11763 \
    -e VPN_OUTPUT_PORTS=5678 \
    -e DEBUG=false \
    -e PHP_TZ=UTC \
    -e UMASK=000 \
    -e PUID=0 \
    -e PGID=0 \
    binhex/arch-rtorrentvpn
rudnypc commented 2 years ago

I discovered a new thing I put PUT the VPN_OUTPUT_PORTS and VPN_OUTPUT_PORTS with the same config. when the container started, Run the command and the port incoming now is working.

iptables -t mangle -D OUTPUT -p tcp -m tcp --sport 11763 -j MARK --set-xmark 0x3/0xffffffff