[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 需要重启网卡才能恢复

centos7 bond双网卡的更多相关文章

  1. centos7 搭建双网卡bond1(主备模式)实例

    前景须知: 在redhat6 中网卡叫bond,在redhat7及centos7中改名team,此处只记录centos7中双网卡主备搭建过程. 应用情景:实现网络的高可用,防止一条网线或交换机故障影响 ...

  2. virtualbox 最小化安装centos7 配置双网卡(nat和桥接)记录----已经过期

    该文章已经过期   请参考另一篇文章:virtualbox 安装centos7 配置桥接网卡,实现主机和虚拟机互通,虚拟机可以访问外网,解决无法上网问题   先说明一下为什么要配置双网卡? 配置nat ...

  3. centos7下双网卡绑定

    一.进入网卡配置目录 cd /etc/sysconfig/network-scripts 二.备份原有网卡 mv ifcfg-em* /tmp/ 三.配置双网卡 nmcli con add type ...

  4. proxmox ve系统绑定上联外网出口bond双网卡

    背景描述:一个客户搭建proxmox ve系统,要求上联出口双网卡绑定bond, proxmox ve下载地址:超链接 记录日期:2020/5/9 前期准备:服务器接好2个网卡 交换机:H3C 1.p ...

  5. CentOS7配置双网卡绑定

    配置team0配置文件: [root@CentOS7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-team0DEVICE=team0DEVICETYPE= ...

  6. linux-rhel7配置网卡bond双网卡主备模式

    参考以下文章中的 2.centos7配置bonding: https://www.cnblogs.com/huangweimin/articles/6527058.html 以下是配置过程的操作和打印 ...

  7. Oracle Linux 6.4(BOND)双网卡绑定实战—附加说明

    操作环境Oracle Linux Server release 6.4内核Linux rac1 2.6.39-400.17.1.el6uek.x86_64 [root@RAC-2 ~]# vi /et ...

  8. centos7 bond0 双网卡配置

    [root@openldap ~]# ifconfig bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500 ...

  9. Centos7.6 双网卡,修改默认路由

    centos修改默认路由 需求:服务器有两个网卡,一个是内网网卡,一个是外网网卡,但是默认的路由是内网: route -n 列出所有路由: 删除默认的路由: route del default gw ...

随机推荐

  1. DAY1小题

    F 求逆序对的板子题 #include<cstdio> #define ll long long using namespace std; ; ll a[maxn],r[maxn],n; ...

  2. Pychram 运行程序在 run 窗口和 python console 窗口之间切换

    有图有真相 第一步: 第二步:

  3. 卸载mysql时,提示libmysqlclient.so.16()(64bit) is needed by (installed) postfix

    卸载时,提示错误,用这个命令就可以rpm -e --nodeps mysql-libs-5.1.73-5.el6_6.x86_64(这个是自己要卸载的版本) [root@unaryhost dev]# ...

  4. Linux新手常用命令

    Linux下有时候需要转换到管理员权限 su root   然后输入密码  或者直接  su ---------------------------------------- 但可能存在鉴定错误的异常 ...

  5. Codeforces Round #620 (Div. 2) B. Longest Palindrome

    Returning back to problem solving, Gildong is now studying about palindromes. He learned that a pali ...

  6. 在Eclipse或Myeclipse安装Maven插件的几种方法

    http://blog.csdn.net/lfsfxy9/article/details/9397937

  7. C语言中的快速排序函数

    C库中有自带的快排函数 qsort() ; 它的函数原型为: void qsort(void * , size_t ,size_t size , int (__cdecl *)(const  void ...

  8. Python 使用pillow 操作图像

    文档:https://pillow.readthedocs.io/en/stable/index.html 计算机图像基础 颜色和RGBA值 计算机程序通常将图像中的颜色表示为 RGBA 值.RGBA ...

  9. Win10中小娜无法搜索本地应用

    解决方案 1.win+X  -    Windows PowerShell(管理员) 2. 输入Get-AppXPackage -Name Microsoft.Windows.Cortana | Fo ...

  10. URL和 URI 的区别

    URL:统一资源定位符 URI:统一资源标识符 URL 是 URI 的一个子集: 来源知乎 1.统一资源标识符 URI 就是在某一规则下能把一个资源独一无二的表示出来. 拿人做例子,假设这个世界上多有 ...