7种bond模式:
https://www.cnblogs.com/dkblog/p/3613407.html
1、为方便叙述,假设服务器A上搭载网卡有两个网口名字分别为eth1、eth2,服务器B上搭载的网卡有两个网口名字分别为eth3、eth4;
2、分别配置eth1和eth2为一个bond,eth3和eth4为一个bond,mode=0(0~6);
方式一:nmcli命令
创建主接口:nmcli con add type bond con-name bond0 ifname bond0 mode 0;
添加子接口:nmcli con add type bond-slave ifname eth1 master bond0;
nmcli con add type bond-slave ifname eth2 master bond0;
开启主接口和从接口:nmcli con up bond-slave-eth1、nmcli con up bond-slave-eth2 、nmcli con up bond0;
nmcli con mod bond0 ipv4.addresses '192.168.10.10/24' # 给bond配置ip
nmcli con mod bond0 ipv4.method manual
查看bond状态:使用nmcli con show 和所有connection 以及每个connection的信息;
删除band或slave:
cat /proc/net/bonding/bond0 也可查看bond信息。
nmcli con del bond0
nmcli con del bond-slave-eth1
若nmcli命令不可用:
可用ip 命令创建bond,方式如下:
ip link add bond0 type bond mode 0 # mode=0~6
ifconfig eth0 down
ip link set eth0 master bond0
ifconfig bond0 up
cat /proc/net/bonding/bond0 # 查看bond信息
ip link set eth0 nomaster
ifconfig eth0 up
3、为两个bond口配置同一网段的IP地址;
4、使用ping命令检查bond口连接,可以ping通。