ESXi - IP passthrough to virtual machine

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.
gopher_49Asked:
Who is Participating?
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
djcanterCommented:
you should create a second vswitch and assign the physical nic to it. then assign the vm nic to that  vswitch.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
BusbarSolutions ArchitectCommented:
don't assign that IP to the VMware NIC, assign it directly to the VM
0
 
gopher_49Author Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
djcanterCommented:
same as any other dynamic network client, configure dhcp on the interface of the vm.
0
 
gopher_49Author Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
djcanterCommented:
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
 
gopher_49Author Commented:
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
 
gopher_49Author Commented:
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
 
djcanterCommented:
no nat. dont configure an ip on the interface.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
gopher_49Author Commented:
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
 
gopher_49Author Commented:
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
 
djcanterCommented:
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
 
gopher_49Author Commented:
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
 
djcanterCommented:
correct. let us know.
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Check what you select!

and make sure you have a good firewall if hanging a Windows box with a public IP!
0
 
gopher_49Author Commented:
I'm using an Endian firewall which is Linux based.
0
 
gopher_49Author Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.