Azure nested Hyper-V server with 2 NICs

Joe H 91 Reputation points

I have a Hyper-V server running nested in an Azure VM. There are two Azure subnets, and The first NIC, used for only host traffic is connected as The second NIC, called External, is used only for traffic from the VMs on the host and has an IP address of

I've set up a Virtual Switch in Hyper-V connect to "Internal". I created a NAT assigned to that switch with a subnet of The VMs on the Hyper-V server will be on that subnet. How do I configure routing on the host so that all traffic from the subnet will go through the External NIC ( on the subnet)? This is for a malware test box, so I want the traffic from the malware VM to only go to the subnet.

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
1,825 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Tristan McCosker 1 Reputation point

    Hi Joe,

    The best way to do this would be to create a Hyper-V switch with type 'External' and set the attached NIC to your External one.

    This will mean your VMs can connect to other devices in Azure and the internet without connecting to the host or VMs on another switch. You should not need to use Hyper-V NAT in this scenario and will not be able to segregate the traffic properly in Azure as all traffic will be coming from the host IP address:
    "Network Address Translation (NAT) gives a virtual machine access to your computer's network by combining the host computer's IP address with a port through an internal Hyper-V Virtual Switch."

    In your situation I would recommend:

    1. Create External Hyper-V switch, link it to our external NIC and attach it to your VMs. Do not allow the management operating system to share the network adapter.
    2. Create a Network Security group and attach it to the External NIC in Azure
    3. Configure rules on the NSG so that it can only talk to the required networks, Subnets within a VNet can always communicate by default in Azure

    This should mean your VMs can communicate to without having any connection to the host or other subnets in your VNet.

    If you have any follow up questions please let me know and I can try to help.

    Kind regards,