Product SiteDocumentation Site

J.16.9.14. Setting VLAN tag (on supported network types only)

To specify the VLAN tag configuration settings, use a mangement tool to make the following changes to the domain XML:

  ...
  <devices>
    <interface type='bridge'>
      <vlan>
        <tag id='42'/>
      </vlan>
      <source bridge='ovsbr0'/>
      <virtualport type='openvswitch'>
        <parameters interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'/>
      </virtualport>
    </interface>
  <devices>
  ...

Figure J.52. Setting VLAN tag (on supported network types only)

If (and only if) the network connection used by the guest supports vlan tagging transparent to the guest, an optional vlan element can specify one or more vlan tags to apply to the guest's network traffic (openvswitch and type='hostdev' SR-IOV interfaces do support transparent vlan tagging of guest traffic; everything else, including standard linux bridges and libvirt's own virtual networks, do not support it. 802.1Qbh (vn-link) and 802.1Qbg (VEPA) switches provide their own way (outside of libvirt) to tag guest traffic onto specific vlans.) To allow for specification of multiple tags (in the case of vlan trunking), a subelement, tag, specifies which vlan tag to use (for example: tag id='42'/. If an interface has more than one vlan element defined, it is assumed that the user wants to do VLAN trunking using all the specified tags. In the case that vlan trunking with a single tag is desired, the optional attribute trunk='yes' can be added to the toplevel vlan element.