I'm trying to figure out how to share the internet connection from my HOST Azure VM to the VM's withing Hyper-V inside the HOST VM.

I've added two network interfaces to the HOST Azure VM each with static IP's configured.

Upon creating my Virtual Switch on Hyper-V i've associated the secondary NIC on the HOST machine and the internet connection is not passing through. I do have "Allow management operating system to share this network adapter" checked.

My intent is to create a Domain Controller with DHCP as a Hyper-V VM within my host machine and create subsequent Hyper-V VM's on the HOST machine for purposes of exchange, SQL, etc... But I need to get my primary Active Directory VM up and running and can't seem to figure out how to pass the internet connection from the HOST onto my first Hyper-V VM.

Any help, ideas, input appreciated.

Some context for this question:
I'm investigating setting up a Hyper-V network for Microsoft Exchange. My plan is to create 1 Azure VM and install Hyper-V and multiple VM's inside for Active Directory, Exchange, DNS, DCHP to setup a public facing exchange server.

  • 1
    Check this guide for networking configurations in neste Azure thomasmaurer.ch/2017/07/…
    – Strepsils
    Mar 9, 2018 at 17:06
  • 1
    @Strepsils Thank you for this i will give it a shot, i had been trying to assign my Hyper-V VM's static Ip's that were on the host's NIC. Do you happen to know what happens when static IP's on the VM are necessary for external DNS how this would play out with DHCP?
    – UserSN
    Mar 10, 2018 at 2:15
  • 1
    don't seem to recall that , I'll play around with it
    – Strepsils
    Mar 19, 2018 at 0:10

2 Answers 2


To share Network from Hyper-V host to VMs do:

  1. Install Routing and Remote Access (RRAS) onto Hyper-V host.

  2. Make custom RRAS config, enabling only NAT and LAN Routing.

  3. Create Internal Hyper-V Switch. Configure its IPv4 settings filling IPv4 and Network Mask, and some DNS servers (, It will be used as Network Gateway for nested VMs.

  4. Setup NAT onto the network interface that has an access to the Internet (External facing one).

  5. Connect to VM and assign IPv4, Mask and Network Gateway (which is the Hyper-V vSwitch).
  6. Flush DNS running ipconfig /flushdns command on both Hyper-V and VM hosts.
  7. ping google.com from VM.

How NAT works: https://www.petri.com/create-nat-rules-hyper-v-nat-virtual-switch

  • 3
    After exhaustive testing i did get NAT working using PowerShell for whatever reason using GUI i was not able to get this working. That being said i was never able to "Push" data to the appropriate nested VM. IE: DNS queries forwarded to my DNS VM, SMTP requested forwarded to my exchange VM. I'm not certain this is even possible at this point.
    – UserSN
    Mar 19, 2018 at 22:13
  • 2
    This way I do setup DNS&DHCP inside a VM with DNS etc. Then change Hyper-V switch DNS to VM. Thus other VMs optaion IPv4 over DHCP with proper DNS records.
    – A.Newgate
    Mar 20, 2018 at 12:43

Just to highlight, you have to create an External virtual switch in the Hyper-V Manager, in case you have multiple NICs/adapter, ensure that you selected the appropriate adapter. You may consider deleting and re-adding the external virtual switch that you have created already. Its worth a try to update the network drivers for your adapter and then re-try.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .