User Manual

Table Of Contents
Rev 4.60
Mellanox Technologies
34
3.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. Create a vSwitch.
Step 2. Shut down the VMs.
Step 3. 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 4. Configure the Provider Address and Route records on Hyper-V Host 1 (Host 1 Only).
Step 5. Configure a Subnet Locator and Route records on each Hyper-V Host (Host 1 and Host 2).
Step 6. Add customer route.
Step 7. Configure the Provider Address and Route records on Hyper-V Host 1 (Host 1 Only).
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).
New-VMSwitch <vSwitchName> -NetAdapterName <EthInterfaceName>-AllowManagementOS $true
Stop-VM -Name <VM Name> -Force -Confirm
Add-VMNetworkAdapter -VMName <VMName> -SwitchName <vSwitchName> -StaticMacAddress <StaticMAC
Address>
New-NetVirtualizationProviderRoute -InterfaceIndex $NIC.InterfaceIndex -DestinationPrefix <dest-
prefix> -NextHop <nexthopvalue>
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>
a
a. The Hypervisor Interface IP address is 192.168.20.118 and the -NextHop will be 192.168.20.1
Get-VMNetworkAdapter -VMName <VMName> | where {$_.MacAddress –eq <VMmacaddress1>} | Set-VMNet-
workAdapter -VirtualSubnetID <virtualsubnetID>
Please repeat steps 5 to 8 on each VM after rebooting the hypervisor.