CentOS7网卡bond配置对p1p1p1p2两张网卡做bond步骤1)做之前请对各网卡配置进行备份1使用root账号登录服务器2cpp1p1p1p2网卡的初始配置到tmp目录下,进行备份。--------------------------------------------------------------[root@XACR-aliware04~]#cd/etc/sysconfig/network-scripts/[root@XACR-aliware04network-scripts]#cpifcfg-p1p1/tmp[root@XACR-aliware04network-scripts]#cpifcfg-p1p2/tmp--------------------------------------------------------------2)使用nmcli命令配置bond生成bond配置--------------------------------------------------------------nmcliconaddtypebondifnamebond0mode1nmcliconaddtypebond-slaveifnamep1p1masterbond0nmcliconaddtypebond-slaveifnamep1p2masterbond0注:p1p1p1p2为物理网卡的名字bond的mode如下:balance-rr(0)--轮询模式(bond默认的模式)active-backup(1)--主备模式(常用)balance-xor(2)broadcast(3)802.3ad(4)--聚合模式balance-tlb(5)balance-alb(6)--------------------------------------------------------------3)修改bond0网卡配置修改下面表格中标红的内容---------------------------------------------------------------cd/etc/sysconfig/network-scripts[root@XACR-aliware04network-scripts]#vimifcfg-bond-bond0DEVICE=bond0BONDING_OPTS=mode=active-backupTYPE=BondBONDING_MASTER=yesBOOTPROTO=static---将原来的dhcp改成staticDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noNAME=bond-bond0UUID=f4146d29-d694-4f13-ae59-56f940c7d120ONBOOT=yesIPADDR=192.168.80.7---配置分配给服务器的IP地址PREFIX=24--配置子网掩码GATEWAY=192.168.80.1---配置网关保存并退出---------------------------------------------------------------4)重启网络systemctlrestartnetwork–重启网络服务cat/proc/net/bonding/bond0---查看bond0接口的相关信息----------------------------------------------------------------[root@XACR-aliware04network-scripts]#cat/proc/net/bonding/bond0EthernetChannelBondingDriver:v3.7.1(April27,2011)BondingMode:fault-tolerance(active-backup)PrimarySlave:NoneCurrentlyActiveSlave:p1p2MIIStatus:upMIIPollingInterval(ms):100UpDelay(ms):0DownDelay(ms):0SlaveInterface:p1p1MIIStatus:upSpeed:10000MbpsDuplex:fullLinkFailureCount:2PermanentHWaddr:f4:e9:d4:9a:f1:a0SlavequeueID:0SlaveInterface:p1p2MIIStatus:upSpeed:10000MbpsDuplex:fullLinkFailureCount:2PermanentHWaddr:f4:e9:d4:9a:f1:a2SlavequeueID:0-------------------------------------------------------------------到此就完成bond配置了---