LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-23-2011, 09:49 AM   #1
Ammad
Member
 
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 522

Rep: Reputation: 31
publishing server


Hi,

i want to have Linux as front end firewall for my Email server.
so i assigned public ip address to Linux wan interface and did the following but its not working to get emails from outside domains.




iptables -A PREROUTING -t nat -p tcp --source x.x.y.y --dport 25 -j DNAT --to 192.168.10.50:25
iptables -A INPUT -p tcp -m state --state NEW --dport 25 -j ACCEPT

iptables -t nat -I POSTROUTING -s 192.168.10.50 -j SNAT --to-source x.x.y.y

iptables -t nat -A POSTROUTING -s 192.168.10.50 -j MASQUERADE



Right now there is no blocking rules on any table and Forwarding is also enabled on kernel
 
Old 01-26-2011, 08:37 AM   #2
goossen
Member
 
Registered: May 2006
Location: Bayern, Germany
Distribution: Many
Posts: 224

Rep: Reputation: 41
Your source in PREROUTING should not be your real IP, your source is any and your destination is your real IP.
 
Old 01-26-2011, 08:45 AM   #3
goossen
Member
 
Registered: May 2006
Location: Bayern, Germany
Distribution: Many
Posts: 224

Rep: Reputation: 41
You can also do this:
Code:
iptables -t nat -A PREROUTING -p TCP -i eth0 --dport 25 -j DNAT --to-destination 192.168.10.50:25
Replace eth0 for your actual Internet iface.
 
  


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
IP multicast publishing server viperuk Linux - Software 2 11-20-2009 03:56 AM
Howto set up a linux server for publishing dokuments in filetree pjalfredsson Linux - Newbie 4 03-18-2009 12:30 PM
Browser publishing? nglbrkr Linux - Software 2 01-30-2006 11:24 PM
Terminal server publishing vasyak Linux - Networking 5 08-27-2004 08:37 AM
ISA, websites on apache and linux server, publishing... marvc Linux - Security 4 07-10-2003 05:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:43 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