LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-11-2019, 05:59 AM   #1
kitsios
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Rep: Reputation: 0
Bittorrent port forwarding with iptables


I have a qBittorrent client on a device that is connected to another(which has a public ip) using OpenVPN, and I am trying to forward port 6881. The port is open(nmap shows it as open) but there is no traffic, and the client reports 0 DHT nodes. This is the map with the network interfaces.

Internet <- (venet0) host (tun0) <- (tun0) client

host venet0 ip: 193.148.69.152
host tun0 ip: 10.9.8.1
client run0 ip: 10.9.8.3

host iptables:
Code:
# iptables -nvL
Chain INPUT (policy ACCEPT 56 packets, 2938 bytes)
 pkts bytes target     prot opt in     out     source               destination         
21926 7250K ACCEPT     all  --  venet0 *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT 3 packets, 156 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    8   384 ACCEPT     tcp  --  venet0 tun0    0.0.0.0/0            10.9.8.3             tcp dpt:6881
    2    56 ACCEPT     udp  --  venet0 tun0    0.0.0.0/0            10.9.8.3             udp dpt:6881

Chain OUTPUT (policy ACCEPT 2281 packets, 188K bytes)
 pkts bytes target     prot opt in     out     source               destination

# iptables -nvL -t nat
Chain PREROUTING (policy ACCEPT 136 packets, 8452 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    8   368 DNAT       tcp  --  venet0 *       0.0.0.0/0            0.0.0.0/0            tcp dpt:6881 to:10.9.8.3
   13   364 DNAT       udp  --  venet0 *       0.0.0.0/0            0.0.0.0/0            udp dpt:6881 to:10.9.8.3

Chain POSTROUTING (policy ACCEPT 31 packets, 1999 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    6   280 SNAT       tcp  --  *      tun0    0.0.0.0/0            10.9.8.3             tcp dpt:6881 to:10.9.8.1
   15   420 SNAT       udp  --  *      tun0    0.0.0.0/0            10.9.8.3             udp dpt:6881 to:10.9.8.1

Chain OUTPUT (policy ACCEPT 31 packets, 1999 bytes)
 pkts bytes target     prot opt in     out     source               destination
client iptables:
Code:
# iptables -nvL
Chain INPUT (policy ACCEPT 1269K packets, 1117M bytes)
 pkts bytes target     prot opt in     out     source               destination         
   58  2696 ACCEPT     tcp  --  tun0   *       0.0.0.0/0            0.0.0.0/0            tcp dpt:6881
   19   532 ACCEPT     udp  --  tun0   *       0.0.0.0/0            0.0.0.0/0            udp dpt:6881

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  26M   24G ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
83832 7218K ACCEPT     all  --  br0    *       0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy ACCEPT 854K packets, 161M bytes)
 pkts bytes target     prot opt in     out     source               destination
I can't figure out what's missing, since NAT is set up and the port is open.
 
Old 06-12-2019, 11:33 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 11,626
Blog Entries: 9

Rep: Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077Reputation: 3077
Bittorrent uses various dynamically changing ports; I suspect rerouting just one isn't enough to make it work.
 
Old 06-14-2019, 05:52 AM   #3
kitsios
LQ Newbie
 
Registered: Oct 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I have set qBittorrent to use port 6881. Is it possible to do UPnP with iptables?.
 
  


Reply

Tags
bittorrent, forward, iptables, port


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] IPtables : ssh port forwarding one port to another port issue routers Linux - Networking 7 08-07-2018 08:41 AM
[SOLVED] Port forwarding in Bittorrent client in internal network with nat lgp171188 Linux - Networking 8 04-09-2010 07:29 PM
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 04:36 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
NAT'ing RC.FIREWALL Script & Port Forwarding Bittorrent wlfdgcrkz Linux - Networking 2 08-24-2004 10:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration