首页 > 代码库 > bond

bond

#####链路聚合####

1 加网卡

真机  virt-manager

技术分享

2 建立bond

 第一个界面:

 (1)nmcli connection add con-name bond0 ifname bond0 type bond mode active-backup ip4 172.25.254.144/24 ###建立bond

 (2)nmcli connection add con-name eth0 ifname eth0 type bond-slave master bond0  ###添加网卡给bond 

 (3)nmcli connection add con-name eth1 ifname eth1 type bond-slave master bond0 ####添加网卡给bond

(4)watch -n 1 cat /proc/net/bonding/bond0  ###监控网卡的运行状态

技术分享

第二个界面:

ping 172.25.254.244  可以直接观察网络运行状态

技术分享

第二个界面:

(1) 1  ifconfig eth0 up  ####eth0 挂掉

      2 ifconfig eth1 up  ####eth1 挂掉

(2) 3 ifconfig eth1 down  ####eth1 恢复运行

      4  ifconfig eth0 down  ####eth0 恢复运行

打开三个界面,有利于直接观察网络状态。两张网卡其中一张挂掉,另一张补上。网络不断。  

bond