LinuxQuestions.org
Visit Jeremy's Blog.
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 08-24-2004, 08:28 PM   #1
wlfdgcrkz
Member
 
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 (192.168.1.3.)

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
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Something like this?

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

Code:
IPTABLES -t nat -A PREROUTING -i $EXT -p tcp --dport 6881:6889 -j DNAT --to 192.168.1.3
IPTABLES -t nat -A PREROUTING -i $EXT -p udp --dport 6881:6889 -j DNAT --to 192.168.1.3
 
Old 08-24-2004, 10:08 PM   #3
wlfdgcrkz
Member
 
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 192.168.1.3
iptables -A FORWARD -p tcp -i ppp0 --dport 6881:6889 -d 192.168.1.3 -j ACCEPT

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


Reply


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 12:20 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration