summerinsist 2020-04-29
service NetworkManager status #--注意大小写,N、M大写 如果步骤1返回 “NetworkManager (pid XXX) 正在运行...” 则执行 service NetworkManager stop chkconfig NetworkManager off
mkdir /root/bak cp -p /etc/sysconfig/network-scripts/ifcfg-eth0 /root/bak/ifcfg-eth0 cp -p /etc/sysconfig/network-scripts/ifcfg-eth1 /root/bak/ifcfg-eth1 cp -p /etc/modprobe.d/dist.conf /root/bak/dist.conf cp -p /etc/rc.d/rc.local /root/bak/rc.local
vim /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=static IPADDR=10.213.14.53 --修改为实际IP地址 NETMASK=255.255.255.128 --修改为实际子网掩码 GATEWAY=10.213.14.126 --修改为实际网关 USERCTL=no BONDING_OPTS="mode=1 miimon=100" #修改 /etc/sysconfig/network-scripts/ifcfg-eth0 cat /dev/null > /etc/sysconfig/network-scripts/ifcfg-eth0 vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=none MASTER=bond0 SLAVE=yes USERCTL=no #修改 /etc/sysconfig/network-scripts/ifcfg-eth1 cat /dev/null > /etc/sysconfig/network-scripts/ifcfg-eth1 vi /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 TYPE=Ethernet ONBOOT=yes NM_CONTROLLED=no BOOTPROTO=none MASTER=bond0 SLAVE=yes USERCTL=no
vim /etc/modprobe.d/dist.conf 在文件最后增加:alias bond0 bonding options bond0 miimon=100 mode=1 vim /etc/rc.d/rc.local 再倒数第二行增加: ifenslave bond0 eth0 eth1 touch /var/lock/subsys/local --这是原来的最后一行内容
reboot
more /proc/net/bonding/bond0