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 ]
|