What is vnet2 interface in AHV host used for? | Nutanix Community
Skip to main content

As the title said, does anyone know about this interface is used for?

hi @hienle 

vnet interfaces are actually the OVS port being used by the CVM to connect to bridges (br0 and virbr0).

vnet0 is mapped to br0 (Bridge Type) which is external network and vnet1 is mapped to Native Linux Bridge  or virbr0 (Network Type) which is the internal network.

hope that helps

BR


hi @hienle 

vnet interfaces are actually the OVS port being used by the CVM to connect to bridges (br0 and virbr0).

vnet0 is mapped to br0 (Bridge Type) which is external network and vnet1 is mapped to Native Linux Bridge  or virbr0 (Network Type) which is the internal network.

hope that helps

BR

Hi Mutahir,

Thanks you for your answer but I am asking about vnet2 as you can find it in the result of ovs-vsctl show command in AHV host.


Hi @hienle 

vnet2 will be there if you have network segmentation / backplane network enabled. 

BR


Hi @Mutahir 

You are mentioning about network segmentation, it means that when CVM is assigned the VLAN, the vnet2 will be used?

As I have known by far, the vnet0 is the br0 interface that connecting to eth0 of CVM. If we have assigned the VLAN for CVM, why would the vnet0 not be used but vnet2?

In the AHV host network topology, I cannot find vnet2 anywhere so it is quite hard for me to understand about why vnet2 is assigned VLAN instead of vnet0


@hienle

It’s an interesting question and turns out not as straightforward.

  1. Interfaces are enumerated on the boot and thus names can change i.e. what is now vnet2 may end up being vnet1.
  2. There is a diagram in Nutanix Bible where a vnet2 is mentioned as local interface which means that it is used for communication between CVM and AHV host.

     

  3. This third (let’s call it that to eliminate the confusion) interface is used indeed with network segmentation as an eth2 is brought into UP state on CVM.

I understand this is not exhaustive and potentially strays away from what you may be looking for and I apologise for that. Please let me know if you have further questions.


@Alona 

Thanks a lot for your reply.

From the topology that you have just posted, it seems that the vnet2 is the interface used in local virbr0. As you said that the bridge interfaces are enumerated when the host booted, in some cases the vnet1 could become the vnet2 and the vnet2 could be the vnet1 and their roles could be interchangeable, could’t it?

Besides, from your topology, I see that the roles of bridge interfaces are as below:

vnet0: for outside connection

vnet2: for local connection between CVM and AHV host

vnet1 (the third interface): for network segmentation?

So if I assigned the VLAN to CVM in this case, which interface will be used for VLAN assignment?

 

 


Hi @Mutahir 

You are mentioning about network segmentation, it means that when CVM is assigned the VLAN, the vnet2 will be used?

As I have known by far, the vnet0 is the br0 interface that connecting to eth0 of CVM. If we have assigned the VLAN for CVM, why would the vnet0 not be used but vnet2?

In the AHV host network topology, I cannot find vnet2 anywhere so it is quite hard for me to understand about why vnet2 is assigned VLAN instead of vnet0

Hi @hienle 

vnet0 = for external traffic (on ovs-switch) 

vnet1 = CVM to Host traffic (192.168.5.x subnet - internal) on virbr0 (native linux bridge)

vnet2 = will only be used / available if cvm backplane network is configured. (on ovs-switch)

It has got nothing to do with vLAN assignment - you can assign any vlan as per your network layout/design to any vnet exceptvnet1

following link will also assist you in understanding:

https://portal.nutanix.com/#/page/docs/details?targetId=Nutanix-Security-Guide-v511:wc-network-segmentation-wc-c.html

Hope this helps

BR


@Mutahir

In fact, I have experienced configuring Nutanix blocks and you can see that if utilizing the change_cvm_vlan command in CVM, the vnet2 will always be used to be assigned the VLAN tag. So this is the point leading me to the question that I posted in the title. At the time of assigning VLAN by above command, I do not configure any backplane network settings so I am assuming that the command behavior is to auto configure the vlan tag on vnet2. 

By the way, is there any difference between the cases in which I change VLAN of CVM before and after creating cluster? 

 


Here is how I look at it. 

  1. Dont not get hung up on what vnet is used for?
  2. As of today , CVM has 3 ports, eth0, eth1 and eth2. 
  3. eth0 is the port connected to the external IP address
  4. eth1 is connected to the internal linux bridge. 
  5. eth2 is present incase customer configures backplane. 

Use of certain scripts can change what vnet0, vnet1 and vnet2 represents.

The way to check this is to match the Mac address of eth0, eth1 and eth2 from CVM (ifconfig) to the ifconfig output shown when run from the host and compare the vnet interfaces. 

Match the mac address to know which interface is actually external and which one is internal. 

The only thing set in stone is eth0 is always external and eth1 is always connected to internal linux bridge. The naming of the port where it connects to the OVS is interchangeable and is executed and the time of the boot from the CVM config xml. 

 

Output from CVM : 

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.2.126.26  netmask 255.255.252.0  broadcast 10.2.127.255

        inet6 fe80::526b:8dff:feb0:fdc1  prefixlen 64  scopeid 0x20<link>

        ether xx:xx:8d:b0:fd:c1  txqueuelen 1000  (Ethernet)

 

Output from Host : 

vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet6 fe80::fc6b:8dff:feb0:fdc1  prefixlen 64  scopeid 0x20<link>

        ether xx:xx:8d:b0:fd:c1  txqueuelen 1000  (Ethernet)

     In this case , eth0 is connected to vnet0.