LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   port 25 forwarding iptables FC4, can't get it to pass traffic (https://www.linuxquestions.org/questions/linux-security-4/port-25-forwarding-iptables-fc4-cant-get-it-to-pass-traffic-420393/)

sahib2u 02-28-2006 03:33 PM

port 25 forwarding iptables FC4, can't get it to pass traffic
 
Hi All,

I am trying to to set up port forwarding using iptables to forward all port 25 traffic from my mail server to a spam appliance. The trick is that I want to direct all but traffic from one IP address over to the appliance.

here is the rule I am trying to use...

iptables -t nat -A PREROUTING -i eth0 -p tcp -s !10.x.x.x --dport 25 -j DNAT --to-destination 10.x.x.15:25


Any ideas what I am doing wrong?

Cheers

Matir 02-28-2006 04:08 PM

That rule looks fine to me. What happens when you try to use it?

~=gr3p=~ 03-01-2006 04:33 AM

hey just do this on the mailserver and it should work

route add default gw <IP Address of eth0>

sahib2u 03-01-2006 07:40 AM

thanks for the responses. When I try to use the rule I can't send through the mailserver and traffic does not get redirected. Adding the route command as suggested above did not do the trick either.

Capt_Caveman 03-01-2006 10:00 AM

Does that rule show up when you do iptables -t nat -L

Do you have rules in the FORWARD chain to allow the packets to be forwarded. Is ip_forwarding turned on in the kernel? You might also want to have ethereal or tcpdump running on the internal interface and see if you can observe the outgoing forwarded packets.


All times are GMT -5. The time now is 06:33 PM.