How to pass DHCP / PXE through to a virtual machine

Hi everybody,

that’s a post I try to write since a few month. It’s related to an issue or misunderstanding which a customer of mine had.

He wanted to try to get a PXE Boot triggered by DHCP throw a virtual Machine Hosted on Hyper-V. For those of us who are familiar with vitualization, that sounds very simple because the solutions was, he didn’t tagged all VLANs on the Switch and virtual Machine.

For those who are not that familiar, I want to give you a short list what you need to do, to get traffic through you physical and virtual switches right to you virtual machines.

 

Physical Switch Configuration

First thing you need to do, is to tag all VLANs were your virtual Machines will have access to, to the physical ports of you Hyper-V Host and virtual Switch is connected too.

As example: You have one virtual machine in VLAN 10 and one in VLAN 233. Both need connect to your physical network. You Hyper-V virtual Switch is connected to Switch 1 on Port 12 and Switch 2 on Port 14. That means you need to tag VLAN 10 and VLAN 233 on Switch 1 Port 12 and Switch 2 Port 14.

Virtual Switch Configuration

Now you need to configure the virtual switch and that’s the point most people don’t see while working with virtualization. In nearly all Hypervisors you have an operation softwarebased layer 2 switch running. That switch needs to be configured too. That is mostly done via virtual machine settings.

In our example we need to set the VLAN Tag on the switch for a virtual machine on Hyper-V. To do so, you need to change the settings for the virtual machine network interface.

lan

 

You can also configure the switch for VLAN trunking. My Bro Charbel wrote a great blog about how to configure the virtual switch in that way. What is VLAN Trunk Mode in Hyper-V?

In our example you need to know one more thing. In Generation 1 Hyper-V VMs only the legacy network adapter is able to perform a PXE boot.

Tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *