Hyper-v & DHCP issues **Fixed**


Recommended Posts

I'm not 100% about the set up here. That's the whole idea, I'm trying to learn how to set this up correctly, but I'm stuck.

http://i.imgur.com/AjTid9f.png

Basically, everything within the Hyper-V network can see DHCP. But a physical client cannot. It gets an APIPA address. If I gave the laptop a manual IP, there's no problem.

Hyper-v is set up with the virtual switch bound to the 2nd NIC (192.168.0.201)

DHCP is bound to 192.168.0.80

I did have a 2nd NIC in the DHCP VM (192.168.0.81) but didn't help.

My tech PC can ping everything (except the laptop)

The Hyer-V Sever NIC's are set up so: http://i.imgur.com/F4yxMj4.png (with and without gateway set on 'vSwitch')

All windows firewalls are disabled.

Any advise on what I'm doing wrong?

Link to comment
Share on other sites

Why have you set the dns server to be home?

On which NIC?

Its not that they don't listen to it but they will prefer the DHCP server in your router. Perhaps disable that or set your network adapter properties to point to your custom DHCP server.

DHCP on Router is turned off.

Link to comment
Share on other sites

A single NIC is sufficient for the VM.

I have few questions before I can provide solution.

What version of Hyper-V are you using ? If not sure version of OS should be ok too.

Have you enabled DHCP guard for any of your VM's ?

How many physical NIC's do you have on the Hyper-V server ?

What is the connection type of virtual switch, External, Internal or Private ?

Link to comment
Share on other sites

is the laptop Wireless or Wired? Did you isolate the 201 nic work card for only Virtual Machines.

I have my Virtual Machines running on one card, and this is isolated for only virtual machines. Go to your virtual NIC and untick the box "All Management operating system to share this network adapter" This will remove any IP address on the card and only VMs will run the though it

Make sure you have this Virtual NIC setup as a External Network.

Link to comment
Share on other sites

Turn off "Allow management operating system to share this adapter" for NIC-2 & do not set VLAN tagging on the virtual switch if your physical switch is unmanaged (unless you want to isolate your virtual switch/machines from the rest of your physical network).

Restart DHCP service.

Link to comment
Share on other sites

What Aergan said above should do it. The NIC that the Hyper-V uses shouldn't be shared (well it can be but I just dedicate it to Hyper-V)

The virtual switch usually doesn't have an IP as it's a dumb switch.

Can the VM get online to the gateway (router)? If not then other machines can't see it because it's not connected to the physical 8 port switch (or the other way around, the switch doesn't know about the VM so it wont route anything to it). - Nevermind since you said your Tech PC can ping the VMs.

left and right image

http://i.imgur.com/F4yxMj4.png

Wait, you have the DHCP VM pointing to itself for DNS, but it doesn't have DNS I thought? I'd guess that's prolly why since the real DNS (0.200) doesn't know about it? You have to register the connection in the DNS list.

Do a ipconfig /registerDNS on the DHCP server and then the laptop will be able to find it and just change the NIC settings of the DHCP VM (0.201) to point to 192.168.0.200 in it's DNS settings.

Link to comment
Share on other sites

A single NIC is sufficient for the VM.

I have few questions before I can provide solution.

What version of Hyper-V are you using ? If not sure version of OS should be ok too.

Have you enabled DHCP guard for any of your VM's ?

How many physical NIC's do you have on the Hyper-V server ?

What is the connection type of virtual switch, External, Internal or Private ?

Hyper-V 3.0 on Server 2012.

DHCP Guard is off

2 Physical NICs on Server

VirtualSwitch set to External

Turn off "Allow management operating system to share this adapter" for NIC-2 & do not set VLAN tagging on the virtual switch if your physical switch is unmanaged (unless you want to isolate your virtual switch/machines from the rest of your physical network).

Restart DHCP service.

I've now turned that off. Now I can only see the 2 nics on the physical server.

NIC1: http://i.imgur.com/vxD5j5L.png

NIC2: http://i.imgur.com/rRuIuUK.png

VSwitch Setup: http://i.imgur.com/39OhmEn.png

What Aergan said above should do it. The NIC that the Hyper-V uses shouldn't be shared (well it can be but I just dedicate it to Hyper-V)

The virtual switch usually doesn't have an IP as it's a dumb switch.

Can the VM get online to the gateway (router)? If not then other machines can't see it because it's not connected to the physical 8 port switch (or the other way around, the switch doesn't know about the VM so it wont route anything to it). - Nevermind since you said your Tech PC can ping the VMs.

Wait, you have the DHCP VM pointing to itself for DNS, but it doesn't have DNS I thought? I'd guess that's prolly why since the real DNS (0.200) doesn't know about it? You have to register the connection in the DNS list.

Do a ipconfig /registerDNS on the DHCP server and then the laptop will be able to find it and just change the NIC settings of the DHCP VM (0.201) to point to 192.168.0.200 in it's DNS settings.

The DHCP VM NIC is pointing back to 0.200 for DNS

http://i.imgur.com/2rxrUJT.png

Link to comment
Share on other sites

I think your virtual switch configuration is broken.

I would like you to delete all existing virtual switches in Hyper-V.

You might need to change the NIC status on vm's to not connected until you create new virtual switch.

Did you tick Hyper-V Extensible virtual switch option manually on the NIC's ? If so, please untick that once you have deleted all the virtual switches.

Create a new virtual switch with connection type as "External Network" and bind it to Physical NIC 2 on the server.

Also, turn off "Allow management operating system to share this adapter". Turning off is not necessary though, the DHCP server VM should be able to assign IP to this NIC on your host automatically as well.

Then assign the new virtual switch to the vm's.

Make sure that DHCP scope is assigned on the interface correctly.

Link to comment
Share on other sites

Right! Got it fixed!

I've no idea what I had set before, but I can only assume I had configured DNS on my Switch to something unintelligible.

I reset the switch to factory defaults (then had to use fing on my mobile to find out what new IP it had after rebooting) and DHCP was working (and the switch had the 1st IP in the DHCP Scope)

And then all other clients picked up IP's

I am one happy chappy

Link to comment
Share on other sites

  • 4 months later...

Hi,

 

I have similar problem with DHCP.This's funny but after update and reboot DHCP stop woriking.

 

DHCP server ( windows 2012)  is on Hyper V.

 

Client from the network can't get IP from DHCP, but other HyperV machine can. Before restart everything works.

 

 

 

 

 

 

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.