bond的主备模式_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 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
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 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 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 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 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 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
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 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 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
bond的主备模式_linux-rhel7配置网卡bond双网卡主备模式相关推荐
- linux双网卡配置bond4,centos7双网卡绑定bond0
Centos7双网卡主备模式配置(bond0) 通过双网卡设置主备模式,实现当一块网卡宕掉时,另外一块网卡可以自动顶替宕掉的网卡工作,保障网络正常访问. 1.修改网卡配置文件 切换工作目录 cd /e ...
- linux双网卡配置默认,linux双网卡配置
环境:CentOS5.3 Linux version 2.6.18-128.el5,双网卡 配置: 1.编辑/etc/modprobe.conf 文件 #vi /etc/modprobe.conf加入 ...
- Oracle 11gR2 RAC 单网卡 转 双网卡绑定 配置步骤
之前写过一篇双网卡绑定的文章,如下: Oracle RAC 与 网卡绑定 http://blog.csdn.net/tianlesoftware/article/details/6189639 Ora ...
- CentOS配置双网卡以及双网卡报错处理
设置两个网卡,先在外面添加网卡 添加完成网卡,使用ifconfig去查看配置,可以看出来ens33为网卡一,而ens37为网卡二,网卡二的IP没有. 使用cd /etc/sysconfig/netwo ...
- linux通过interfaces配置DHCP和静态IP,配置ubuntu的双网卡
前言 为什么不使用GUI界面配置呢?因为我的系统设置窗口又双叒叕被我玩没了.这次不想把它找回来了. 一 安装工具包 好在我的虚拟机默认就是配置dhcp的,要不然就得下载源码包了. sudo apt i ...
- oracle em 双网卡,VirtualBox 双网卡配置
1. 给虚拟机分别添加"host-only"网卡和"网络地址转换(NAT)"网卡 2. /etc/udev/rules.d/70-persistent-ipoi ...
- centos7 修改为任意网卡名_VirtualBox虚拟机双网卡配置实现与本机互通并上网
VirtualBox的网卡连接方式区别 1.桥接网卡 此方式可以实现虚拟机与宿主机互通,并且上网.(寻常局域网环境这个连接方式就可以解决本次问题,但因为在认证网的环境中,这个方式并没有解决) 默认网段 ...
- ip冲突和双网卡模式
1.解决服务器ip地址冲突导致的 svn不能更新问题 netsh interface ipv4 show neighbors netsh interface ipv4 set neighbors 8 ...
- bond的主备模式_centos 7.0双网卡主备和负载均衡模式配置(bond0)
网卡bond是通过把多张网卡绑定为一个逻辑网卡,实现本地网卡的冗余,带宽扩容和负载均衡.在应用部署中是一种常用的技术,bond共有7中模式,mode 0-6,但是常用的模式有三种: mode=0:平衡 ...
- bond的主备模式_号外号外:Redhat7通过bond技术实现双网卡绑定
说明:redhat 7虽然新增了teaming技术支持双网卡绑定,但bonding技术依然可以沿用,本文测试的是bond的绑定方式.为了避免冲突,建议关闭NetworkManager:systemct ...
最新文章
- Android6.0到底有什么不一样
- 反沙箱——SetErrorMode
- ajax中async_小猿圈web前端之ajax的同步和异步有怎样的区别?
- 《深入解析Windows操作系统》--第二章 系统结构
- eclipse4.2配置tomcat+jdk
- Oracle 临时表
- 使用网络登陆的id创建odbc后怎么链接_这是一篇关于苹果ID账号分享和规范使用教程。...
- 华为中兴FPGA面试题总结
- 【FICO】SAP中的银行
- c语言汉字属于什么类型_【C语言】必学知识点 - 基本数据类型!你学会了吗?...
- win10u盘一直正在计算机,Windows10未插入U盘却一直显示的解决方法
- android平台支付宝快捷支付
- SAP ScriptForms 教程系列一
- SublimeText 3.2.3207 汉化破解免安装版(3264位)
- Freemaker之代码生成
- Android 文件外/内部存储的获取各种存储目录路径
- SmallJava V2.0 产品说明书(20210405)
- 聊一聊 JavaScript 的一些奇葩知识
- 金融知识杂记(一) 市盈率 市销率 市净率 逆市操作tips(jhs 0414)
- excel使用:countif
热门文章
- tar 备份时如何保持权限
- 2.2.2 MySQL基本功能与参数文件管理
- k8s的网络优化(metallb)
- 华为HCIE实验考试真题,杭州考场上午TS下午LAB
- java调用net webservice_java调用.net的webservice
- mysql两条记录合成一条数据_踩坑记录之csv数据导入MySQL
- 钉钉宜搭3.0发布!易连接、酷数据、更安全
- 新零售行业搜索最佳实践
- 2020年8月编程语言排行榜新鲜出炉 - 编程语言世界的假期
- For the king:出色的冒险,失败的角色扮演