CentOS7双网卡绑定配置
step1:创建绑定文件
[root@node-1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
TYPE="bond"
BOOTPROTO="none"
NAME="bond0"
DEVICE="bond0"
IPADDR="192.168.1.20"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
DNS1="8.8.8.8"
DNS2="8.8.4.4"
ONBOOT="yes"
step2:编辑需要绑定的物理网卡,并且指定主从,如下:
[root@node-1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE="Ethernet"
BOOTPROTO="none"
NAME="eth0"
DEVICE="eth0"
MASTER="bond0"
SLAVE="yes"
ONBOOT="yes"
[root@node-1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE="Ethernet"
BOOTPROTO="none"
NAME="eth1"
DEVICE="eth1"
MASTER="bond0"
SLAVE="yes"
ONBOOT="yes"
step3:创建bond文件,并且设定冗余的模式
[root@node-1 ~]# vi /etc/modprobe.d/bonding.conf
alias bond0 binding
options bond0 miimon=100 mode=1
step4:重启机器
注:关于mode的说明
mode=0 //平衡循环
mode=1 //主备
mode=3 //广播
mode=4 //链路聚合