1.环境说明
1.1系统版本
[root@lcx01 ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@lcx01 ~]# uname -r
2.6.32-696.el6.x86_64
1.2IP地址
gataway:10.0.0.254
bind0:10.0.0.201/24
2.关闭不必要的服务
2.1关闭selinux
[root@lcx01 ~]# setenforce 0
[root@lcx01 ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
2.2停止NetworkManager
[root@lcx01 ~]# /etc/init.d/NetworkManager stop
[root@lcx01 ~]# chkconfig NetworkManager off
[root@lcx01 ~]# /etc/init.d/network restart
3.双网卡绑定配置
[root@lcx01 ~]# cd /etc/sysconfig/network-scripts/
3.1编辑eth0、eth1网卡
[root@lcx01 network-scripts]# cat >ifcfg-eth0 <<EOF
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bind0
EOF
编辑eth1网卡
[root@lcx01 network-scripts]# cat >ifcfg-eth1 <<EOF
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
MASTER=bind0
EOF
3.2编辑bind0网卡
[root@lcx01 network-scripts]# cat >ifcfg-bind0<<EOF
DEVICE=bind0
TYPE=Ethernet(如果Networkmanager未关闭就用unknown)
ONBOOT=yes
BOOTPROTO=none
IPADDR=10.0.0.201
NETMASK=255.255.255.0
GATEWAY=10.0.0.254
IPV6INIT=no
USERCTL=no
EOF
3.3配置bind参数
[root@lcx01 network-scripts]# cat >/etc/modprobe.conf<< EOF
alias bind0 bonding
options bind0 miimon=100 mode=6
EOF
3.4重启生效
service network restart
ifenslave bind0 eth0 eth1