7.6. VLAN on Bond and Bridge Using ip Commands

To use VLANs over bonds and bridges, proceed as follows:
  1. Add a bond device as root:
    # ip link add bond0 type bond
    # ip link set bond0 type bond miimon 100 mode active-backup
    # ip link set em1 down
    # ip link set em1 master bond0
    # ip link set em2 down
    # ip link set em2 master bond0
    # ip link set bond0 up
  2. Set VLAN on the bond device:
    # ip link add link bond0 name bond0.2 type vlan id 2
    # ip link set bond0.2 up
  3. Add the bridge device and attach VLAN to it:
    # ip link add br0 type bridge
    # ip link set bond0.2 master br0
    # ip link set br0 up