LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   iptables question (http://www.linuxquestions.org/questions/red-hat-31/iptables-question-4175447693/)

l0rddarkf0rce 01-29-2013 09:23 AM

iptables question
 
I have a machine that has 3 NICs serving as a GW (eth0 192.168.1.0/24, eth1 10.0.1.0/24, and eth2 10.0.2.0/24) I have one machine in each of 10.0.1.0 and 10.0.2.0 that I need to be able to access from the 192.168.1.0 network. So my idea is to set up port forwarding so that all traffic sent to that port gets forwarded to the corresponding machine. For example if my GW is 192.168.1.1 and I point a browser to 192.168.1.1:10013 it get forwarded to 10.0.1.3:80.

How would I write the rule(s) to get this working. TIA.

d072330 01-29-2013 03:08 PM

If it were me I would create a forward rule like this:

Quote:

If protocol is TCP and destination is 192.168.1.1 and destination port is 80 and state of connection is NEW,RELATED,ESTABLISHED
Then a NAT rule like so:

Quote:

If protocol is TCP and destination is 10.0.1.3 and destination port is 80
If 192.168.1.1 is your default gateway you might look at installing Endian Firewall:



All times are GMT -5. The time now is 02:55 PM.