积极答复者
hyper-v如何配置PVLAN功能

问题
-
内网核心上设有vlan9,10
根据What's New in Hyper-V Virtual Switch设置完PVLAN功能,在服务器内部可以实现PVLAN的功能。
但发现无法和外部核心交换机上VLAN 10的服务器之间的访问,请问问题出在哪里?
虚拟机 PVLAN功能需要外部交换机的PVLAN功能支持吗?还是在hyperv 里面可以直接使用powershell命令设置剥离secondary出去直接使用primaryvlanid ?
命令输入如下,上联口为trunk
Set-VMNetworkAdapterVlan –VMName VM1 –Isolated –PrimaryVlanId 10 –SecondaryVlanId 20
Set-VMNetworkAdapterVlan –VMName VM1 –Isolated –PrimaryVlanId 10 –SecondaryVlanId 30
谢谢
答案
-
您好!
我们发现您又发了一个内容非常相近的帖子,我们将在那个帖子中针对您的问题进行回复。
谢谢您的配合。
微软一站式示例脚本库: http://blogs.technet.com/b/onescript
- 已标记为答案 Tom Zhang – MSFTModerator 2013年1月29日 9:34
全部回复
-
您好!
我们发现您又发了一个内容非常相近的帖子,我们将在那个帖子中针对您的问题进行回复。
谢谢您的配合。
微软一站式示例脚本库: http://blogs.technet.com/b/onescript
- 已标记为答案 Tom Zhang – MSFTModerator 2013年1月29日 9:34
-
我也碰到同样的问题,不过琢磨了好久,这个问题顺利解决了,具体参考以下步骤:
1、在装了hyper-v role的2012 server上,通过lbfoadmin.exe命令,配置NIC Teaming。一个team包含几块物理网卡,可以根据自己的实际需要设置,当然一块网卡也成。
2、配完team以后,然后在team上根据primary vlan设置子接口,有几个primary vlan就新建几个对应vlan的子接口。
3、对于只有一个primary vlan的情况,网卡外接的物理交换机接口设置为access模式和对应的vlan;对于有多个primary vlan的情况,物理交换机接口设置为trunk模式,并允许所有这些primary vlan的报文通过。
4、通过hyper-v 管理器或powershell, 为每个primary vlan都新建一个v-switch。
5、给虚拟机添加合适的网卡,并挂到primary vlan对应的v-switch上。
6、同powershel命令,给每个虚拟机配置pvlan:比如
Set-VMNetworkAdapterVlan –VMName VM1 -Isolated –PrimaryVlanId 10 –SecondaryVlanId 20
Set-VMNetworkAdapterVlan –VMName VM2 -community –PrimaryVlanId 10 –SecondaryVlanId 30
Set-VMNetworkAdapterVlan –VMName VM3 -promiscuous –PrimaryVlanId 10 –SecondaryVlanIdlist 20-307、通过以上按序ke作了!
- 已建议为答案 GlaveTiger 2013年2月16日 14:47
-
建议看看http://blogs.technet.com/b/keithmayer/archive/2012/11/20/vlan-tricks-with-nic-teaming-in-windows-server-2012.aspx#.UTE0TrOS3IU
Should I use VLANs with NIC Teaming in Hyper-V?
No. When using Hyper-V to virtualize workloads, our recommendation is to configure all VLANs for VMs within the Hyper-V Virtual Network Switch instead of configuring VLANs on team interfaces. Taking this approach ensures that virtual machines are capable of being configured for any VLAN traffic that is passed to the NIC team and prevents confusing configurations that can occur when certain VLAN traffic is split off on a separate VLAN from the Hyper-V Virtual Switch.
To configure a particular VLAN ID for Hyper-V management traffic, specify that VLAN ID in the Virtual Switch properties in Hyper-V Manager using the Virtual Switch Manager dialog.
To configure a particular VLAN ID for a virtual machine, specify that VLAN ID in the VM Network Adapter properties in Hyper-V Manager in the Settings of that virtual machine.