Este conteúdo não está disponível no idioma selecionado.
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, the
nmcli connection add type bond con-name Bond0 ifname bond0 bond.options "mode=active-backup,miimon=100" ipv4.method disabled ipv6.method ignore
~]$ nmcli connection add type bond con-name Bond0 ifname bond0 bond.options "mode=active-backup,miimon=100" ipv4.method disabled ipv6.method ignore
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ipv4.method disabled
andipv6.method ignore
parameters have been added on the command line. - Add ports 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
~]$ 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
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add a bridge device:
nmcli connection add type bridge con-name Bridge0 ifname br0 ipv4.method manual ipv4.addresses 192.0.2.1/24
~]$ nmcli connection add type bridge con-name Bridge0 ifname br0 ipv4.method manual ipv4.addresses 192.0.2.1/24
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add a VLAN interface on top of bond, assigned to the bridge device:
nmcli connection add type vlan con-name Vlan2 ifname bond0.2 dev bond0 id 2 master br0 slave-type bridge
~]$ nmcli connection add type vlan con-name Vlan2 ifname bond0.2 dev bond0 id 2 master br0 slave-type bridge
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - View the created connections:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow