[root@pay network-scripts]# cat ifcfg-bond0 |grep -v \#
TYPE=”Ethernet”
PROXY_METHOD=”none”
BROWSER_ONLY=”no”
BOOTPROTO=”static”
IPADDR=”192.168.67.111″
NETMASK=”255.255.255.0″
GATEWAY=”192.168.67.2″
DEFROUTE=”yes”
IPV4_FAILURE_FATAL=”no”
DEVICE=”bond0″
ONBOOT=”yes”
BONDING_OPTS=”miimon=100 mode=1″
[root@pay network-scripts]# cat ifcfg-ens38 |grep -v \#
TYPE=”Ethernet”
PROXY_METHOD=”none”
BROWSER_ONLY=”no”
BOOTPROTO=”static”
DEFROUTE=”yes”
IPV4_FAILURE_FATAL=”no”
DEVICE=”ens38″
MASTER=bond0
SLAVE=yes
[root@pay network-scripts]# cat ifcfg-ens39 |grep -v \#
TYPE=”Ethernet”
PROXY_METHOD=”none”
BROWSER_ONLY=”no”
BOOTPROTO=”static”
DEFROUTE=”yes”
IPV4_FAILURE_FATAL=”no”
DEVICE=”ens39″
MASTER=bond0
SLAVE=yes
[root@pay network-scripts]# service network restart
[root@pay ~]# ip a |egrep ‘bond|ens38|ens39’
4: ens38: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
5: ens39: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
inet 192.168.67.111/24 brd 192.168.67.255 scope global bond0
[root@pay ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens39
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: ens38
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:52:f7:35
Slave queue ID: 0
Slave Interface: ens39
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:52:f7:3f
Slave queue ID: 0
总结: TYPE=”Ethernet” 不能设置为bond , 也不用设置啥 /etc/modprobe.d/bonding.conf 添加 alias bond0 bonding
测试:!!!!!!!!!!!!!!!!!!
停掉其中1个网卡
[root@pay network-scripts]# ifdown ifcfg-ens39
Device ‘ens39’ successfully disconnected.
只剩下38
[root@pay ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens38
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: ens38
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:0c:29:52:f7:35
Slave queue ID: 0
[root@pay ~]# ifup ens39
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/28)
恢复39
[root@pay ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens38
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: ens38
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:0c:29:52:f7:35
Slave queue ID: 0
Slave Interface: ens39
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:52:f7:3f
Slave queue ID: 0
关掉38
[root@pay ~]# ifdown ens38
Device ‘ens38’ successfully disconnected.
[root@pay ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: ens39
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: ens39
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:52:f7:3f
Slave queue ID: 0
ifdown bond0后再ifup bond0 需要重启网卡才能恢复
- •VMware Workstation Pro 16安装CentOS7超详细图文步骤
- •CentOS7下配置使用JumpServer 堡垒机 (图文教程)
- •CentOS安装jdk的几种方法及配置环境变量方式
- •CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法
- •解决笔记本安装centos7后无法调节屏幕亮度
- •VMware安装CentOS 8.1(CentOS 8系列可参考)的图文详细教程
- •CentOS7 minimal 最小化安装网络设置过程
- •CentOS7下搭建JumpServer
- •CentOS安装rpm包出现冲突时的解决办法
- •Vmware下CentOS7最小化安装方式