LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-28-2006, 03:33 PM   #1
sahib2u
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
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
 
Old 02-28-2006, 04:08 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
That rule looks fine to me. What happens when you try to use it?
 
Old 03-01-2006, 04:33 AM   #3
~=gr3p=~
Member
 
Registered: Feb 2005
Location: ~h3av3n~
Distribution: RHEL 4, Fedora Core 3,6,7 Centos 5, Ubuntu 7.04
Posts: 227

Rep: Reputation: 30
hey just do this on the mailserver and it should work

route add default gw <IP Address of eth0>
 
Old 03-01-2006, 07:40 AM   #4
sahib2u
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Original Poster
Rep: Reputation: 0
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.
 
Old 03-01-2006, 10:00 AM   #5
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
How can I block all traffic to port 110 to and IP using IPtables? abefroman Linux - Networking 8 11-16-2005 07:26 PM
port forwarding with iptables kkennedy Linux - Networking 1 09-01-2005 06:48 PM
Port Forwarding and IpTables nathanieljb Linux - Networking 1 03-17-2005 01:28 AM
How to filter traffic using port+process in IPTables muath Linux - Security 10 03-01-2004 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration