nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

bittorrent firewall iptables

This is a discussion on bittorrent firewall iptables within the Linux software forums, part of the Linux Getting Started category; Anyone any idea what i need to setup, i want secure script or something plz...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 01-06-2006, 01:03 AM
Guest
 
Posts: n/a
Default bittorrent firewall iptables

Anyone any idea what i need to setup, i want secure script or something plz
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-08-2006, 01:58 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Following script does all the stuff you want, It It allows all outgoing traffic from your box but only incoming bittorrent request. It open tcp ports 6881:6999

Code:
#!/bin/sh
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
modprobe ip_conntrack
modprobe ip_conntrack_ftp

# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT

# Unlimited access to loop back
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# Allow UDP, DNS and Passive FTP
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

#allow bittorent incomming client request
iptables -A INPUT -p tcp --destination-port 6881:6999 -j ACCEPT

#Uncomment below to allow sshd incoming client request
#iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT

# DROP everything and Log it
iptables -A INPUT -j LOG
iptables -A INPUT -j DROP
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
ISO files to be served via bittorrent in FreeBSD dhanesh All about FreeBSD/OpenBSD/NetBSD 0 10-11-2007 05:14 PM
Redhat linux 4 / 5 disable iptables firewall chiku Networking, Firewalls and Security 0 04-27-2007 06:19 PM
iptables linux firewall laptop script for Airtel DSL raj Linux software 1 12-14-2006 06:11 PM
Bittorrent Packages sbhupathireddy Linux software 1 11-14-2006 04:53 PM
iptables bittorrent not working Linux software 2 01-25-2006 08:52 PM


All times are GMT +5.5. The time now is 09:07 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36