This forum has been archived. All content is frozen. Please use KDE Discuss instead.

IPTables, block upload speed

Tags: None
(comma "," separated)
imported4-JackR
Registered Member
Posts
6
Karma
0

IPTables, block upload speed

Fri Dec 14, 2007 2:47 pm
Hi
I am not a good in Linux and IPTables, but i wrote some lines to allow BitTorrent traffic. It works but i noticed that uploading is block (download speed is ok). I see some uploading traffic but it very fast disaperes. When i clear IPTables it suddenly goes to max of my uploading limit.
I am using kTorrent 2.2.4. Seeting in kTorrent is:
Code: Select all
TCP 6880
UDP 4444

My seetings in iptables:
Code: Select all
iptables -I INPUT 1 -p tcp --sport 6880:6889 -j ACCEPT
iptables -I OUTPUT 1 -p tcp --sport 6880:6889 -j ACCEPT
iptables -I INPUT 2 -p tcp --sport 6969 -j ACCEPT
iptables -I OUTPUT 2 -p tcp --sport 6969 -j ACCEPT
iptables -I INPUT 3 -p udp --dport 4444-j ACCEPT
iptables -I OUTPUT 3 -p udp --dport 4444-j ACCEPT


Greetings
George
Moderator
Posts
5421
Karma
1

Sat Dec 15, 2007 7:14 pm
What is the default policy on the OUTPUT chain ?

KT will use random source ports for setting up outgoing connections, and if the default policy is DROP, then not much will get out.
imported4-JackR
Registered Member
Posts
6
Karma
0

Sat Dec 15, 2007 7:47 pm
I have accept on outgoing connecition
Code: Select all
iptables -P OUTPUT ACCEPT
amorphis
Registered Member
Posts
8
Karma
0

Sun Dec 16, 2007 3:44 am
hi JackR

you needn't have to enable port 4444, you can remove those lines. instead of this in KTorrent you should choose a higher port number instead of 6880, something between 50000 and 60000, and use that one in the iptables, for example:

Code: Select all
iptables -A INPUT -p tcp --dport 53220 -j ACCEPT
iptables -A INPUT -p udp --dport 53220 -j ACCEPT

iptables -A OUTPUT -p tcp --dport 53220 -j ACCEPT
iptables -A OUTPUT -p udp --dport 53220 -j ACCEPT


so I think the key is that you forgot to enable the UDP port. these four lines all you need. and don't forget to reboot your machine after the changes. :)
imported4-JackR
Registered Member
Posts
6
Karma
0

Sun Dec 16, 2007 6:47 pm
I see, i will try it, but i don't understand this:
Code: Select all
so I think the key is that you forgot to enable the UDP port
because i have enabled UDP port, number 4444.
amorphis
Registered Member
Posts
8
Karma
0

Mon Dec 17, 2007 1:07 am
JackR wrote:I see, i will try it, but i don't understand this:
Code: Select all
so I think the key is that you forgot to enable the UDP port
because i have enabled UDP port, number 4444.


"UDP tracker port" is another thing. you have to enable the main port, the same value both for TCP and UDP connections.
imported4-JackR
Registered Member
Posts
6
Karma
0

Mon Dec 17, 2007 1:27 am
Ok, now i understand, and your advice is working.
THANKS :D
walidaly
Registered Member
Posts
5
Karma
0

Sat Mar 15, 2008 6:08 pm
I think I had the same problem, I deny all incoming connections but I was still uploading!
do I have to open outgoing and incoming ports?


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]