[root@openldap ~]# ifconfig
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
        inet 192.168.31.48  netmask 255.255.255.0  broadcast 192.168.31.255
        inet6 fe80::20c:29ff:fe55:5ed3  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:55:5e:d3  txqueuelen 1000  (Ethernet)
        RX packets 4116  bytes 265898 (259.6 KiB)
        RX errors 0  dropped 21  overruns 0  frame 0
        TX packets 83  bytes 11927 (11.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
eth0: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether 00:0c:29:55:5e:d3  txqueuelen 1000  (Ethernet)
        RX packets 828  bytes 52513 (51.2 KiB)
        RX errors 0  dropped 1  overruns 0  frame 0
        TX packets 58  bytes 9677 (9.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
eth1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST>  mtu 1500
        ether 00:0c:29:55:5e:d3  txqueuelen 1000  (Ethernet)
        RX packets 829  bytes 52547 (51.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 166  bytes 14000 (13.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 166  bytes 14000 (13.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@openldap ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
BOOTPROTO=static
DEVICE=bond0
NAME=bond0
TYPE=Bond
BONDING_MASTER=yes
ONBOOT=yes
IPADDR=192.168.31.48
NETMASK=255.255.255.0
GATEWAY=192.168.31.1
PREFIX=24
BONDING_OPTS="miimon=200 mode=1"
[root@openldap ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=none
DEVICE=eth0
NAME=eth0
BONDING_MASTER=yes
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@openldap ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
TYPE=Ethernet
BOOTPROTO=none
DEVICE=eth1
NAME=eth1
BONDING_MASTER=yes
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@openldap ~]#
[root@openldap ~]# 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: eth0
MII Status: up
MII Polling Interval (ms): 200
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:55:5e:d3
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:55:5e:dd
Slave queue ID: 0
[root@openldap ~]#
[root@openldap ~]# 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: eth0
MII Status: up
MII Polling Interval (ms): 200
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:55:5e:d3
Slave queue ID: 0
Slave Interface: eth1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:0c:29:55:5e:dd
Slave queue ID: 0
[root@openldap ~]#
 

可能会启动失败,bond0的状态不是UP, 查看/var/log/message可看到如下信息

Error: Connection activation failed: Master device bond0 unmanaged or not available for activation
 

需要禁用NetworkManager

 

systemctl stop NetworkManager.service

systemctl disable NetworkManager.service

centos7 bond0 双网卡配置的更多相关文章

  1. CentOS7.3虚拟机双网卡配置

    笔者在学习和工作中经常要用到linux,专门装一个linux主机固然可以,但是毕竟还要用到windows,解决的办法就是用vmware来搭建linux虚拟机.关于linux虚拟机上网的问题,笔者写过很 ...

  2. CentOs7中的网卡配置工具

    CentOs7中的网卡配置工具 摘自:https://blog.51cto.com/13572810/2087991 misslaziness1人评论2715人阅读2018-03-17 22:09:1 ...

  3. centos7下双网卡绑定

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

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

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

  5. 烂泥:VMWare Workation双网卡配置IP地址

    本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb 前几天给一个客户做远程项目实施,客户那边的服务器是Windows OS的,我们这边的业务 ...

  6. Ubuntu16.04双网卡配置,内网外网同时访问

    Ubuntu16.04双网卡配置,内网外网同时访问 配置:vim/etc/network/interface auto lo iface lo inet loopback auto eno1 ifac ...

  7. Centos双网卡配置默认路由

    Centos6.5 双网卡,我们只需要一个默认路由,如果两个都有或都没有会有一系列的问题 [root@centos]# vi /etc/sysconfig/network修改以下内容NETWORKIN ...

  8. windows server 2012 双网卡配置

    别用route 命令!!!!!! 在使用最新版的windows server 2012的时候,当存在两个或者多个网段的时候,就可以采用双网卡的方式来添加和配置路由.具体的设置方法如下: 网段1  19 ...

  9. linux双网卡配置

    一.VM虚拟机添加一个网络适配器. 选择自己需要的模式类型 二.启动虚拟机,配置网卡 按原先配置网卡的方式配置完(ip地址及默认网关还有网卡名不能跟原先的一样) 重启所有网卡(service netw ...

随机推荐

  1. 服务器上安装anaconda

    1.在anaconda网站下载安装包: 清华镜像网站:https://repo.continuum.io/archive/index.html 2.下载最新版本为python3 ,Linux64位的: ...

  2. HDU 2078 选课时间( 水题 )

    链接:传送门 思路:水题略 /************************************************************************* > File N ...

  3. 最全mysql的复制和读写分离

    mysql的复制和mysql的读写分离从来就不是一个简单的话题,今天笔者就详细来记录一下我学习的mysql.   mysql日至类型有:二进制日志,事务日志,错误日志,一般查询日志,中继日志,慢查询日 ...

  4. linux中fork()函数详解(搬砖)

    一.fork入门知识 一个进程,包括代码.数据和分配给进程的资源.fork()函数通过系统调用创建一个与原来进程几乎完全相同的进程,也就是两个进程可以做完全相同的事,但如果初始参数或者传入的变量不同, ...

  5. C++ throw的实验 & 异常类继承关系

    如果定义了 throw() 表示函数不抛出异常,这时候如果还是抛出,会导致运行时错误. #include <iostream> #include <exception> #in ...

  6. leveldb学习:sstable(2)

    block写入:block_builder block.h和.cc里定义了block的entry存储格式和restart,提供了entry的查找接口以及迭代器.那么怎样往写block里写entry呢? ...

  7. ZOJ Problem Set - 3820 Building Fire Stations 【树的直径 + 操作 】

    题目:problemId=5374" target="_blank">ZOJ Problem Set - 3820 Building Fire Stations 题 ...

  8. SICP 习题 (1.41)解题总结

    SICP 习题1.41 看似和周边的题目没有关系,突然叫我们去定义一个叫double的过程,事实上这道题的核心还是高阶函数. 题目要求我们定义一个过程double,它以一个过程作为參数,这个作为參数的 ...

  9. Effective Java(一)—— 创建和销毁对象

    在客户端(调用端)获取自身实例的方法: 公有的构造器: 类的静态工厂方法: 1. 使用静态工厂方法代替构造器 Boolean 是对基本类型 boolean 的包装类: public final cla ...

  10. BZOJ 3165 李超线段树

    思路: 李超线段树 我是把线段转成斜率的形式搞得 不知道有没有更简单的方法 //By SiriusRen #include <cmath> #include <cstdio> ...