LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   NAT'ing RC.FIREWALL Script & Port Forwarding Bittorrent (https://www.linuxquestions.org/questions/linux-networking-3/nating-rc-firewall-script-and-port-forwarding-bittorrent-221988/)

wlfdgcrkz 08-24-2004 08:28 PM

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!

homey 08-24-2004 08:52 PM

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


wlfdgcrkz 08-24-2004 10:08 PM

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


All times are GMT -5. The time now is 03:31 PM.