Show Table of Contents
10.7. VLAN on Bond and Bridge Using the NetworkManager Command Line Tool, nmcli
To use VLANs over bonds and bridges, proceed as follows:
- Add a bond device:
~]$
Note that in this case a bond connection serves only as a "lower interface" for VLAN, and does not get any IP address. Therefore, thenmcli connection add type bond con-name Bond0 ifname bond0 bond.options "mode=active-backup,miimon=100" ipv4.method disabled ipv6.method ignoreipv4.method disabledandipv6.method ignoreparameters have been added on the command line. - Add slaves to the bond device:
~]$
nmcli connection add type ethernet con-name Slave1 ifname em1 master bond0 slave-type bond~]$nmcli connection add type ethernet con-name Slave2 ifname em2 master bond0 slave-type bond - Add a bridge device:
~]$
nmcli connection add type bridge con-name Bridge0 ifname br0 ip4 192.0.2.1/24 - Add a VLAN interface on top of bond, enslaved to the bridge device:
~]$
nmcli connection add type vlan con-name Vlan2 ifname bond0.2 dev bond0 id 2 master br0 slave-type bridge - View the created connections:
~]$
nmcli connection showNAME UUID TYPE DEVICE Bond0 f05806fa-72c3-4803-8743-2377f0c10bed bond bond0 Bridge0 22d3c0de-d79a-4779-80eb-10718c2bed61 bridge br0 Slave1 e59e13cb-d749-4df2-aee6-de3bfaec698c 802-3-ethernet em1 Slave2 25361a76-6b3c-4ae5-9073-005be5ab8b1c 802-3-ethernet em2 Vlan2 e2333426-eea4-4f5d-a589-336f032ec822 vlan bond0.2

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.