G
G
Gennady2016-08-01 12:34:32
Debian
Gennady, 2016-08-01 12:34:32

What ports need to be opened in iptables in order for Bittorrent to work on local PCs?

Hello gentlemen. There are plans to close all ports, leaving only the necessary ones open. However, I am not aware of the ports that are used by Bittorrent, and if I write, for example, these rules:

iptables -P FORWARD DROP
iptables -A FORWARD -i eth0 br0 -p tcp -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -o eth0 br0 -p tcp -m multiport --dports 53,80,139,443,445,5190 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -i eth0 br0 -p udp -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -o eth0 br0 -p udp -m multiport --dports 53,123,137,138 -m conntrack --ctstate NEW -j ACCEPT

, then torrents are not downloaded on the PC in the local area. And with the rules below, everything works fine (added only the range of open ports 0:65535):
iptables -P FORWARD DROP
iptables -A FORWARD -i eth0 br0 -p tcp -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -o eth0 br0 -p tcp -m multiport --dports 53,80,139,443,445,5190,0:65535 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -i eth0 br0 -p udp -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -o eth0 br0 -p udp -m multiport --dports 53,123,137,138,0:65535 -m conntrack --ctstate NEW -j ACCEPT

Can you please tell me what port range should be specified in iptables so that Bittorrent works on local PCs? I don't want to leave all ports open.
Sincerely.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question