Hi
   I have a gateway (CentOS) with eth0 and eth1 as
interfaces. “eth0”  is exposed to WAN and  “eth1” to
the LAN  network , I want all POP3 packets coming  in
through the gateway  wan interface (eth0) to be
redirected  to the PS1(inside the lan) port 8110 .  I
had done some iptables settings as. 

#################
#!/bin/sh
#
#  Unless specified, the defaults for INPUT and OUTPUT
is ACCEPT
#    The default for FORWARD is DROP (REJECT is not a
valid policy)
#   Isn't ACCEPT insecure?  To some degree, YES, but
this is our testing
#   phase.
#

echo "   Clearing any existing rules and setting
default policy.."
iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F

echo "   FWD: Allow all connections IN"
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

echo "   Enabling SNAT (MASQUERADE) functionality on
$eth0"
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo "Forwarding all the port 110 to
192.168.242.129:8110"

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport
110 -j DNAT --to 192.168.242.129:8110
iptables        -A FORWARD -i eth0 -p tcp --dport 8110
-d 192.168.242.129 -j ACCEPT
#############################################      

 And my iptables-save ,  gives output as 

#############
[EMAIL PROTECTED] ~]# iptables-save
# Generated by iptables-save v1.2.11 on Sat Jul 29
15:52:04 2006
*filter
:INPUT ACCEPT [977:113047]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [235:28400]
-A FORWARD -i eth0 -o eth1 -j ACCEPT
-A FORWARD -i eth1 -o eth0 -j ACCEPT
-A FORWARD -j LOG
-A FORWARD -d 192.168.242.129 -i eth0 -p tcp -m tcp
--dport 8110 -j ACCEPT
COMMIT
# Completed on Sat Jul 29 15:52:04 2006
# Generated by iptables-save v1.2.11 on Sat Jul 29
15:52:04 2006
*nat
:PREROUTING ACCEPT [1511:269881]
:POSTROUTING ACCEPT [10:2000]
:OUTPUT ACCEPT [10:2000]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 110 -j
DNAT --to-destination 192.168.242.129:8110
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
# Completed on Sat Jul 29 15:52:04 2006
[EMAIL PROTECTED] ~]#
####################


  In this setup POP3  packets were not redirected to
PS1 (192.168.242.129) 

               I request guidance for redirecting all
trafic  port 110  to 192.168.242.129:8110 
                           Thanks 
                               Joseph John 



                
___________________________________________________________ 
Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The 
Wall Street Journal 
http://uk.docs.yahoo.com/nowyoucan.html





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/dubailug/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to