Red Hat Networking - port forwarding ip based

This is Interesting: Free IT Magazines  
Home > Archive > Red Hat Networking > July 2004 > port forwarding ip based





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author port forwarding ip based
Jemy

2004-07-12, 8:49 pm

Hi, Im new to iptables, but I wish to configure our firewall running redhat
linux iptables to forward as follow:
- forward traffic port 25 ip source from 123.123.123.123 to a server
internally;
- forward traffic port 25 ip source not from 123.123.123.123 to a server
externally;
is it possible to achieve the above, anyone can give a code or two
many thanks in advance


Allen Kistler

2004-07-13, 2:50 am

Jemy wrote:
> Hi, Im new to iptables, but I wish to configure our firewall running redhat
> linux iptables to forward as follow:
> - forward traffic port 25 ip source from 123.123.123.123 to a server
> internally;
> - forward traffic port 25 ip source not from 123.123.123.123 to a server
> externally;
> is it possible to achieve the above, anyone can give a code or two
> many thanks in advance


For RH and Fedora, edit /etc/sysconfig/iptables to include something
like the following. Watch out for line wraps.

*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A PREROUTING -s 123.123.123.123 -p tcp -m tcp --dport 25 \
-j DNAT --to <"internal" ip addr>
-A PREROUTING -p tcp -m tcp --dport 25 \
-j DNAT --to <"external" ip addr>
COMMIT

Don't forget to ACCEPT the traffic in the FORWARD chain, too.
Jemy

2004-07-13, 2:50 am

Thanks Allen, that does the job.. brilliant =)

"Jemy" <cutejemy@REMOVEhotmail.com> wrote in message
news:40f34926@news.starhub.net.sg...
> Hi, Im new to iptables, but I wish to configure our firewall running
> redhat linux iptables to forward as follow:
> - forward traffic port 25 ip source from 123.123.123.123 to a server
> internally;
> - forward traffic port 25 ip source not from 123.123.123.123 to a server
> externally;
> is it possible to achieve the above, anyone can give a code or two
> many thanks in advance
>



Freeride

2004-07-13, 2:50 am

On Tue, 13 Jul 2004 10:31:22 +0800, Jemy wrote:

> Hi, Im new to iptables, but I wish to configure our firewall running redhat
> linux iptables to forward as follow:
> - forward traffic port 25 ip source from 123.123.123.123 to a server
> internally;
> - forward traffic port 25 ip source not from 123.123.123.123 to a server
> externally;
> is it possible to achieve the above, anyone can give a code or two
> many thanks in advance



Nice easy firewall tool for iptables.


http://firestarter.sourceforge.net/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com