NIC Bonding on CentOS 7 with nmtui

NIC Bonding on CentOS 7 withnmtui

当系统管理员希望增加可用带宽,并提供冗余和负载平衡的数据传输,内核支持bonding允许以聚合的方式实现。简单地说,绑定意味着将两个或多个物理网络接口(称为奴隶)聚合成一个单独的逻辑节点(称为主网络)。如果一个特定的NIC(网络接口卡)的经验问题,通信不受影响只要其他保持活跃。

1.先决条件

默认情况下,bonding内核模块没有启用。因此,我们将需要加载它并确保它持久。使用modprobe--first-time加载bonding模块,如果加载模块失败,会发出警告。

# modprobe --first-time bonding

以上的命令仅加载bondiing模块为当前会话,服务器重启后模块不会自动加载。为了确保持续加载,创建/etc/modules-load.d/bonding.conf文件放置于文件夹/etc/modules-load.d目录中,确保每次服务器重启时加载bonding模块。

# echo "# Load thebonding kernel module at boot" > /etc/modules-load.d/bonding.conf

# echo "bonding">> /etc/modules-load.d/bonding.conf

服务器重启之后确保bonding模块自动加载

[root@MiWiFi-R3-srvDesktop]# lsmod|grep bonding

bonding136705 0

[root@MiWiFi-R3-srvDesktop]#

2.配置bonding

查看系统当前可用网卡,当前两块网卡上均无可用连接。

[root@MiWiFi-R3-srv ~]# nmcli device status

DEVICE TYPE STATE CONNECTION

bond0 bond disconnected --

eno16777736 ethernet disconnected --

eno33554992 ethernet disconnected --

lo loopback unmanaged --

[root@MiWiFi-R3-srv ~]#nmcli connection show

NAME UUIDTYPE DEVICE

当前服务器网卡信息如下

[root@MiWiFi-R3-srvDesktop]# ifconfig

eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

ether 00:0c:29:51:e8:75 txqueuelen 1000 (Ethernet)

RX packets 2227 bytes 216343 (211.2 KiB)

RX errors 0 dropped 0overruns 0 frame 0

TX packets 109 bytes 10643 (10.3 KiB)

TX errors 0dropped 0 overruns 0 carrier0 collisions 0

eno33554992:flags=4163<UP,SimSun;font-size:18px;"> ether 00:0c:29:51:e8:7f txqueuelen 1000 (Ethernet)

RX packets 2633 bytes 300745 (293.6 KiB)

TX packets 138 bytes 11748 (11.4 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0collisions 0

lo:flags=73<UP,LOOPBACK,RUNNING> mtu65536

inet 127.0.0.1 netmask 255.0.0.0

inet6 ::1 prefixlen 128scopeid 0x10<host>

looptxqueuelen 0 (Local Loopback)

RX packets 2 bytes 196 (196.0 B)

TX packets 2 bytes 196 (196.0 B)

登陆图形界面,nmtui打开配置界面如下

[root@MiWiFi-R3-srvDesktop]#nmtui

wKiom1hchOTSBTXUAAAlu8S_fm4018.jpg-wh_50

选中edit a connection确定

wKiom1hchTuhRCaFAAAT1Ke5Z28695.jpg-wh_50

点击add

wKiom1hchQbDFgtmAAAyJnA08iY529.jpg-wh_50

bondàcreate进去bond配置界面

wKiom1hcha7jB50XAABx6sRL-7I843.jpg-wh_50

设置profile name及device名,选择add添加网卡,如下

wKioL1hchdbijm_DAABMJ9WFKKw779.jpg-wh_50

设置profile name 为eth0,device设置为网卡eno16777736,点击ok。相同方法配置eth1,device设置为eno33554992。

wKioL1hche3jbWirAAA_zt5HHm4954.jpg-wh_50

配置完成后,返回主界面,设置mode为active-backup,设置primary设备为eno16777736。点击ok退出。

wKiom1hchf_x4uBSAACgLPXmDro215.jpg-wh_50

wKiom1hchjSCJD52AAAdT_uGBMU926.jpg-wh_50

查看服务器当前配置

[root@MiWiFi-R3-srvDesktop]# cat /proc/net/bonding/mybond

Ethernet Channel BondingDriver: v3.7.1 (April 27,2011)

Bonding Mode: fault-tolerance(active-backup)

Primary Slave: eno16777736(primary_reselect always)

Currently Active Slave:eno16777736

MII Status: up

MII Polling Interval (ms):100

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eno33554992

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 0

Permanent HW addr:00:0c:29:51:e8:7f

Slave queue ID: 0

Slave Interface: eno16777736

Speed: 1000 Mbps

Permanent HW addr:00:0c:29:51:e8:75

[root@MiWiFi-R3-srvDesktop]#

查看网卡信息,eno16777736与eno33554992网卡mac地址相同

eno16777736:flags=6211<UP,SLAVE,MULTICAST> mtu 1500

ether 00:0c:29:51:e8:7f txqueuelen 1000 (Ethernet)

RX packets 3626 bytes 343058 (335.0 KiB)

TX packets 138 bytes 15571 (15.2 KiB)

eno33554992:flags=6211<UP,0);">00:0c:29:51:e8:7f txqueuelen 1000 (Ethernet)

RX packets 4034 bytes 428144 (418.1 KiB)

RX errors 0 dropped 34overruns 0 frame 0

TX packets 139 bytes 11838 (11.5 KiB)

mybond:flags=5187<UP,MASTER,SimSun;font-size:18px;"> inet 192.168.31.119 netmask 255.255.255.0 broadcast 192.168.31.255

inet6 fe80::20c:29ff:fe51:e87f prefixlen 64scopeid 0x20<link>

ether 00:0c:29:51:e8:7f txqueuelen 0(Ethernet)

RX packets 66 bytes 8172 (7.9 KiB)

RX errors 0dropped 34 overruns 0 frame 0

TX packets 30 bytes 5018 (4.9 KiB)

再次查看当前设置状态

[root@MiWiFi-R3-srvDesktop]# nmcli device status

DEVICE TYPE STATE CONNECTION

mybond bond connected mybond

eno16777736 ethernet connected eth0

eno33554992 ethernet connected eth1

bond0 bond disconnected --

lo loopback unmanaged --

[root@MiWiFi-R3-srv ~]#

当前设备的链接信息

[root@MiWiFi-R3-srvDesktop]# nmcli connection show

NAME UUID TYPE DEVICE

eth0 4435f07a-4585-452e-85a5-c9a968d48bab 802-3-ethernet eno16777736

eth1 48142a3f-a088-4e27-9d96-ccc586792980 802-3-ethernet eno33554992

mybond fcc6f5d4-5da6-499d-97e5-e7b5ba1cd2a0 bond mybond

3.bonding模式

mode= value

balance-rr or 0

Sets a round-robin policy for faulttolerance and load balancing.Transmissions are received and sent outsequentially on each bonded slave interface beginning with the first oneavailable.

active-backup or 1

Sets an active-backup policyfor fault tolerance.Transmissions arereceived and sent out via the first available bonded slave interface. Anotherbonded slave interface is only used if the active bonded slave interface fails.

balance-xo ror 2

Transmissions are based on the selected hashpolicy. The

default is to derive a hash by XOR ofthe source and destination MAC addresses multipliedby the modulo of the number of slave interfaces. In this mode traffic destined for specific peers will always be sent over thesame interface. As the destination is determinedby the MAC addresses this method works best for traffic to peers on the same linkor local network. If traffic has to pass through a single router then this modeof traffic balancing will be suboptimal.

broadcast or 3

Sets a broadcast policy for fault tolerance.All transmissions are sent on all slave interfaces.

80 2.3ad or 4

Sets an IEEE 802.3ad dynamiclink aggregation policy. Creates aggregation groups that share the same speedand duplex settings. Transmits and receives on all slaves in the activeaggregator. Requires a switch that is 802.3ad compliant.

balance-tlb or5

Sets a Transmit Load Balancing (TLB) policyfor fault tolerance and load balancing. The outgoing traffic is distributed accordingto the current load on each slave interface. Incoming traffic is received bythe current slave. If the receiving slave fails,another slave takes over theMAC address of the failed slave. This mode is only suitable for local addressesknown to the kernel bonding module and therefore cannot be used behind a bridgewith virtual machines.

balance-alb or6

Sets an Adaptive Load Balancing (ALB) policyfor fault tolerance and load balancing. Includes transmit and receive loadbalancing for IP v4 traffic.Receive load balancing is achieved through AR Pnegotiation. This mode is only suitable for local addresses known to the kernelbonding module and therefore cannot be used behind a bridge with virtualmachines.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


#使用军哥的lnmp配置虚拟主机,需要注意的是要配置hosts文件(这一点官方没有讲到)具体方法:1、修改hosts文件sudo vim /etc/hosts2、在hosts文件中新增一行(这里类似于windows上配置hosts文件)127.0.0.1 www.baidu.com3、保存并重启网络
一、配置编译环境 yum update &amp;&amp; yum upgrade yum groupinstall &quot;Development Tools&quot; yum install gcc gcc-c++ pcre* openssl* gd-devel* zlib-devel
一、下载repo文件 二、备份并替换系统的repo文件 三、执行yum源更新操作
LAMP -- Linux Apache MySQL PHP 在CentOS安装的顺序,我一般是Apache&#160;-&gt;&#160;MySQL&#160;-&gt;&#160;PHP 第一步、安装并配置Apache 1、使用yum安装 [plain]&#160;view plaincopy
一、下载nginx安装包,官网下载中心http://nginx.org/download [root@localhost software]# wget http://nginx.org/download/nginx-1.10.1.tar.gz 二、解压nginx安装包 [root@localhos
1.下载composer curl -sS https://getcomposer.org/installer | php ps:如果出现php无法运行的情况,请先把PHP加入环境变量,具体操作参考《centOS安装PHP》 2.移动或复制composer到环境下可执行 cp composer.ph
一、卸载旧版本的vim 二、安装终端字符处理库ncurses 三、下载Vim8 四、编译安装 五、添加到系统环境变量 六、安装成功
引言 我们在日常的开发过程中,很多时候需要连接服务器查看日志或者在服务器上调试代码。但是,使用 ssh 命令登录服务器每次都需要输出密码,就比较繁琐。因此我们可以使用 sshpass 通过参数指定密码进行登录。解决了这个问题之后,我发现登录服务器之后,还需要手动 cd 切换到项目目录或者日志目录。为
iptables basics Introduction iptables 是一个配置 Linux 防火墙的工具,是 netfilter 项目的一部分。 在 Linux Kernel 3.13 及以上版本中, nftables 将作为后继者取代 iptables 以成为更强大易用的防火墙工具 Bas
一、下载tengine 二、安装tenginx(nginx)的模块依赖库 三、解压并指定安装路径 四、编译安装 五、启动(tengine)nginx 六、访问(tengine)nginx
这篇文章介绍了如何快速部署一套Kubernetes集群,下面就快速开始吧! 准备工作 机器部署规划 主机 | IP | 部署组件 | | master主节点 | 192.168.199.206 | etcd、kube apiserver、kube controller manager、kube sc
一、pip下载 二、解压安装 三、安装完成
1、WebBench安装: yum install ctags(先安装依赖库) mkdir /usr/local/man (创建一个目录不然会报错) wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz tar zxv
1:查看环境: [root@10-4-14-168 html]# cat /etc/redhat-release CentOS release 6.5 (Final) 2:关掉防火墙 [root@10-4-14-168 html]# chkconfig iptables off 3:配置CentOS
安装 1.检查当前是否有安装php rpm&#160;-qa|grep&#160;php 如果有安装PHP,那么请先删除这些安装包: yum&#160;remove&#160;php* 2.安装php源 Centos 5 安装php源: rpm&#160;-ivh&#160;http://mirro
一、安装 二、配置 三、修改配置文件 四、program 配置 五、启动
Sed 日常使用介绍 简介 是 环境下常用的流处理工具, 可以处理字符流, 文件或者二进制文件流。 各个 发行版都会配备 及其衍生的命令工具, 因此, 掌握该工具的基本用法, 足以满足我们日常的许多文本处理的任务。 以下采用示例的方式对 进行基本用法介绍. 如果有兴趣了解更高级的使用技巧, 本文采用
linux下开机自启: 在/etc/init.d目录下新建文件elasticsearch 并敲入shell脚本: 注意, 前两行必须填写,且要注释掉。 第一行为shell前行代码,目的告诉系统使用shell。 第二行分别代表运行级别、启动优先权、关闭优先权,且后面添加开机服务会用到。 shell脚本
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以需要赋予其可执行权 chmod +x /etc/rc.d/rc.local 2、赋予脚本可执行权限假设/usr/local/script/autostart.sh是你的脚本路径,给予执行权限 chmod +x /usr
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用ls -ll,会显示成字节大小,而ls- lh会以KB、MB等为单位进行显示,这样比较直观一些。 通过命令du -h –max-depth=1 *,可以查看当前目录下各文件、文件夹的大小,这个比较实用。 查询当前目录总大小可以使用d