LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-01-2003, 05:41 PM   #1
ratty007
LQ Newbie
 
Registered: Mar 2003
Posts: 16

Rep: Reputation: 0
port/firewall script question (bittorrent)


again im new and have a few questions i couldnt find on site.

im trying to get ident and BT working properly to the internal machine. here is what i have at the moment for FW script. i know its probably wrong hence me asking

#!/bin/sh
#
iptables -t nat -A POSTROUTING -s 10.4.20.20/24 -o eth0 -j MASQUERADE
iptables -t nat -I PREROUTING -p tcp --dport 6881:6889 -j DNAT --to-destination 10.4.20.20
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 113 -j DNAT --to 10.4.20.20:113
iptables -t nat -A PREROUTING -i eth0 -p udp --dport 113 -j DNAT --to 10.4.20.20:113
iptables -N BLOCK
iptables -F BLOCK
iptables -A BLOCK -i lo -p all -j ACCEPT
iptables -A BLOCK -o lo -p all -j ACCEPT
iptables -A BLOCK -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A BLOCK -m state --state NEW -i ! eth0 -j ACCEPT
iptables -A BLOCK -p tcp --dport 25 -j ACCEPT
iptables -A BLOCK -p tcp --dport 23 -j ACCEPT
iptables -A BLOCK -p tcp --dport 81 -j ACCEPT
iptables -A BLOCK -p tcp --dport FTP -j ACCEPT
iptables -A BLOCK -p tcp --dport SSH -j ACCEPT
iptables -A BLOCK -p tcp --dport HTTP -j ACCEPT
iptables -A BLOCK -p tcp --dport 113 -j ACCEPT
iptables -A BLOCK -p udp --dport 113 -j ACCEPT
iptables -A BLOCK -j DROP
iptables -A INPUT -j BLOCK
echo "1" >> /proc/sys/net/ipv4/ip_forward


any corrections people can suggest? BT works but i cannot see peers/seeds and the ident port additions have seemed to not work as of yet. thx in advance.
 
Old 12-01-2003, 06:36 PM   #2
ratty007
LQ Newbie
 
Registered: Mar 2003
Posts: 16

Original Poster
Rep: Reputation: 0
well an update .. taht script is now running sort of, but i can only see a certain amount of seeds/peers. im also getting tons of packet errors on eth1.
 
  


Reply



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
Firewall + port forwarding question tomammon Linux - Security 4 09-27-2004 11:39 PM
NAT'ing RC.FIREWALL Script & Port Forwarding Bittorrent wlfdgcrkz Linux - Networking 2 08-24-2004 10:08 PM
Bittorrent/Router/Firewall help chedburgh Linux - Networking 1 07-23-2004 04:29 AM
port 111 - firewall question taz76 Linux - Networking 5 04-04-2003 03:04 PM
firewall question... found open port from outside bdp Linux - Networking 3 05-07-2002 05:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:18 AM.

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