Ubuntu 16.04 amd64 bond mode6 配置

1、简介

????本文 旨在 介绍 在 Ubuntu 16.04 环境下 配置 bond mode6
????

1.1 操作 系统

## 本文 测试 使用的是 Ubuntu 16.04 的操作系统
# lsb_release -a

????

1.2 bond

1.2.1 为什么 使用 bond

????随着 网络 信息 时代的发展,很多 时候 单个 网卡 不能 满足 我们 的日常需求,单个 的 千兆(哪怕是 万兆)如今 都已经 出现 了瓶颈;Linux bonding 驱动提供了一种 将多个物理网络端口捆绑为单个逻辑网络端口的方法,用于网络负载均衡、冗余 来 提升网络的性能,解决 单个 网卡 带来的 瓶颈 问题
????

1.2.2 bond 驱动

????Linux的多网卡绑定功能使用的是内核中的"bonding"模块(关于此模块可以参考Linux Ethernet Bonding Driver文档,幸运的 是 目前发布各个Linux版本内核均已包含了此模块,大多数情况下不需要重新编译内核);Linux 的 bonding 驱动提供了绑定/集成(bond)多个网卡为一个虚拟逻辑网口的功能;
????

1.2.3 bond 模式

????网口绑定 (bonded)有多种工作模式: 目前网卡绑定mode共有七种(0~6)bond0、bond1、bond2、bond3、bond4、bond5、bond6(bond6 只是 个名称,bond 配置的 mode6 模式;所以 为了 方便 直观了解,就 已经 成为了 一种 约定俗成 的规范);一般来说,分为 热后备(hot standby) 和 负载均衡(load balancing);本文 只介绍 bond6 (其余 模式 暂不介绍)
????

1.3 bond6

????属于 负载 均衡(发送、接收 都会进行 负载),配置 bond6 不需要对 交换机(switch) 进行相关配置,因此 比较 简单操作(哈哈哈,不需要 配置 交换机哦,我貌似 也不会配交换机)
????

2.1 bond 模块 查看

## 内核模块操作相关的命令:lsmod、modinfo、depmod、rmmod、inmod、modprobe
## lsmod 结果
##     第一列 :表示 模块的名称
##     第二列 :表示 模块的大小
##     第三列 :表示 依赖该模块的个数
##     第四列 :表示 依赖 该模块 的内容(如果 依赖 个数 为0,则第四列为空)
# lsmod | grep "bond*"
bonding  147456  0

????

2.2 bond 模块加载

## 如果 bond 模块 没有加载,我们需要 手动 加载 该模块
# modprobe bonding

????

2.3 bond 模块信息

## 可以 通过 modinfo 命令 查看 某一模块的具体 信息
## 不想 详细 解释了:filename、author、license、depends...
# modinfo bonding

????

3、网卡 查看

# ifconfig -a

????

4、bond 配置/检测

????不同 操作 系统 对于 bond 配置 方式 不一样,所以 在此处 在此 提示 一下,本文 针对 Ubuntu 16.04 操作 系统 配置 bond的 说明
????

4.1 安装 ifenslave

## 在线安装
# apt-get install ifenslave

????

4.2 bond 模块 开机 自启

## 系统 开启 如果 不自动 加载 bond 驱动,可以 手动添加
# cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

## bond 模块 开机自启
sudo modprobe bonding

exit 0

????

4.3 bond 配置

# cat /etc/network/interface
# cat /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo
inet loopback

# The primary network interface
auto bond0
iface bond0 inet static
address XXX.XXX.XXX.XXX
netmask XXX.XXX.XXX.XXX
gateway XXX.XXX.XXX.XXX

bond-slaves ens1f0 ens1f1
bond-lacp-rate 1
bond-mode 6
bond-miimon 100

auto ens1f0
iface ens1f0 inet manual
bond-master bond0

auto ens1f1
iface ens1f1 inet manual
bond-master bond0

????

4.4 bond 检测

# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: adaptive load balancing
Primary Slave: None
Currently Active Slave: ens1f0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: ens1f0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: f8:f2:1e:39:93:60
Slave queue ID: 0

Slave Interface: ens1f1
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: f8:f2:1e:39:93:61
Slave queue ID: 0

????

5、网络/带宽 测试(简单介绍)

5.1 iperf 服务器端

本文测试的是 TCP 方式下的 网络带宽测试(根据自己需求,也可测试 UTP方式)
# iperf -s

????

5.2 iperf 客户端

## iperf_server_ip iperf 服务端 IP地址
## thread_num 多进程,进程 数量
## time 测试时长(s)
## num 客户端 每次打印信息间隔(s)
# iperf -c {iperf_server_ip}? -P {thread_num} -t {time} -i {num}

????

6、网口流量监测(简单介绍)

????监测 网口 流量 命令 很多,再次 不过多 介绍,一笔带过,后期 编写 文章 详细 描述

## 执行 nmon 命令,再按键 "N"
# nmon

原文地址:http://blog.51cto.com/11495268/2345761

时间: 2024-08-28 08:37:52

Ubuntu 16.04 amd64 bond mode6 配置的相关文章

Ubuntu 16.04 LAMP server 指南 - 配置 Apache2.4,PHP7,和MariaDB(而不是MySQL)

翻译自:https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/ 昨天在虚拟机里面安装ubuntu server ,然后配置php开发环境,参考了这篇文章,一次性把所有的东西都安装配置好了,所以想把这篇文章记录下来.希望能够帮助到初学者一次性搞定这些配置(避免纠结),然后就可以愉快地编程了,嘿嘿. 以下是我翻译的内容,完全对照原文,没有自己改动的部分(因为原文已经很完美了

Ubuntu 16.04下Samba相关配置

[转]:http://www.linuxidc.com/Linux/2016-12/138498.htm samba是 SMB/CIFS网络协议的重新实现,它作为NFS的补充使得在Linux和Windows系统之间进行文件共享.打印更容易实现. 相关介绍: SAMBA套件: (1)samba:这个套件主要包含了SAMBA的主要daemon档案(smbd及nmbd),SAMBA的文档(document),以及其它与SAMBA相关的logrotate设定文件及开机预设选项档案等. (2)samba-

ORB SLAM2在Ubuntu 16.04上的运行配置

安装依赖 安装OpenGL 1. 安装opengl Library$sudo apt-get install libgl1-mesa-dev2. 安装opengl utility$sudo apt-get install libglu1-mesa-dev3. 安装opengl utility toolkit$sudo apt-get install freeglut3-dev 安装GLEW $sudo apt-get install libglew-dev 安装boost $sudo apt-g

7.Ubuntu 16.04下的美化配置过程

原文链接:http://blog.csdn.net/wangweiqiang1325/article/details/53447123 先看一下最后的效果: 一:优化 1.切换软件源 默认中国服务器,我们把它切换成aliyun的. 在设置--软件和更新里--下载自--其他站点--中国--http://mirrors.aliyun.com/ubuntu 2.先把所有软件源和软件更新到最新 [plain] view plain copy sudo apt-get update sudo apt-ge

Ubuntu 16.04.4的网络配置

1.查看网卡状态 [email protected]:~# ifconfig -a [email protected]:~# ip addr [email protected]:~# ip route show 2.设置静态IP [email protected]:~# vim /etc/network/interfaces 加入如下内容: auto eth0 iface eth0 inet static address 192.168.1.5 gateway 192.168.1.1 netma

git win10和ubuntu 16.04的安装和配置连接gitee

1 创建gitee仓库 1.1 登录gitee,进入之后点击"我的码云"->"仓库"->"立即创建" 1.2 设置仓库信息,点击创建 2 win10安装和配置 2.1 下载win10git客户端,链接为:https://gitforwindows.org/,下载完成后一路"next" 2.2 鼠标右击选择"Git Bash ",打开终端窗口 2.3 配置本地库用户信息 格式: $ git con

Ubuntu 16.04 Django安装和配置

之前有安装和配置过,换了台电脑,再安装和配置,忽然发现差不多都忘记了,这里记录下已备之后查阅. sudo apt-get install python-pip sudo apt-get install python-virtualenv #安装本地虚拟环境管理工具 mkdir ~/django # 创建目录 cd ~/django virtualenv venv #在~/django目录下,创建一个venv的虚拟环境 source venv/bin/activate #开启虚拟环境 pip in

Ubuntu 16.04 163网易源设置(自动化配置脚本)

1.简介 1.1 介绍 ????很多时候,为了方便 操作,条件允许的情况下,直接 联网 进行安装,但是 系统 所配置的 apt源 配置的 url 地址 并非 国内的,获取资源很慢,所以 需要 配置成 国内的 源,本人 喜欢 163网易源,根据个人喜好 自行选择???? 1.2 操作系统 ## 本文操作系统 Ubuntu 16.04 amd64 ## 发行版本号 xenial # lsb_release -a ???? 2.apt 源 2.1 源备份 ## 备份原有的源配置文件 # cd /etc

Ubuntu 16.04 安装 python3.8

Ubuntu 16.04  amd64 (64bit)(纯净版) 自带python2.7和python3.5 执行"whereis python"查看当前安装的python [[email protected] ~]# whereis python python: /usr/bin/python2.7 /usr/bin/python /usr/lib/python2.7 /usr/lib64/python2.7 /etc/python /usr/include/python2.7 /u