2018年1月6日星期六

Configure MAC addresses for Hyper-v

Each physical network adapter has a Media Access Control (MAC) address (sometimes called a hardware address), that is unique identifier of the device on the network. The same is true of virtual network adapters.

Hyper-v has a pool of address and assign them as you create virtual network adapter.

To view or modify the MAC address pool for the Hyper-v server, open Virtual Switch Manager and select MAC Address Range under Global Network Settings.
































The Hyper-v MAC address has the following sections:
Byte 1 to 3: OO-15-5D,which is an OUI registered by Microsoft.
Byte 4 and 5: Consists of the last two bytes of the IP address assigned to the server’s physical network adapter, converted to hexadecimal notation.
Byte 6: from 00 to FF, which provides 256 possible addresses

The default pool of 256 addresses is expected to be sufficient of most cases, if you need enlarge the address pool, you can modifying the second to last bytes as well increases the pool from 256 to 4,096 or more, as in the following range:
256 address pool: 00-15-5D-FE-FA-00 to 00-15-5D-FE-FA-FF
4096 address pool: 00-15-5D-FE-F0-00 to 00-15-5D-FE-FF-FF
65536 address pool: 00-15-5D-FE-00-00 to 00-15-5D-FE-FF-FF
More: … … … …

You can use Get-Host cmdlet on Windows PowerShell to view Mac address range.





You can use Set-Host cmdlet on Windows PowerShell to change Mac address range.



Virtual network adapters use dynamically assigned MAC addresses by default, but you can configure the virtual network adapters to use static MAC addresses.

Expand a network adapter in the Settings dialog box of a VM, access to the Advanced Feature page. On this page,you can configure MAC address of the Virtual Network Adapter:





























You can use Set-VMNetworkAdapter cmdlet on Windows PowerShell to change MAC address of virtual network adapter.
VMName: Virtual machine name
StaticMACAddress: To use static MAC address

2018年1月3日星期三

Creating a new virtual switch for Hyper-v Server

When you install the Hyper-v role in the Add Roles And Features Wizard, you can create the Hyper-v Server's first virtual switches. If without a virtual switch, the virtual machine will unable to communicate with other.

Open Hyper-v Manager, Select Hyper-v Server you want to creat virtual switch. Then right-click it and select Virtual Switch Manager or select Virtual Switch Manager in the Actions pane.


















Select the following switch types, and click Create Virtual Switch:
External: The virtual switch is bound to networking protocol stack in the host operating system and connected to a physical network adapter. Ability to communicate with the physical network.
Internal: Bound to a separate instance of the networking protocol stack in the host operating system, independent from the physical network interface adapter and its connected network. The Hyper-v host operating system can access the physical network through the physical network interface adapter, but the virtual machines cannot access the physical network through the physical adapter.
Private: A private virtual switch can only be accessed by a virtual machine running on a hyper-v host.





























Type a name for the new virtual switch in the name text box.
If Select an External Network, you also need select the physical network adapter to which the virtual switch will be bound. And need configure the following option:
Allow Management Operating System To Share This Network Adapter: Selected by default when you create an external virtual switch, clearing this check box the host operating system will not be able to use this physical network adapter.
Enable Single Root I/O Virtualization (SR-IOV): Allows you to create an external virtual switch associated with a physical network adapter that supports SR-IOV. This option is only available when creating a new virtual switch; you cannot change an existing virtual switch's this option.
Enable Virtual LAN Identification For Management Operating System: If your environment uses VLANs, you also need to select this check box and configure the VLAN identifier.
Then click OK.





























Each physical network adapter can only create one virtual switch, but you can create multiple internal or private virtual switches.

You can use the New-VMSwitch cmdlet on Windows PowerShell to create a new virtual switch.
Name: Virtual Switch Name
NetAdapterName: The name of the network adapter to which the virtual switch is bound.
If don't know the name of the network adapter, you can use Get-NetAdapter cmdlet on Windows PowerShell to see.











Create a new Private or Internal virtual switch.
Name: Virtual Switch Name
SwitchType: The type of virtual switch; Private or Internal.