LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 01-29-2013, 09:23 AM   #1
l0rddarkf0rce
Member
 
Registered: Nov 2004
Posts: 83

Rep: Reputation: 18
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.
 
Old 01-29-2013, 03:08 PM   #2
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
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:

 
  


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
iptables question jnojr Linux - Security 11 04-05-2012 02:50 PM
iptables question enrique_arong Linux - Networking 4 09-28-2004 01:51 PM
Question on IPTABLES brokenflea Linux - Networking 3 02-10-2004 09:53 PM
iptables Question gauge73 Linux - Networking 3 12-14-2003 12:02 AM
Question about iptables tontod Linux - Networking 3 06-10-2002 05:03 PM


All times are GMT -5. The time now is 09:46 AM.

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