LinuxQuestions.org
Help answer threads with 0 replies.
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 04-21-2010, 10:42 AM   #1
zogthegreat
Member
 
Registered: Apr 2009
Location: Montreal, Canada
Distribution: Fedora, CentOS, Ubuntu
Posts: 63

Rep: Reputation: 16
Help/advice needed for gateway for multiple websites w/ email servers


Hi everyone:

I need some advice/suggestions for a problem that I am having. I have been searching and posting all over the place, but have not yet found the solution.

Here is my setup;

server 1; apache webserver with Qmail to handle POP3 and SMTP with IP address of 192.X.X.1/24
server 2; apache webserver with Qmail to handle POP3 and SMTP with IP address of 192.X.X.2/24
server 3; apache webserver with Qmail to handle POP3 and SMTP with IP address of 192.X.X.3/24

All of these machines are built as guest on VirtualBox 3.1 using CentOS 5.4 and have properly registered domain names. These server workl properly when run one at a time.

What I need to do is build a gateway/router to direct the traffic from the outside to the correct host, i.e. request for www.server1.com go to server1. I have been able to get this to work with NAT and iptables and doing a port redirecting, server1 using port 81 for http, server2 using port 82 etc. My problem is that for my POP3 and SMTP, I would have to redirect to many ports.

What I would like to do is have one machine to act as a gateway to redirect all traffic to the proper machines.

If anyone has any suggestions how to do this, please let me know.

Thanks

zog
 
Old 04-22-2010, 05:23 AM   #2
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
You will need multiple IP addresses, it is not possible to route packets based on the domain name used.

You need a /29 block of IP addresses (6 usable addresses.) for that many hosts.
 
Old 04-22-2010, 05:36 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

For the http/https part you could install a reverse proxy with Squid for example and have it redirect to the correct host, based on domain name. The SMTP part could be handled by Postfix installation on the same Squid server, accepting for all domains and forwarding on domain name base to the correct server. For the POP part I don't have any idea off the top of my head. In doing this you could put your Squid in a DMZ and wouldn't have to worry about iptables, NAT, and the works.

Hope this helps you on your way.

Kind regards,

Eric
 
  


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
Routing inbound email to multiple email servers Igby Linux - Server 5 12-31-2009 09:43 PM
copy and forward email to multiple email servers using postfix haleem Linux - Newbie 1 12-31-2009 04:28 AM
Send email to specific SMTP servers per email from my server? neilius Linux - Server 6 06-25-2009 06:31 AM
Advice needed on FC2 partitioning and multiple drives dbruso Linux - Newbie 2 09-14-2004 03:35 PM
Help with Mozilla Mail - multiple email servers kkempter Linux - Software 2 03-03-2003 02:50 PM

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

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