Tom's Hardware > Forum > General Networking > Firewall > port forwarding ip based

port forwarding ip based

Forum General Networking : Firewall - port forwarding ip based

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: alt.os.linux,alt.os.linux.redhat,comp.security.firewalls,redhat.networking.general (More info?)

 

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

Sponsored Links
Register or log in to remove.

Archived from groups: alt.os.linux,alt.os.linux.redhat,comp.security.firewalls,redhat.networking.general (More info?)

 

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.

Reply to Anonymous

Archived from groups: alt.os.linux,alt.os.linux.redhat,comp.security.firewalls,redhat.networking.general (More info?)

 

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
>

Reply to Anonymous

Archived from groups: alt.os.linux,alt.os.linux.redhat,comp.security.firewalls,redhat.networking.general (More info?)

 

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/

Reply to Anonymous
Tom's Hardware > Forum > General Networking > Firewall > port forwarding ip based
Go to:

There are 1370 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them