Fix Comcast or University BitTorrent Connection Killing on Ubuntu
I was searching the web for a fix for this fuq'd up problem about Comcast and Universities limiting connections with Sandvine. I have many reasons to believe qwest and other internet service providers are going to start limiting your torrent connections which is bullshit. Bittorrent is indeed hard on ISP's with thousands of syn/ack and tcp connection to and from your computer. I have read BANDWIDTH CHALLENGE TO PUSH LIMITS OF TECHNOLOGY and it seems bandwidth is surpassing technology and ISP's need to upgrade, but anyways who's fault is that? Not ours, screw them!
Here is a script that will block the RST packets that reset your connections:
1) open a terminal
2) sudo -s
3) cd /etc/init.d/
4) type cat >>bitfix
5) paste script below:
#!/bin/sh
#Replace 6883 with you Bittorent Port
BT_PORT=6883
#Flush the filters
iptables -F
#Apply new filters
iptables -A INPUT -i lo -j ACCEPT
#Comcast BitTorrent seeding block workaround
iptables -A INPUT -p tcp --dport $BT_PORT --tcp-flags RST RST -j DROP
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#BitTorrent
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport $BT_PORT -j ACCEPT
iptables -A INPUT -m state --state NEW -m udp -p udp --dport $BT_PORT -j ACCEPT
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited
exit
6) chmod +x bitfix
7) ./bitfix
Your ipchains firewall is now configured and you should have great upload speed now. You will have to run this script every boot.
I left out the rule to let through established connections, -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
Now you if you use Transmission or any other Bittorent client you may have to edit the port
Transmission uses port 9090
Credits