LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Help/advice needed for gateway for multiple websites w/ email servers (https://www.linuxquestions.org/questions/linux-networking-3/help-advice-needed-for-gateway-for-multiple-websites-w-email-servers-803316/)

zogthegreat 04-21-2010 10:42 AM

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

SuperJediWombat! 04-22-2010 05:23 AM

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.

EricTRA 04-22-2010 05:36 AM

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


All times are GMT -5. The time now is 08:02 AM.