测试环境:银河麒麟服务器操作系统V10SP1
1、创建一个bond,将其命名为 bond0(名称可任意)
nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup
说明:
type bond 添加的连接类型为bond
con-name bond0 连接名称为bond0(名称可任意)
Ifname bond0 设备名为bond0
mode active-backup bond模式为主备模式,即bond mode1
2、添加bond slave
nmcli connection add type bond-slave con-name bond-slave-ens1f0 ifname ens1f0 master bond0
nmcli connection add type bond-slave con-name bond-slave-ens1f1 ifname ens1f1 master bond0
说明:
type bond-slave 添加的连接类型为bond-slave
con-name bond-slave-ens1f0 添加的bond slave连接名为bond-slave-ens1f0
ifname ens1f0 使用ens1f0 网口
master bond0 从属于bond0
3、激活bond和bond slave连接
nmcli connection up bond-slave-ens1f0
nmcli connection up bond-slave-ens1f1
nmcli connection up bond0
4、配置vlan
nmcli connection add type vlan ifname bond0.355 con-name bond0.355 id 355 dev bond0 ip4 192.168.81.139/24 gw4 192.168.81.2
说明:
type vlan 添加的连接名为vlan
con-name bond0.355 添加的vlan连接名称为bond0.355
ifname bond0.355 添加vlan设备名称为 bond0.355
id 355 vlan id为355
dev bond0 对bond0划分的vlan
ip4 192.168.81.139/24 配置IP地址及掩码
gw4 192.168.81.2 配置网关地址
5、激活vlan连接
nmcli connection up bond0.355