Nutanix AHV offers several different options to configure VM networking. One of them is change vNIC from access mode to trunked mode. VM with vNIC with access mode enabled can send or listen traffic over single VLAN. VM with vNIC in trunk mode can send or receive traffic from multiple VLANs. One of the use cases is IDS (Intruder Detection Systems), IPS (Intruder Prevention System), virtual firewalls appliances or virtual load balancers where a single VM needs access to multiple networks.
To enable VLAN trunking on Nutanix AHV VM network adapter, you have to invoke acli command.
acli vm.nic_update vm mac_addr [update_vlan_trunk_info={true | false}] [vlan_mode={kAccess | kTrunked}] [trunked_networks=networks]
In below example, 2 networks were trunked to single Nutanix AHV vNIC
vm.nic_update AWS-Win2k16-01 50:6b:8d:d9:0e:ad update_vlan_trunk_info=true vlan_mode=kTrunked trunked_networks=555,556
You can check if changes were applied, by getting VM details. As you noticed, vlan_mode is “kTrunked” and two trunked networks are listed.
acropolis$ vm.get AWS-Win2k16-01
AWS-Win2k16-01 {
}
hwclock_timezone: "America/Phoenix"
machine_type: "pc"
memory_mb: 1024
name: "AWS-Win2k16-01"
nic_list {
mac_addr: "50:6b:8d:d9:0e:ad"
network_name: "VLAN568"
network_type: "kNativeNetwork"
network_uuid: "d26a8da7-adfd-4870-b64d-d377f27ecbd2"
trunked_networks: 555
trunked_networks: 556
type: "kNormalNic"
uuid: "72493bb9-a076-45e7-aa73-85a0ef7896f9"
vlan_mode: "kTrunked"
}
acropolis>
I have recorded short video where you can watch the process.
To revert Nutanix AHV VM network configuration from trunked to access mode, execute below command
vm.nic_update VM_NAME MAC_ADDRESS update_vlan_trunk_info=true vlan_mode=kAccess
Youtube video made by Jason with a deep explanation of how VM trunking works on Nutanix AHV