linux-rhel7配置网卡bond双网卡主备模式
参考以下文章中的 2.centos7配置bonding:
https://www.cnblogs.com/huangweimin/articles/6527058.html
以下是配置过程的操作和打印消息:
[root@lnltedmr3 modprobe.d]# systemctl stop NetworkManager.service
[root@lnltedmr3 modprobe.d]# systemctl disable NetworkManager.service
Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.
Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.
[root@lnltedmr3 modprobe.d]# modprobe --first-time bonding
[root@lnltedmr3 modprobe.d]# lsmod | grep bonding
bonding 152656 0
[root@lnltedmr3 modprobe.d]# cd /etc/sysconfig/network-scripts/
[root@lnltedmr3 network-scripts]# vim ifcfg-bond0
[root@lnltedmr3 network-scripts]# cat ifcfg-bond0
DEVICE=bond0
TYPE=Bond
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.204.197.144
PREFIX=24
GATEWAY=10.204.197.1
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100"
[root@lnltedmr3 network-scripts]# ls
ifcfg-bond0 ifdown-ipv6 ifup-bnep ifup-sit
ifcfg-eno1 ifdown-isdn ifup-eth ifup-Team
ifcfg-eno2 ifdown-post ifup-ib ifup-TeamPort
ifcfg-eno3 ifdown-ppp ifup-ippp ifup-tunnel
ifcfg-eno4 ifdown-routes ifup-ipv6 ifup-wireless
ifcfg-lo ifdown-sit ifup-isdn init.ipv6-global
ifdown ifdown-Team ifup-plip network-functions
ifdown-bnep ifdown-TeamPort ifup-plusb network-functions-ipv6
ifdown-eth ifdown-tunnel ifup-post
ifdown-ib ifup ifup-ppp
ifdown-ippp ifup-aliases ifup-routes
[root@lnltedmr3 network-scripts]# ll
总用量 268
-rw-r--r--. 1 root root 156 2月 25 23:51 ifcfg-bond0
-rw-r--r--. 1 root root 408 2月 25 23:30 ifcfg-eno1
-rw-r--r--. 1 root root 353 2月 25 23:31 ifcfg-eno2
-rw-r--r--. 1 root root 277 2月 22 23:06 ifcfg-eno3
-rw-r--r--. 1 root root 277 2月 22 23:06 ifcfg-eno4
-rw-r--r--. 1 root root 254 8月 24 2018 ifcfg-lo
lrwxrwxrwx. 1 root root 24 2月 22 22:56 ifdown -> ../../../usr/sbin/ifdown
-rwxr-xr-x. 1 root root 654 8月 24 2018 ifdown-bnep
-rwxr-xr-x. 1 root root 6532 8月 24 2018 ifdown-eth
-rwxr-xr-x. 1 root root 6190 6月 27 2018 ifdown-ib
-rwxr-xr-x. 1 root root 781 8月 24 2018 ifdown-ippp
-rwxr-xr-x. 1 root root 4540 8月 24 2018 ifdown-ipv6
lrwxrwxrwx. 1 root root 11 2月 22 22:56 ifdown-isdn -> ifdown-ippp
-rwxr-xr-x. 1 root root 2130 8月 24 2018 ifdown-post
-rwxr-xr-x. 1 root root 1068 8月 24 2018 ifdown-ppp
-rwxr-xr-x. 1 root root 870 8月 24 2018 ifdown-routes
-rwxr-xr-x. 1 root root 1456 8月 24 2018 ifdown-sit
-rwxr-xr-x. 1 root root 1621 3月 18 2017 ifdown-Team
-rwxr-xr-x. 1 root root 1556 3月 18 2017 ifdown-TeamPort
-rwxr-xr-x. 1 root root 1462 8月 24 2018 ifdown-tunnel
lrwxrwxrwx. 1 root root 22 2月 22 22:56 ifup -> ../../../usr/sbin/ifup
-rwxr-xr-x. 1 root root 12415 8月 24 2018 ifup-aliases
-rwxr-xr-x. 1 root root 910 8月 24 2018 ifup-bnep
-rwxr-xr-x. 1 root root 13475 8月 24 2018 ifup-eth
-rwxr-xr-x. 1 root root 10114 6月 27 2018 ifup-ib
-rwxr-xr-x. 1 root root 12075 8月 24 2018 ifup-ippp
-rwxr-xr-x. 1 root root 11893 8月 24 2018 ifup-ipv6
lrwxrwxrwx. 1 root root 9 2月 22 22:56 ifup-isdn -> ifup-ippp
-rwxr-xr-x. 1 root root 650 8月 24 2018 ifup-plip
-rwxr-xr-x. 1 root root 1064 8月 24 2018 ifup-plusb
-rwxr-xr-x. 1 root root 4997 8月 24 2018 ifup-post
-rwxr-xr-x. 1 root root 4154 8月 24 2018 ifup-ppp
-rwxr-xr-x. 1 root root 2001 8月 24 2018 ifup-routes
-rwxr-xr-x. 1 root root 3303 8月 24 2018 ifup-sit
-rwxr-xr-x. 1 root root 1755 3月 18 2017 ifup-Team
-rwxr-xr-x. 1 root root 1876 3月 18 2017 ifup-TeamPort
-rwxr-xr-x. 1 root root 2711 8月 24 2018 ifup-tunnel
-rwxr-xr-x. 1 root root 1836 8月 24 2018 ifup-wireless
-rwxr-xr-x. 1 root root 5419 8月 24 2018 init.ipv6-global
-rw-r--r--. 1 root root 20671 8月 24 2018 network-functions
-rw-r--r--. 1 root root 31027 8月 24 2018 network-functions-ipv6
[root@lnltedmr3 network-scripts]# ls
ifcfg-bond0 ifdown-ipv6 ifup-bnep ifup-sit
ifcfg-eno1 ifdown-isdn ifup-eth ifup-Team
ifcfg-eno2 ifdown-post ifup-ib ifup-TeamPort
ifcfg-eno3 ifdown-ppp ifup-ippp ifup-tunnel
ifcfg-eno4 ifdown-routes ifup-ipv6 ifup-wireless
ifcfg-lo ifdown-sit ifup-isdn init.ipv6-global
ifdown ifdown-Team ifup-plip network-functions
ifdown-bnep ifdown-TeamPort ifup-plusb network-functions-ipv6
ifdown-eth ifdown-tunnel ifup-post
ifdown-ib ifup ifup-ppp
ifdown-ippp ifup-aliases ifup-routes
[root@lnltedmr3 network-scripts]# vim ifcfg-eno1
[root@lnltedmr3 network-scripts]# cp ifcfg-eno1 ifcfg-eno1_bak20190225
[root@lnltedmr3 network-scripts]# ls
ifcfg-bond0 ifdown-ippp ifup-aliases ifup-routes
ifcfg-eno1 ifdown-ipv6 ifup-bnep ifup-sit
ifcfg-eno1_bak20190225 ifdown-isdn ifup-eth ifup-Team
ifcfg-eno2 ifdown-post ifup-ib ifup-TeamPort
ifcfg-eno3 ifdown-ppp ifup-ippp ifup-tunnel
ifcfg-eno4 ifdown-routes ifup-ipv6 ifup-wireless
ifcfg-lo ifdown-sit ifup-isdn init.ipv6-global
ifdown ifdown-Team ifup-plip network-functions
ifdown-bnep ifdown-TeamPort ifup-plusb network-functions-ipv6
ifdown-eth ifdown-tunnel ifup-post
ifdown-ib ifup ifup-ppp
[root@lnltedmr3 network-scripts]# cp ifcfg-eno2 ifcfg-eno2_bak20190225
[root@lnltedmr3 network-scripts]# ls
ifcfg-bond0 ifdown-ib ifup ifup-ppp
ifcfg-eno1 ifdown-ippp ifup-aliases ifup-routes
ifcfg-eno1_bak20190225 ifdown-ipv6 ifup-bnep ifup-sit
ifcfg-eno2 ifdown-isdn ifup-eth ifup-Team
ifcfg-eno2_bak20190225 ifdown-post ifup-ib ifup-TeamPort
ifcfg-eno3 ifdown-ppp ifup-ippp ifup-tunnel
ifcfg-eno4 ifdown-routes ifup-ipv6 ifup-wireless
ifcfg-lo ifdown-sit ifup-isdn init.ipv6-global
ifdown ifdown-Team ifup-plip network-functions
ifdown-bnep ifdown-TeamPort ifup-plusb network-functions-ipv6
ifdown-eth ifdown-tunnel ifup-post
[root@lnltedmr3 network-scripts]# vim ifcfg-eno1
[root@lnltedmr3 network-scripts]# cat ifcfg-eno1
BOOTPROTO="none"
NAME="eno1"
UUID="e874fd6b-bc2d-492a-bada-29c930274618"
DEVICE="eno1"
ONBOOT="yes"
MASTER=bond0
SLAVE=yes
[root@lnltedmr3 network-scripts]# vim ifcfg-eno2
[已修改但尚未保存]
/bin/bash: q: 未找到命令
Shell 已返回127
请按 ENTER 或其它命令继续
[root@lnltedmr3 network-scripts]#
[root@lnltedmr3 network-scripts]# vim ifcfg-eno2
[已修改但尚未保存]
/bin/bash: q: 未找到命令
Shell 已返回127
请按 ENTER 或其它命令继续
[root@lnltedmr3 network-scripts]# vim ifcfg-eno2
[root@lnltedmr3 network-scripts]# cat ifcfg-eno2
BOOTPROTO=none
NAME=eno2
UUID=c1dcedee-720b-4434-bc06-26049ee823e4
DEVICE=eno2
ONBOOT=no
MASTER=bond0
SLAVE=yes
[root@lnltedmr3 network-scripts]# systemctl restart network
[root@lnltedmr3 network-scripts]# cat /proc/net/boning/bond0
cat: /proc/net/boning/bond0: 没有那个文件或目录
[root@lnltedmr3 network-scripts]# cd /proc
[root@lnltedmr3 proc]# cd net/bonding/
[root@lnltedmr3 bonding]# ls
bond0
[root@lnltedmr3 bonding]# cat bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eno1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eno1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:e0:c7:63:46
Slave queue ID: 0
Slave Interface: eno2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:e0:c7:63:47
Slave queue ID: 0
[root@lnltedmr3 bonding]# ping 10.204.197.1
PING 10.204.197.1 (10.204.197.1) 56(84) bytes of data.
64 bytes from 10.204.197.1: icmp_seq=1 ttl=255 time=0.315 ms
64 bytes from 10.204.197.1: icmp_seq=2 ttl=255 time=0.316 ms
^C
--- 10.204.197.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.315/0.315/0.316/0.017 ms
[root@lnltedmr3 bonding]# ping 10.204.197.100
PING 10.204.197.100 (10.204.197.100) 56(84) bytes of data.
64 bytes from 10.204.197.100: icmp_seq=1 ttl=255 time=0.405 ms
64 bytes from 10.204.197.100: icmp_seq=2 ttl=255 time=0.284 ms
64 bytes from 10.204.197.100: icmp_seq=3 ttl=255 time=0.235 ms
64 bytes from 10.204.197.100: icmp_seq=4 ttl=255 time=0.226 ms
^C
--- 10.204.197.100 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.226/0.287/0.405/0.073 ms
[root@lnltedmr3 bonding]# ifconfig -a
bond0: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet 10.204.197.144 netmask 255.255.255.0 broadcast 10.204.197.255
inet6 fe80::210:e0ff:fec7:6346 prefixlen 64 scopeid 0x20<link>
ether 00:10:e0:c7:63:46 txqueuelen 1000 (Ethernet)
RX packets 12589 bytes 758396 (740.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 113 bytes 10785 (10.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno1: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:10:e0:c7:63:46 txqueuelen 1000 (Ethernet)
RX packets 10614473 bytes 637160478 (607.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5884 bytes 497029 (485.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno2: flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 00:10:e0:c7:63:46 txqueuelen 1000 (Ethernet)
RX packets 10608986 bytes 636745165 (607.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 144 bytes 11841 (11.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno3: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:10:e0:c7:63:48 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
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
eno4: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:10:e0:c7:63:49 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
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 1000 (Local Loopback)
RX packets 2941 bytes 232132 (226.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2941 bytes 232132 (226.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:6e:73:d5 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
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
virbr0-nic: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 52:54:00:6e:73:d5 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
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
[root@lnltedmr3 bonding]#
其他参考资料:
https://www.cnblogs.com/suzhigang/p/6140018.html
https://www.cnblogs.com/geaozhang/p/6763876.html
linux-rhel7配置网卡bond双网卡主备模式的更多相关文章
- centos7 搭建双网卡bond1(主备模式)实例
前景须知: 在redhat6 中网卡叫bond,在redhat7及centos7中改名team,此处只记录centos7中双网卡主备搭建过程. 应用情景:实现网络的高可用,防止一条网线或交换机故障影响 ...
- 【 Keepalived 】Nginx or Http 主-备模式
一.主-备模式: 操作系统:centos 6.4 x64 ka1: 192.168.2.10 ka2: 192.168.2.11 vip: 192.168.2.200 ka1-master服务器配置 ...
- Nginx+keepalived(高可用主备模式)
Nginx+keepalived(高可用主备模式) 环境:centos6.7 准备:两台服务器(虚拟机).两台应用(Tomcat).Nginx.keepalived server1:192.168.2 ...
- Centos7.6部署k8s v1.16.4高可用集群(主备模式)
一.部署环境 主机列表: 主机名 Centos版本 ip docker version flannel version Keepalived version 主机配置 备注 master01 7.6. ...
- springboot整合ActiveMQ 2(主备模式,负载均衡)
基本使用,https://www.tapme.top/blog/detail/2018-09-05-10-38 主备模式,https://www.tapme.top/blog/detail/2018- ...
- 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 ...
- proxmox ve系统绑定上联外网出口bond双网卡
背景描述:一个客户搭建proxmox ve系统,要求上联出口双网卡绑定bond, proxmox ve下载地址:超链接 记录日期:2020/5/9 前期准备:服务器接好2个网卡 交换机:H3C 1.p ...
- Oracle 11gR2 RAC 单网卡 转 双网卡绑定 配置步骤
之前写过一篇双网卡绑定的文章,如下: Oracle RAC 与 网卡绑定 http://blog.csdn.net/tianlesoftware/article/details/6189639 Ora ...
- MySQL主备模式的数据一致性解决方案
根据阿里交易型业务的特点,以及在双十一这样业内罕有的需求推动下,我们在官方的MySQL基础上增加了非常多实用的功能.性能补丁.而在使用MySQL的过程中,数据一致性是绕不开的话题之一.本文主要从阿里 ...
随机推荐
- Python3.6及以上pip安装pymssql错误的解决办法[Windows&Linux freetds安装]
只有由于Python3.6装不上 pymssql,所以一直用Python3.5的版本. 报错界面 现在有了新的解决方法: 原帖如下: https://docs.microsoft.com/en-us/ ...
- 小程序引入百度api天气预报
先看下最终的效果(默认可以获得未来三天数据): 第一:首先准备条件(必须): 1.小程序已认证,有appID 2.必须把https://api.map.baidu.com 添加到小程序的合法域名列表中 ...
- JavaScript入门学习笔记(表单验证)
表单验证: 在数据被送到服务器之前对HTML表单中的输入数据进行验证,避免服务器频繁验证信息造成用户体验差. (1)表单数据是否为空 (2)输入的信息格式是否正确 (3)输入数据的类型是否正确 必填( ...
- windows下的node环境搭建
node环境的搭建过程: 1.首先在nodejs.org官网上下载一个msi安装文件,安装(过程很简单,基本上是一路next) 2.安装完成后,简单测试下是否安装成功,在cmd下输入两个命令: nod ...
- SpringBoot 自定义监听器(Listener)
1. 使用场景:在一些业务场景中,当容器初始化完成之后,需要处理一些操作,比如一些数据的加载.初始化缓存.特定任务的注册.开启线程或程序来干某些事情等等. 2. 使用步骤: A. 监听类实现Appli ...
- python小猪蹄儿
夜的第七章,打字机继续向前推向,微亮! 请写一个栈 class Stack: #初始化栈(列表) def __init__(self): self.items=[] #栈的大小 def size(se ...
- 关闭 Window 之后,无法设置 Visibility,也无法调用 Show、ShowDialogor 或 WindowInteropHelper.EnsureHandle。
参考网址: 1.WPF Tips: Window.ShowDialog()方法:Cannot set Visibility or call Show, ShowDialog, or WindowInt ...
- day17.初识递归函数
在一个函数调用这个函数本身就是递归函数 递归函数默认深度最大997 n = 0 def func(): global n n += 1 print('hello,world') print(n) fu ...
- Python学习(四十)—— Djago之认证系统
一.COOKIE 与 SESSION 概念 cookie不属于http协议范围,由于http协议无法保持状态,但实际情况,我们却又需要“保持状态”,因此cookie就是在这样一个场景下诞生. cook ...
- JavaScript中var、let和const的区别(转载)
一.前言 在ES6(ES2015)出现之前,JavaScript中声明变量就只有通过 var 关键字,函数声明是通过 function 关键字,而在ES6之后,声明的方式有 var . let . c ...