Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more


How to "share" a public IP to a guest machine in VMware ESXi 4.1

Posted on 2011-03-24
Medium Priority
Last Modified: 2014-07-13
I am helping a fellow classmate with a lab project that involves VMware ESXi ver4.1, and his project is a little different than normal because he chose to setup his installation on a personal physical box and use a personal IP address that he has purchased from an ISP.

Usually we are working with private IP addresses, and we do not worry about making efficient use of this resource because they are free.

Overall, the big picture assignment is to create a firewall in the vm with 2 nics, that connects Vswitch0 to Vswitch1, and on Vswitch1, setup a Web Server and a Client Machine (xp, Fedora, or Chef's Suprise).

We need to be able to serve out a web page that our classmates can reach from the client machines on their VM (the Client previously mentioned on Vswitch1 behind the firewall).

Not worried about the routing issues, or the network for communication of our individual esx servers for the class. But this one student who has separated himself from the group has created an interesting challenge to solve. I see it as a very good opportunity to learn more about networking, and solve a very real world problem.

Sorry about all the extra info.............  anyway.....

This one particular esx server, which has been assigned the public ip, which is up, running, has vms created on it, and can be reached across the internet with vsphere.

The network card for the esx server is assigned the public IP address.

The vm firewall WAN interface running on that esx also needs to be assigned to the same public IP.

Is this possible through some kind of bridging? Or am I looking at this the wrong way?

Thank you very much in advance - Smizz.
Question by:Smizzong
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

mpilarczyk earned 400 total points
ID: 35211184
Install m0n0wall virtual appliance and publish web serwer through NAT.
LVL 12

Assisted Solution

by:Kent W
Kent W earned 400 total points
ID: 35211218
That's really going to depend on a lot of things.  Number one, what kind of connection is this, is it actually connected to his ISPs network, and is there anything other than, say, a cable modem in between the I'net and your ESXi?
If the ESXi box's main IP s the same as your Guest OS, you would have to use bridging.  The other choice is to use NAT.  Normally, you would setup a static, real-word IP inside the Guest OS, as you would a physical box.  You just assign a NIC to the guest OS, but set the IP parameters from within that install (ifconfig on Linux, Network Connections on Windows.  You also have virtual switch support...this post may help:

Assisted Solution

jimmyray7 earned 400 total points
ID: 35211221
If ESXi has the public IP, I don't think you can share that with a VM.  The easiest solution would be to put an inexpensive hardware router in front of the ESXi host and assign it the public IP, then use a private IP for the ESXi host.
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

LVL 16

Assisted Solution

by:Danny McDaniel
Danny McDaniel earned 800 total points
ID: 35212634
If you only have one public IP and the single nic that management and the VM Network have to go through, you're gonna have to do something like jimmyray7 suggested.  

If you've got a second nic, then you could keep the mgmt network on the private network and connect the VM network to the public side.

The only other thing I can think of, and it's not pretty, is to have the mgmt and vm network on the same vswitch, but...
-set the option for the VM to startup/shutdown with the host
-install the vsphere client inside of your webserver (it'll have to be running windows)
-assign a 2nd vmnic to the vm
-give the nic on the 2nd vmnic a private IP
-change the mgmt IP to an IP on the same private network.

Now, to manage the host, you're gonna have to log into the VM with RDP or VNC and run the vsphere client.

I've never tried anything like this but I think it will work.
LVL 16

Assisted Solution

by:Danny McDaniel
Danny McDaniel earned 800 total points
ID: 35212648
another option, if you have a second computer and a simple switch...

plug the public side and both computers into the switch.  use private static IP's on the 2nd computer and the ESXi mgmt network, leave the VM with the public IP or set to DHCP if that's how it's getting the public IP currently.  The 2nd computer won't be able to get to the internet unless you set up the 2nd nic on the web VM and do some kind of NAT or Internet Connection Sharing.  The 2nd computer is only there for mgmt of ESXi so it doesn't have to always be connected.

Author Closing Comment

ID: 35237867
All of these helpful solutions have merit, and have good points or ideas to consider......

It seems that ESX was designed to have a "management interface" - that must have it's own independent IP address, and then the vm's on the first/default vSwitch "0" will also be able to communicate on the same network segment (same network address range) as the the "real" physical network adapter of the host server (bare metal box).

In this case, the student decided to leave the public IP address assigned to the management interface, and used a "home based router/switch" which was assigned another separate public IP address. From this device, they served out an IP address to the virtual machine firewall WAN interface.

I guess the IP addresses that he has reserved from the ISP are just end of the line IP addresses. He does not actually have access to a default gateway address within his range of five IP's.

block of 5 ip's. eg.
All are valid public IP's that he accesses from a modem in a "pass through mode" with multiple ports, acting like a switch. He cannot actually set one statically as the IP on a router, and then specify a default gateway. He says he must setup the interface to accept DHCP to pull the IP address, and the DNS and DG are automatically set)

Thank you to all of you for your help and ideas. I am sure that it is obvious that I still have much to learn, but that is exactly what I intend to do.

Thanks again, and if you have any other ideas, or questions about all this stuff I just typed up, please post it. I will be back to check and follow up.

Expert Comment

ID: 40193369
Hello I have the same problem almost.

I have a dedicated server at kimsufi running esxi 5.0 with one ipv4 assigned to the management and I also have 1 public ipv6

I only have one physic nic

So im trying to get my VM's to access the internet

What is the solution here?

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
August and September have been big months for VMware—from VMworld last month to our new Course of the Month in VMware Professional - Data Center Virtualization. We reached out to Andrew Hancock, resident VMware vExpert, to have a more in-depth discu…
Teach the user how to configure vSphere clusters to support the VMware FT feature Open vSphere Web Client: Verify vSphere HA is enabled: Verify netowrking for vMotion and FT Logging is in place or create it: Turn On FT for a virtual machine: Verify …
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question