VMware Cloud Community
M99
Contributor
Contributor

Plublic IP for each Virtual Machine.

I want to set up a Machine with VMWare ESXi and create multiple VMs on that. I want each VM I create to have public access. Each of the VMs I create will have a webserver like program that will be accessed from the internet. I searched for a solution for this and I found that I need to setup a Bridge network. Can anybody provide instructions on how to do that? Also, Is there any other better solution to do this with out requiring many public ips (more like controlling with a domain name?)

Thank You!

Tags (3)
0 Kudos
2 Replies
Walfordr
Expert
Expert

M99 wrote:

I want to set up a Machine with VMWare ESXi and create multiple VMs on that. I want each VM I create to have public access. Each of the VMs I create will have a webserver like program that will be accessed from the internet. I searched for a solution for this and I found that I need to setup a Bridge network. Can anybody provide instructions on how to do that? Also, Is there any other better solution to do this with out requiring many public ips (more like controlling with a domain name?)

Thank You!

Add a firewall and use NAT and or PAT if you want to use a single public IP.

The firewall can be a VM - most on here recommend Vyatta.

I don't have a step by step guide but I'll explain what you need to do.

On your ESXi box you would create 3 vSwitches.

vSwitch1 you would use for managment - using a private IP (depending on your requirements) - assign 1 NIC

vSwitch 2 would be used for your firewall VM public network. - assign 1 NIC (or more depdending on your requirement)

vSwitch 3 you would use for the web server VMs and private network of the firewall. -assign 2 NICs (or more depdending on your requirement)

The firewall VM would have 1 public interface with 1 of your public IP in vSwitch2.  This NIC would be uplinked to the internet.

The firewall VM would also have 1 interface on vSwitch 3 with an IP from your private network.

You would setup public DNS entries for all your web app.  If you want to use only 1 public IP you would point all the public dns name to that 1 IP.  You would then have to use NAT and port address translation (PAT) to make each address unique at the firewall level.

For example. Lets say that your public ip is 1.1.1.1. You would setup webapp1.yourdomain.com pointing to 1.1.1.1 and webapp2.yourdomain.com point to 1.1.1.1 in public dns.

When the request hits your firewall with a destination port added it would NAT and PAT to your web app.  So when I request webapp1.yourdomain.com:8101 the firewall would translate that to an inside address of 192.168.1.1:80.

If you do not want to use PAT you would use 1 unique public IP for each DNS entry.

Check out these links:

http://roggyblog.blogspot.com/2009/12/vyatta-as-internet-gateway.html

http://www.sohoadvisers.com/tutorials/vyatta-router/vyatta-router-quick-setup

http://www.sohoadvisers.com/tutorials/vyatta-router/publish-an-internal-web-server-using-vyatta

Hope that gives you a start.

Robert -- BSIT, VCP3/VCP4, A+, MCP (Wow I haven't updated my profile since 4.1 days) -- Please consider awarding points for "helpful" and/or "correct" answers.
mmmike
Contributor
Contributor

One of the companies we support use this method thought not for web hosting. Basically they have parched from their ISP a required amount of IP addresses. Of course they have a piece of hardware which manages all of them, nothing fancy - a PIX firewall. Next you will need a domain or a few domain's depending on your needs. Using your firewall you will have to assign a public address to a local one (your server/s) and your done, each machine will have its own public IP.

As of the how to configure your ESXi host:

From my experience, you don't really need to change any setting on a fresh copy of ESXi to get this working.

Install ESXi, configure its network adapter to your needs, install guests and properly configure their network properties, and your good to go.

0 Kudos