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 08-24-2004, 08:28 PM   #1
Registered: Apr 2003
Location: North Hollywood Ca
Distribution: RedHat FreeBSD
Posts: 130

Rep: Reputation: 15
NAT'ing RC.FIREWALL Script & Port Forwarding Bittorrent

I have a redhat 9 firewall router using the simple rc.firewall script for NAT'ng to internal boxes. The external interface is ppp0 as it is a DSL internet connection. The internal interface is eth1. I am trying to open bi-directional traffifc on ports 6881-6889 for one particular internal box (

If anyone is familiar with the simple rc.firewall script please advise me on how to append to this script to open ports for one particular internal workstation.

Thanks In Advance!
Old 08-24-2004, 08:52 PM   #2
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Something like this?

# The Internet interface. For ADSL or Dialup users, this should be "ppp0".

IPTABLES -t nat -A PREROUTING -i $EXT -p tcp --dport 6881:6889 -j DNAT --to
IPTABLES -t nat -A PREROUTING -i $EXT -p udp --dport 6881:6889 -j DNAT --to
Old 08-24-2004, 10:08 PM   #3
Registered: Apr 2003
Location: North Hollywood Ca
Distribution: RedHat FreeBSD
Posts: 130

Original Poster
Rep: Reputation: 15
Thanks homey. I messed around and finally struck gold with:

iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 6881:6889 -j DNAT --to-dest
iptables -A FORWARD -p tcp -i ppp0 --dport 6881:6889 -d -j ACCEPT

iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 49152:65535 -j DNAT --to-dest
iptables -A FORWARD -p tcp -i ppp0 --dport 49152:65535 -d -j ACCEPT


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
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
SSH port forwarding through a firewall linuxLuser Linux - Networking 1 07-14-2005 11:29 PM
Firewall + port forwarding question tomammon Linux - Security 4 09-27-2004 11:39 PM
port/firewall script question (bittorrent) ratty007 Linux - Networking 1 12-01-2003 06:36 PM
firewall port forwarding manthram Linux - Networking 0 04-01-2002 07:08 PM

All times are GMT -5. The time now is 09:21 PM.

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