User Manual

Rev 4.70
Mellanox Technologies
54
8.8.2 Configuring the NVGRE using PowerShell
Hyper-V Network Virtualization policies can be centrally configured using PowerShell 3.0 and
PowerShell Remoting.
Step 1. [Windows Server 2012 Only] Enable the Windows Network Virtualization binding on the
physical NIC of each Hyper-V Host (Host 1 and Host 2)
<EthInterfaceName> - Physical NIC name
Step 2. Create a vSwitch.
Step 3. Shut down the VMs.
Step 4. Configure the Virtual Subnet ID on the Hyper-V Network Switch Ports for each Virtual
Machine on each Hyper-V Host (Host 1 and Host 2).
Step 5. Configure a Subnet Locator and Route records on all Hyper-V Hosts (same command on all
Hyper-V hosts)
Step 6. Add customer route on all Hyper-V hosts (same command on all Hyper-V hosts).
Step 7. Configure the Provider Address and Route records on each Hyper-V Host using an appropriate
interface name and IP address.
Step 8. Configure the Virtual Subnet ID on the Hyper-V Network Switch Ports for each Virtual
Machine on each Hyper-V Host (Host 1 and Host 2).
Enable-NetAdapterBinding <EthInterfaceName>(a)-ComponentID ms_netwnv
New-VMSwitch <vSwitchName> -NetAdapterName <EthInterfaceName>-AllowManagementOS $true
Stop-VM -Name <VM Name> -Force -Confirm
Add-VMNetworkAdapter -VMName <VMName> -SwitchName <vSwitchName> -StaticMacAddress <StaticMAC
Address>
New-NetVirtualizationLookupRecord -CustomerAddress <VMInterfaceIPAddress 1/n> -ProviderAddress
<HypervisorInterfaceIPAddress1> -VirtualSubnetID <virtualsubnetID> -MACAddress <VMmacaddress1>
a
-Rule "TranslationMethodEncap"
New-NetVirtualizationLookupRecord -CustomerAddress <VMInterfaceIPAddress 2/n> -ProviderAddress
<HypervisorInterfaceIPAddress2> -VirtualSubnetID <virtualsubnetID> -MACAddress <VMmacaddress2>
a
-Rule "TranslationMethodEncap"
a. This is the VM’s MAC address associated with the vSwitch connected to the Mellanox device.
New-NetVirtualizationCustomerRoute -RoutingDomainID "{11111111-2222-3333-4444-000000005001}" -
VirtualSubnetID <virtualsubnetID> -DestinationPrefix <VMInterfaceIPAddress/Mask> -NextHop
"0.0.0.0" -Metric 255
$NIC = Get-NetAdapter <EthInterfaceName>
New-NetVirtualizationProviderAddress -InterfaceIndex $NIC.InterfaceIndex -ProviderAddress
<HypervisorInterfaceIPAddress> -PrefixLength 24
New-NetVirtualizationProviderRoute -InterfaceIndex $NIC.InterfaceIndex -DestinationPrefix
"0.0.0.0/0" -NextHop <HypervisorInterfaceIPAddress>
Get-VMNetworkAdapter -VMName <VMName> | where {$_.MacAddress –eq <VMmacaddress1>} | Set-VMNet-
workAdapter -VirtualSubnetID <virtualsubnetID>