LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-26-2004, 09:04 AM   #1
jorgelopez100
LQ Newbie
 
Registered: Jul 2003
Posts: 2

Rep: Reputation: 0
Question how to configure a firewall (iptables) to let me use a email server behind it?


hello, please help me with this trouble..

I have a email server behind a firewall with linux , and i want to configure the firewall to pass trafic between internet and email server and email server to internet. the firewall have two nics, one nic have public ip and the other have a private ip and it's conected to the email server nic with a private ip too. how can i do that?, do i need to use nat table of iptables for something or what ?
 
Old 03-26-2004, 09:49 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
u need to know iptables commands. visit www.netfilter.org to learn it.

i will try to explain DNAT;
DNAT changes the destination ip address from ip packets headers. so it can be forwarded to host which is located in private lan. SNAT must be enabled for that private host. otherwise ip packets comes fron internet cannot return. so connection cant be established. sure first u must turn on routing in your linux.

example.. eth0 has public ip of email server. eth1 is connected to email server. email
public ip : 212.1.1.2
server ip : 192.168.0.2

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j DNAT --to 192.168.0.2
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 110 -j DNAT --to 192.168.0.2
iptables -t nat -A POSTROUTING -s 192.168.0.2 -j SNAT -to 212.1.1.2
 
  


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
Configure mailbox size limits email server...please help! locoiguana Linux - Software 7 05-11-2005 04:15 AM
configure email server digity Linux - Newbie 6 04-15-2005 03:03 PM
How do I configure postfix master to forward all email to an email server ? hello321_1999 Linux - Software 1 11-18-2004 04:43 AM
I have a firewall. I want to configure a vpn server. How do I this Sergiu Linux - Newbie 0 04-13-2004 09:04 AM
HOW TO CONFIGURE Email server Redhat_guy Red Hat 4 12-22-2003 01:13 PM

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

All times are GMT -5. The time now is 12:28 AM.

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