Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 05-30-2009, 12:34 PM   #1
LQ Newbie
Registered: May 2009
Posts: 1

Rep: Reputation: 0
downloading bittorrent using a vpn connection

I recently built a new linux box running ubuntu 9.04 on an Asus eeebox. So far everything works great, but I am having an issue setting up my iptables rules. What I am trying to do is only allow bittorrent traffic over my vpn connection ppp0. I have created a rule to drop all bittorrent traffic over eth0 and allow all bittorrent traffic over ppp0. Currently my script is not blocking the eth0 connection, so I am still able to download over eth0. My goal is to hide my ISP's ip address and only show the VPN ip address when I am using bittorrent. Here is my iptables script. I hope someone can look at it a tell me what I have done wrong or what I am missing. Thanks in advance for all the help.


# Remove all rules and chains
iptables -F
iptables -X

# first set the default behaviour => accept connections
iptables -P INPUT ACCEPT

# Allow ESTABLISHED and RELATED incoming connection
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow loopback traffic
iptables -A INPUT -i lo -j ACCEPT
# DROP all forward packets, I don't share this internet connection
iptables -A FORWARD -j DROP
# Drop all Bittorrent packets going over eth0
iptables -A OUTPUT -o eth0 -p tcp -m multiport --dport 6881:6999 -j DROP
# Allow all Bittorent traffic going over vpn connection pp0
iptables -A OUTPUT -o ppp0 -p tcp -m multiport --dport 6881:6999 -j ACCEPT

# End message
echo " [iptables rules are set]"

Last edited by 0zon3; 06-01-2009 at 12:47 PM.
Old 06-07-2009, 10:35 AM   #2
Registered: May 2001
Posts: 29,359
Blog Entries: 55

Rep: Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545Reputation: 3545
Iptables rules work in a "first match wins" way. If something does not work the best thing is to intersperse your ruleset with "-j LOG" rules for debugging. That way it will be easier to find out what's hitting the bit bucket. BTW Bittorrent can use TCP as well as UDP.


bittorrent, ppp0, vpn

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
BitTorrent > Question about connection limits pgreptom Linux - Software 1 04-25-2009 01:17 AM
Bittorrent connection problem Synesthesia Linux - Hardware 1 04-14-2008 03:33 AM
VPN - is there a way to use VPN & normal connection at the same time? natv Linux - Networking 4 09-05-2007 08:48 AM
[SOLVED] Bittorrent: downloading Debian's iso lord_didger Linux - Software 2 06-27-2005 11:16 AM
downloading slackware using bittorrent Starch Linux - Newbie 2 02-25-2005 08:50 PM > Forums > Linux Forums > Linux - Networking

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

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