Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ESXi - IP passthrough to virtual machine

Posted on 2012-08-15
22
Medium Priority
?
1,524 Views
Last Modified: 2012-08-20
I installed a NIC that will be a dedicated WAN interface.  This NIC will be assigned a public IP address via my ISP.  I want this IP address to be bound to a NIC on a VM.  I only have 1 x VM in the virtual switch group/port.  I also only have 1 NIC assigned to it...  How can I do this?  I'm trying to setup a virtual firewall/router.
0
Comment
Question by:gopher_49
  • 9
  • 6
  • 6
  • +1
22 Comments
 
LVL 125
ID: 38297875
either connect that physical nic on the ESXi server to your Inbound Router.

create a vSwitch, add the physical nic, create a virtual machine portgroup, select this portgroup in the Interface Settings.

Add public ip address to VM
0
 
LVL 10

Expert Comment

by:djcanter
ID: 38297881
you should create a second vswitch and assign the physical nic to it. then assign the vm nic to that  vswitch.
0
 
LVL 33

Expert Comment

by:Busbar
ID: 38297910
don't assign that IP to the VMware NIC, assign it directly to the VM
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:gopher_49
ID: 38297967
What if my IP address changes?  It will run for months without it changing but it could change one day...  I've done everything mentioned except add the IP address given to me to my VM...  I guess I'll give it a shot...But..  The WAN interface on the VM would drop whenever my public IP changes.
0
 
LVL 125
ID: 38297978
IP Address changes?

what your External Public IP Address is DHCP?

Most public external IP addresses, I know of our Static for WANs?

Does your ISP, issue the IP Address via DHCP?

if so, setup as DHCP, DHCP will request it from their servers.

you could look at Smoothwall v3.

http://www.smoothwall.org/

Not sure, what you are wanting to do, what services you are running etc
0
 
LVL 10

Expert Comment

by:djcanter
ID: 38297989
same as any other dynamic network client, configure dhcp on the interface of the vm.
0
 

Author Comment

by:gopher_49
ID: 38297999
This is for a lab on a home network using Comcast... Comcast issues the public IP via DHCP.  So, my dedicated physical NIC on the ESXi host will get this IP address.  It's a public IP address and stays the same for months.. But eventually does change.  So, since this public IP is issued via DHCP then I need to bind this assigned IP address to my VM.  I want my VM to have the same IP for it will be an outside interface for a virtual firewall/router.
0
 
LVL 125
ID: 38298026
This will not work. IP Address of the ESXi host is dictated by MAC Address.

Every NIC has a different MAC address, so your VM cannot share the same MAC Address/TCP IP address as the host.

Do you only have a single NIC?

if you have a single NIC, you will need to use NAT, and forward requests from Public IP Address at Router via NAT to Internal VMs.

You are going to need a Virtual Router, which offers NAT, or Port Forward NAT from your router to your VMs.
0
 
LVL 10

Expert Comment

by:djcanter
ID: 38298041
either the vm or the host will have the ip not both. really if you read the first 2 posts  you will get it working.

do not assign an ip to the interface on the esx host, just assign the nic to a vswitch and let the vm get the ip.
0
 

Author Comment

by:gopher_49
ID: 38298052
okay.. Let's start over...  

I have two physical NICS, two virtual switch groups, and two port groups...  The second virtual switch group has one VM and one physical NIC assigned to it.  The physical NIC has a public IP via DHCP from Comcast.. Now, how can I get that public IP to pass to my VM?  Someone mentioned assigning the VM NIC to this IP, however, then you would have one IP with two different mac addresses which is sketchy.. I'm thinking I'll have to perform NAT from the DHCP assigned public IP to my VM's IP, correct?
0
 

Author Comment

by:gopher_49
ID: 38298058
djcanter,

I don't understand your post.  How can I make it where the ESXi host doesn't get the IP?  The dedicated physical NIC is plugged into the router.  How can I bypass nic NIC for the ESXi host and only assign to a VM?
0
 
LVL 10

Expert Comment

by:djcanter
ID: 38298060
no nat. dont configure an ip on the interface.
0
 
LVL 125
ID: 38298066
Okay, two physical NICs fine.

Create a new vSwitch1, see my first post!

ESXi 1st NIC has an IP Address on your LAN- vswitch0 - vmnic0

VM has an IP Address assigned by DHCP from your ISP! -vSwitch1 - vmnic1 -- router -- ISP
0
 

Author Comment

by:gopher_49
ID: 38298079
djcanter,

I've already done what you said.  The dedicated physical nic is not assigned on the ESXi console as a management NIC.  I added it via the vSphere client.  I assigned it to a dedicated switch port group within a dedicated vswitch.  The only VM in this group is my firewall VM.. But..  When I added the NIC via vsphere it asked whether it's static or DHCP.. So, at that point it already grabbed an IP.
0
 

Author Comment

by:gopher_49
ID: 38298092
hanccocka,

When I added the NIC and assigned it via vSphere it was set to DHCP.  So it already grabbed an IP address prior to the VM even being in the picture.  I've done everything you said but the IP is assigned to the physical nic prior to VM's even being assigned to that port group.
0
 
LVL 10

Expert Comment

by:djcanter
ID: 38298100
I dont know where in vsphere it would ask if the physical nic was dhcp or static uless it was bound to a management interface.
 
can you screenshot your config/networking tab.
vswitch.JPG
0
 
LVL 125

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 2000 total points
ID: 38298119
have you created a 2nd vSwitch?

only VMKernel and Management Networks get assigned IP Addresses?

the portgroup you need to create is for Virtual Machines

which if you like is what you call passthrough
0
 

Author Comment

by:gopher_49
ID: 38298131
Maybe I didn't create a vSwitch.  I'll check when I get back to the home network and update the ticket...  But..  If I assign a physical NIC to a vSwitch and since I only have 1 x VM in this portgroup then that VM will get the DHCP issued IP, correct?  This is what I thought I did last night but I must of created a VMKernel instead for it assigned the IP to the physical NIC.

I bet that's what happened.  I'll check it out when I get to the network.

Thanks.
0
 
LVL 10

Expert Comment

by:djcanter
ID: 38298135
correct. let us know.
0
 
LVL 125
ID: 38298173
Check what you select!

and make sure you have a good firewall if hanging a Windows box with a public IP!
0
 

Author Comment

by:gopher_49
ID: 38298180
I'm using an Endian firewall which is Linux based.
0
 

Author Comment

by:gopher_49
ID: 38313078
hanccocka,

You're correct.  I had the VM in a KMkernel port versus a Virtual Machine Port Group?!  I love this Endian firewall.  I now have a true outside interface and inside interface.  Having a virtual machine based firewall makes my network so diverse for nothing in cost.

Thanks!
0

Featured Post

Independent Software Vendors: 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

HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
Teach the user how to install ESXi 5.5 and configure the management network System Requirements: ESXi Installation:  Management Network Configuration: Management Network Testing:
Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:
Suggested Courses

578 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