To create a bond, named
mybond0, issue a command as follows:
~]$ nmcli con add type bond con-name mybond0 ifname mybond0 mode active-backup
Connection 'mybond0' (9301ff97-abbc-4432-aad1-246d7faea7fb) successfully added.
To add a slave interface, issue a command in the following form:
~]$ nmcli con add type bond-slave ifname ens7 master mybond0
To add additional slaves, repeat the previous command with a new interface, for example:
~]$ nmcli con add type bond-slave ifname ens3 master mybond0
Connection 'bond-slave-ens3-1' (50c59350-1531-45f4-ba04-33431c16e386) successfully added.
Note that as no
con-name
was given for the slaves, the name was derived from the interface name by prepending the type. At time of writing,
nmcli only supports Ethernet slaves.
In order to bring up a bond, the slaves must be brought up first as follows:
~]$ nmcli con up bond-slave-ens7
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/14)
~]$ nmcli con up bond-slave-ens3
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/15)
Now bring up the bond as follows:
~]$ nmcli con up bond-mybond0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/16)