port forwarding ip based
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Red Hat support > Red Hat Networking > port forwarding ip based




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    port forwarding ip based  
Jemy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-13-04 01:49 AM

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







[ Post a follow-up to this message ]



    Re: port forwarding ip based  
Allen Kistler


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-13-04 07:50 AM

Jemy wrote:
> Hi, Im new to iptables, but I wish to configure our firewall running redha
t
> 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.





[ Post a follow-up to this message ]



    Re: port forwarding ip based  
Jemy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-13-04 07: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
>







[ Post a follow-up to this message ]



    Re: port forwarding ip based  
Freeride


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-13-04 07: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 redha
t
> 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/





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:05 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register