Windows hyper v vlan

Настройка и просмотр параметров виртуальной локальной сети на портах виртуального коммутатора Hyper-V Configure and View VLAN Settings on Hyper-V Virtual Switch Ports

Область применения. Windows Server (Semi-Annual Channel), Windows Server 2016 Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016

С помощью этого раздела вы узнаете о рекомендациях по настройке и просмотру параметров виртуальной локальной сети (VLAN) на порте виртуального коммутатора Hyper-V. You can use this topic to learn best practices for configuring and viewing virtual Local Area Network (VLAN) settings on a Hyper-V Virtual Switch port.

Если вы хотите настроить параметры виртуальной ЛС на портах виртуального коммутатора Hyper-V, можно использовать ® Диспетчер Hyper-v или System Center Virtual Machine Manager (VMM) Windows Server 2016. When you want to configure VLAN settings on Hyper-V Virtual Switch ports, you can use either Windows® Server 2016 Hyper-V Manager or System Center Virtual Machine Manager (VMM).

Если вы используете VMM, VMM использует следующую команду Windows PowerShell для настройки порта коммутатора. If you are using VMM, VMM uses the following Windows PowerShell command to configure the switch port.

Если вы не используете VMM и настраиваете порт коммутатора в Windows Server, можно использовать консоль диспетчера Hyper-V или следующую команду Windows PowerShell. If you are not using VMM and are configuring the switch port in Windows Server, you can use the Hyper-V Manager console or the following Windows PowerShell command.

Из-за этих двух методов настройки параметров виртуальной ЛС на портах виртуального коммутатора Hyper-V возможно, что при попытке просмотреть параметры порта коммутатора не настроены параметры виртуальной ЛС, даже если они настроены. Because of these two methods for configuring VLAN settings on Hyper-V Virtual Switch ports, it is possible that when you attempt to view the switch port settings, it appears to you that the VLAN settings are not configured — even when they are configured.

Используйте тот же метод для настройки и просмотра параметров виртуальной ЛС для порта коммутатора. Use the same method to configure and view switch port VLAN settings

Чтобы убедиться, что эти проблемы не возникают, необходимо использовать тот же метод для просмотра параметров виртуальной ЛС порта коммутатора, которые использовались для настройки параметров VLAN для порта коммутатора. To ensure that you do not encounter these issues, you must use the same method to view your switch port VLAN settings that you used to configure the switch port VLAN settings.

Чтобы настроить и просмотреть параметры порта коммутатора виртуальной ЛС, необходимо выполнить следующие действия. To configure and view VLAN switch port settings, you must do the following:

  • Если вы используете VMM или сетевой контроллер для настройки и управления сетью и развернули программно-определяемую сеть (SDN), необходимо использовать командлеты вмнетворкадаптерисолатион . If you are using VMM or Network Controller to set up and manage your network, and you have deployed Software Defined Networking (SDN), you must use the VMNetworkAdapterIsolation cmdlets.
  • Если вы используете диспетчер Hyper-V для Windows Server 2016 или командлеты Windows PowerShell и не развернули программно-определяемую сеть (SDN), необходимо использовать командлеты вмнетворкадаптервлан . If you are using Windows Server 2016 Hyper-V Manager or Windows PowerShell cmdlets, and you have not deployed Software Defined Networking (SDN), you must use the VMNetworkAdapterVlan cmdlets.
Читайте также:  Как собрать cmake linux

Возможные проблемы Possible issues

Если не следовать этим рекомендациям, могут возникнуть следующие проблемы. If you do not follow these guidelines you might encounter the following issues.

  • В случаях, когда вы развернули SDN и используете VMM, сетевой контроллер или командлеты вмнетворкадаптерисолатион для настройки параметров виртуальной ЛС на порте виртуального коммутатора Hyper-V: Если вы используете диспетчер Hyper-v или получите вмнетворкадаптервлан для просмотра параметров конфигурации, в выходных данных команды не отображаются параметры виртуальной ЛС. In circumstances where you have deployed SDN and use VMM, Network Controller, or the VMNetworkAdapterIsolation cmdlets to configure VLAN settings on a Hyper-V Virtual Switch port: If you use Hyper-V Manager or Get VMNetworkAdapterVlan to view the configuration settings, the command output does not display your VLAN settings. Вместо этого для просмотра параметров виртуальной ЛС необходимо использовать командлет Get-вмнетворкисолатион . Instead you must use the Get-VMNetworkIsolation cmdlet to view the VLAN settings.
  • В случаях, когда вы не развернули SDN, вместо этого используйте диспетчер Hyper-V или командлеты вмнетворкадаптервлан для настройки параметров виртуальной ЛС на порте виртуального коммутатора Hyper-V. Если вы используете командлет Get-вмнетворкисолатион для просмотра параметров конфигурации, в выходных данных команды не отображаются параметры виртуальной ЛС. In circumstances where you have not deployed SDN, and instead use Hyper-V Manager or the VMNetworkAdapterVlan cmdlets to configure VLAN settings on a Hyper-V Virtual Switch port: If you use the Get-VMNetworkIsolation cmdlet to view the configuration settings, the command output does not display your VLAN settings. Вместо этого для просмотра параметров виртуальной ЛС необходимо использовать командлет Get вмнетворкадаптервлан . Instead you must use the Get VMNetworkAdapterVlan cmdlet to view the VLAN settings.

Также важно не пытаться настроить те же параметры виртуальной ЛС для порта коммутатора с помощью обоих методов настройки. It is also important not to attempt to configure the same switch port VLAN settings by using both of these configuration methods. В этом случае порт коммутатора будет неправильно настроен, а результат может быть неудачным при сетевом взаимодействии. If you do this, the switch port is incorrectly configured, and the result might be a failure in network communication.

Ресурсы Resources

Дополнительные сведения о командах Windows PowerShell, указанных в этом разделе, см. в следующих разделах: For more information on the Windows PowerShell commands that are mentioned in this topic, see the following:

Настройка виртуальных локальных сетей для Hyper-V Configure virtual local area networks for Hyper-V

Виртуальные локальные сети виртуальных ( ЛС ) предлагают один из способов изолировать сетевой трафик. Virtual local area networks (VLANs) offer one way to isolate network traffic. Виртуальные ЛС настраиваются в коммутаторах и маршрутизаторах, поддерживающих 802.1 q. VLANs are configured in switches and routers that support 802.1q. Если вы настроили несколько виртуальных ЛС и хотите, чтобы между ними происходил обмен данными, необходимо настроить сетевые устройства, чтобы это разрешить. If you configure multiple VLANs and want communication to occur between them, you’ll need to configure the network devices to allow that.

Для настройки виртуальных ЛС потребуется следующее: You will need the following to configure VLANs:

  • Физический сетевой адаптер и драйвер, поддерживающие маркировку VLAN 802.1 q. A physical network adapter and driver that supports 802.1q VLAN tagging.
  • Физический сетевой коммутатор, поддерживающий маркировку VLAN 802.1 q. A physical network switch that supports 802.1q VLAN tagging.

На узле вы настроите виртуальный коммутатор, чтобы разрешить сетевой трафик на порте физического коммутатора. On the host, you’ll configure the virtual switch to allow network traffic on the physical switch port. Это для идентификаторов виртуальных ЛС, которые вы хотите использовать для внутренних целей с виртуальными машинами. This is for the VLAN IDs that you want to use internally with virtual machines. Затем настройте виртуальную машину, чтобы указать виртуальную ЛС, которую виртуальная машина будет использовать для всех сетевых подключений. Next, you configure the virtual machine to specify the VLAN that the virtual machine will use for all network communications.

Читайте также:  Windows server trial period

Чтобы разрешить виртуальному коммутатору использовать виртуальную ЛС To allow a virtual switch to use a VLAN

Откройте — Диспетчер Hyper V. Open Hyper-V Manager.

В меню Действия выберите пункт Диспетчер виртуальных коммутаторов. From the Actions menu, click Virtual Switch Manager.

В разделе виртуальные коммутаторы выберите виртуальный коммутатор, подключенный к физическому сетевому адаптеру, который поддерживает виртуальные ЛС. Under Virtual Switches, select a virtual switch connected to a physical network adapter that supports VLANs.

В области справа в разделе идентификатор виртуальной ЛС выберите включить идентификацию виртуальной локальной сети , а затем введите номер виртуальной ЛС. In the right pane, under VLAN ID, select Enable virtual LAN identification and then type a number for the VLAN ID.

Весь трафик, проходящий через физический сетевой адаптер, подключенный к виртуальному коммутатору, будет помечен заданным ИДЕНТИФИКАТОРом виртуальной ЛС. All traffic that goes through the physical network adapter connected to the virtual switch will be tagged with the VLAN ID you set.

Чтобы разрешить виртуальной машине использовать виртуальную ЛС To allow a virtual machine to use a VLAN

Откройте — Диспетчер Hyper V. Open Hyper-V Manager.

В области результатов в разделе виртуальные машины выберите соответствующую виртуальную машину, а затем щелкните правой кнопкой мыши Параметры. In the results pane, under Virtual Machines, select the appropriate virtual machine and then right-click Settings.

В разделе оборудование выберите виртуальный коммутатор, для которого настроена виртуальная ЛС. Under Hardware, select an virtual switch that’s set up with a VLAN.

В области справа выберите включить идентификацию виртуальной локальной сети, а затем введите тот же идентификатор виртуальной ЛС, который указан для виртуального коммутатора. In the right pane, select Enable virtual LAN identification, and then type the same VLAN ID as the one you specified for the virtual switch.

Если виртуальная машина должна использовать больше виртуальных ЛС, выполните одно из следующих действий. If the virtual machine needs to use more VLANs, do one of the following:

Подключите другие виртуальные сетевые адаптеры к соответствующим виртуальным коммутаторам и назначьте идентификаторы виртуальных ЛС. Connect more virtual network adapters to appropriate virtual switches and assign the VLAN IDs. Убедитесь, что правильно настроены IP-адреса и что трафик, который нужно маршрутизировать через виртуальную ЛС, также использует правильный IP-адрес. Make sure to configure the IP addresses correctly and that the traffic you want to route through the VLAN also uses the correct IP address.

Настройте виртуальный сетевой адаптер в режиме магистрали с помощью командлета Set — вмнетворкадаптервлан . Configure the virtual network adapter in trunk mode using the Set-VMNetworkAdapterVlan cmdlet.

Configure virtual local area networks for Hyper-V

Virtual local area networks (VLANs) offer one way to isolate network traffic. VLANs are configured in switches and routers that support 802.1q. If you configure multiple VLANs and want communication to occur between them, you’ll need to configure the network devices to allow that.

You will need the following to configure VLANs:

  • A physical network adapter and driver that supports 802.1q VLAN tagging.
  • A physical network switch that supports 802.1q VLAN tagging.

On the host, you’ll configure the virtual switch to allow network traffic on the physical switch port. This is for the VLAN IDs that you want to use internally with virtual machines. Next, you configure the virtual machine to specify the VLAN that the virtual machine will use for all network communications.

To allow a virtual switch to use a VLAN

Open Hyper-V Manager.

From the Actions menu, click Virtual Switch Manager.

Under Virtual Switches, select a virtual switch connected to a physical network adapter that supports VLANs.

In the right pane, under VLAN ID, select Enable virtual LAN identification and then type a number for the VLAN ID.

Читайте также:  Пропал значок континент ап с панели задач windows что делать

All traffic that goes through the physical network adapter connected to the virtual switch will be tagged with the VLAN ID you set.

To allow a virtual machine to use a VLAN

Open Hyper-V Manager.

In the results pane, under Virtual Machines, select the appropriate virtual machine and then right-click Settings.

Under Hardware, select an virtual switch that’s set up with a VLAN.

In the right pane, select Enable virtual LAN identification, and then type the same VLAN ID as the one you specified for the virtual switch.

If the virtual machine needs to use more VLANs, do one of the following:

Connect more virtual network adapters to appropriate virtual switches and assign the VLAN IDs. Make sure to configure the IP addresses correctly and that the traffic you want to route through the VLAN also uses the correct IP address.

Configure the virtual network adapter in trunk mode using the Set-VMNetworkAdapterVlan cmdlet.

Configure and View VLAN Settings on Hyper-V Virtual Switch Ports

Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016

You can use this topic to learn best practices for configuring and viewing virtual Local Area Network (VLAN) settings on a Hyper-V Virtual Switch port.

When you want to configure VLAN settings on Hyper-V Virtual Switch ports, you can use either WindowsВ® Server 2016 Hyper-V Manager or System Center Virtual Machine Manager (VMM).

If you are using VMM, VMM uses the following Windows PowerShell command to configure the switch port.

If you are not using VMM and are configuring the switch port in Windows Server, you can use the Hyper-V Manager console or the following Windows PowerShell command.

Because of these two methods for configuring VLAN settings on Hyper-V Virtual Switch ports, it is possible that when you attempt to view the switch port settings, it appears to you that the VLAN settings are not configured — even when they are configured.

Use the same method to configure and view switch port VLAN settings

To ensure that you do not encounter these issues, you must use the same method to view your switch port VLAN settings that you used to configure the switch port VLAN settings.

To configure and view VLAN switch port settings, you must do the following:

  • If you are using VMM or Network Controller to set up and manage your network, and you have deployed Software Defined Networking (SDN), you must use the VMNetworkAdapterIsolation cmdlets.
  • If you are using Windows Server 2016 Hyper-V Manager or Windows PowerShell cmdlets, and you have not deployed Software Defined Networking (SDN), you must use the VMNetworkAdapterVlan cmdlets.

Possible issues

If you do not follow these guidelines you might encounter the following issues.

  • In circumstances where you have deployed SDN and use VMM, Network Controller, or the VMNetworkAdapterIsolation cmdlets to configure VLAN settings on a Hyper-V Virtual Switch port: If you use Hyper-V Manager or Get VMNetworkAdapterVlan to view the configuration settings, the command output does not display your VLAN settings. Instead you must use the Get-VMNetworkIsolation cmdlet to view the VLAN settings.
  • In circumstances where you have not deployed SDN, and instead use Hyper-V Manager or the VMNetworkAdapterVlan cmdlets to configure VLAN settings on a Hyper-V Virtual Switch port: If you use the Get-VMNetworkIsolation cmdlet to view the configuration settings, the command output does not display your VLAN settings. Instead you must use the Get VMNetworkAdapterVlan cmdlet to view the VLAN settings.

It is also important not to attempt to configure the same switch port VLAN settings by using both of these configuration methods. If you do this, the switch port is incorrectly configured, and the result might be a failure in network communication.

Resources

For more information on the Windows PowerShell commands that are mentioned in this topic, see the following:

Оцените статью