Multiple VLAN trunk, with one NIC, and one IPv4 network

I try to have one Hyper-V VM in two VLANs, with only one network card, trunked on the link going to the switch.

I’ve one switch CISCO. Here is it’s config:

interface FastEthernet0/1
 switchport mode trunk
interface FastEthernet0/8
 switchport access vlan 2
 switchport mode access
interface FastEthernet0/9
 switchport access vlan 3
 switchport mode access
interface FastEthernet0/10
 switchport access vlan 240
 switchport mode access

I’ve a physical machine (named PC1) (Win 10 Pro) plugged in port fa0/1. This machine owns Hyper-V. In Hyper-V, I’ve a VM named "my_vm".

In Hyper-V, I’ve done:

Get-VMNetworkAdapter -VMName my_vm | Where-Object -Property MacAddress -eq "0000006CA095" | Set-VMNetworkAdapterVlan -Trunk -AllowedVlanIdList "2-3" -NativeVlanId 240

MAC address seems to be good. I’ve verified and obtained:

PS C:> Get-VMNetworkAdapterVlan

VMName           VMNetworkAdapterName Mode     VlanList
——           ——————- —-     ——-
my_vm            Carte réseau         Trunk    240,2-3

I’ve an other physical machine (named PC2).

"my_vm" and PC2 are on the same IPv4 network ( and

"my_vm" is always plugged on port fa0/1 on the switch.

When I plug PC2 on port fa0/10 (mode access, VLAN 240): "my_vm" and PC2 are pinging themselves.

When I plug PC2 on port fa0/8 (mode access, VLAN 2), or on port fa0/9 (mode access, VLAN 3): "my_vm" and PC2 can’t ping themselves.

Hyper-V VM "my_vm" can be a Win 10 Pro or a Debian, the result is the same.

On physical machine PC1, I’ve two physical NIC (Intel I219V and TP-Link TG-3468 - Realtek in fact): the result is the same. "Priority and VLAN" is "Enabled" on this two NIC.

TAG seems to be good when arriving on VM: if I DON’T use

"Get-VMNetworkAdapter -VMName my_vm | Where-Object -Property MacAddress -eq "0000006CA095" | Set-VMNetworkAdapterVlan -Trunk -AllowedVlanIdList "2-3" -NativeVlanId 240"

and, for VM "my_VM", for it’s network card (an external switch to NIC in fact), if I set "Activate virtual LAN identification" > VLAN 2, "my_vm" and PC2 plug on port fa0/8 (VLAN 2 - access) are pinging themselves.

If I set "Activate virtual LAN identification" > VLAN 3, "my_vm" and PC2 plug on port fa0/9 (VLAN 3 - access) are pinging themselves.

I don’t know how to moving forward.

Thanks for all.

Best regards.

Read full post . . . .

Go Que Newsroom