Debian 9.4 多网卡链路聚合bond配置

安装ifenslave

  1. ifenslave 的作用是网卡的负载均衡
root@debian:~# apt-get install ifenslave
root@debian:~# dpkg -l | grep ifenslave
ii ifenslave 2.9 all configure network interfaces for parallel routing (bonding)

编辑 /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 auto eth0 #eth0作为远程使用的IP地址
iface eth0 inet static
address 192.168.121.94
netmask 255.255.255.0
gateway 192.168.121.2 auto bond0
iface bond0 inet static
address 192.168.121.100
netmask 255.255.255.0
gateway 192.168.121.2
bond-mode 0
bond-slaves eth1 eth2
bond-miimon 100
bond-downdelay 200
bond-updelay 200 auto eth1 #eth1和eth2作为需要绑定的网卡,不需要给定IP地址
iface eth1 inet static auto eth2
iface eth2 inet static
  • 注释
auto bond0
iface bond0 inet static
address 192.168.121.100
netmask 255.255.255.0
gateway 192.168.121.2
bond-mode 0 #网卡模式(0代表负载均衡模式;1代表主备模式)
bond-slaves eth1 eth2 #所绑定的网卡
bond-primary eth1 #设置绑定的主网卡,有流量优先走eth1(当模式为1)
bond-miimon 100 #网卡状态监测周期100ms
bond-downdelay 200 #网卡down时间
bond-updelay 200 #网卡up时间
  • bond-mode 模式列表
0:      balance-rr       负载均衡模式
1: active-backup 主备模式
2: balance-xor 异或策略
3: broadcast 广播策略
4: 802.3ad 动态链接聚合
5: balance-tlb 适配器传输负载均衡
6: balance-alb 适配器负载均衡

开机自动加载bonding模块

  1. 编辑 /etc/modules 文件
root@debian:~# vim /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
bonding #添加这行

重启服务器

root@debian:~# reboot
  • 使用 systemctl restart networking.service 这个命令重启网络服务会一直报错,不知道为啥,重启就好了

查看

root@debian:~# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:38:1f:4c brd ff:ff:ff:ff:ff:ff
inet 192.168.121.94/24 brd 192.168.121.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe38:1f4c/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 00:0c:29:38:1f:56 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP group default qlen 1000
link/ether 00:0c:29:38:1f:56 brd ff:ff:ff:ff:ff:ff
5: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:38:1f:56 brd ff:ff:ff:ff:ff:ff
inet 192.168.121.100/24 brd 192.168.121.255 scope global bond0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe38:1f56/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever

Debian 9.4 多网卡链路聚合bond配置的更多相关文章

  1. Ubuntu 20.04 配置多网卡链路聚合

    Ubuntu 20.04 配置多网卡链路聚合 多网卡IP配置 首先查看网卡信息 root@it:~# ip add 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65 ...

  2. ENSP静态链路聚合实验配置要点及实例

    链路聚合分为:静态链路聚合.动态链路聚合链路聚合的负载分担模式:对于二层数据流,系统会根据MAC地址(源mac地址和目的mac地址来计算),而对于三层数据流则会根据ip地址来进行负载分担计算. 静态链 ...

  3. 群晖系统设置链路聚合并配置静态IP的教程【江东网 JDX86.COM】

    1.进入控制面板 > 网络 > 网络接口.请单击创建 > 创建 Bond 2.进入聚合配置向导,选择你想要的模式,这里有几种模式意思分别为: 自适应负载平衡: 此模式优化了 Syno ...

  4. linux初学者-网卡的链路聚合篇

    linux初学者-网卡的链路聚合篇 网卡的链路聚合就是将多块网卡连接起来,当一块网卡损坏,网络依旧可以正常运行,可以有效的防止因为网卡损坏带来的损失,同时也可以提高网络访问速度. 网卡的链路聚合一般常 ...

  5. ESXi与物理交换机静态链路聚合配置过程中的小陷阱

    作者:陆斌文章来自微信公众号:平台人生 内容简介:ESXi与物理交换机之间配置静态链路聚合时,因为静态链路聚合的特点,在进行down网卡和从虚拟交换机移除网卡的操作时,可能会无法完成故障流量切换,影响 ...

  6. Eth-Trunk链路聚合配置

    Eth-Trunk概述 Eth-Trunk接口能够实现负载分担.增加带宽和提高可靠性 Eth-Trunk接口把多个物理接口捆绑成一个逻辑接口 Eth-Trunk接口的链路聚合模式 链路聚合模式 应用场 ...

  7. H3C 交换机基本设置(telnet、SSH、链路聚合)

    http://www.h3c.com/cn/d_201710/1038172_30005_0.htm#_Toc493869056 H3C S5560S-SI&S5130S-SI[LI]& ...

  8. H3C交换机端口链路聚合

    H3C交换机端口链路聚合 以太网链路聚合 -- 以太网链路聚合配置命令 -- lacp system-prioritylacp system-priority命令用来配置系统的LACP优先级.undo ...

  9. HCIA-Datacom 3.3 实验三:以太网链路聚合实验

    实验介绍 随着网络规模不断扩大,用户对骨干链路的带宽和可靠性提出越来越高的要求.在传统技术中,常用更换高速率的接口板或更换支持高速率接口板的设备的方式来增加带宽,但这种方案需要付出高额的费用,而且不够 ...

随机推荐

  1. 看过这篇剖析,你还不懂 Go sync.Map 吗?

    hi, 大家好,我是 haohongfan. 本篇文章会从使用方式和原码角度剖析 sync.Map.不过不管是日常开发还是开源项目中,好像 sync.Map 并没有得到很好的利用,大家还是习惯使用 M ...

  2. JVM(三)类加载与字节码技术

    1.类文件结构 首先获得.class字节码文件 方法: 在文本文档里写入java代码(文件名与类名一致),将文件类型改为.java 在文件对应目录下运行cmd,执行javac XXX.java 以下是 ...

  3. JVM学习笔记(三):JVM基本参数

    1 来源 来源:<Java虚拟机 JVM故障诊断与性能优化>--葛一鸣 章节:第三章 本文是第三章的一些笔记整理. 2 GC日志:-Xlog:gc 要打印GC日志的话,可以加上-Xlog: ...

  4. SpringBoot-如何设计优秀的后端接口?

    1 概述 本篇文章以Spring Boot为基础,从以下三个方向讲述了如何设计一个优秀的后端接口体系: 参数校验:涉及Hibernate Validator的各种注解,快速失败模式,分组,组序列以及自 ...

  5. linux下更新gcc

    1 下载源码 链接 目前最新为9.2版本. 2 解压 tar -zxvf gcc-9.2.0.tar.gz cd gcc-9.2.0 3 download_prerequisites脚本 运行这个脚本 ...

  6. C语言-内存函数的实现(一)之memcpy

    C语言中的内存函数有如下这些 memcpy memmove memcmp memset 下面看看memcpy函数 memcpy 我们想想,之前有那个字符串拷贝的函数,即strcpy函数.都有拷贝的函数 ...

  7. 小程序使用 Promise.all 完成文件异步上传

    小程序使用 Promise.all 完成文件异步上传 extends [微信小程序开发技巧总结(二) -- 文件的选取.移动.上传和下载 - Kindear - 博客园 (cnblogs.com)] ...

  8. S-Trees UVA - 712

      A Strange Tree (S-tree) over the variable set Xn = {x1,x2,...,xn} is a binary tree representing a ...

  9. volatile修饰全局变量,可以保证并发安全吗?

    今天被人问到volatile能不能保证并发安全? 呵,这能难倒我? 上代码: //电脑太好,100线程起步~public class ThreadTest { private static volat ...

  10. nginx下强制跳转到www域名

    跳转www #先监听 exp.com域名,然后转发到www下面 server { listen 80; server_name exp.com; rewrite ^(.*) $scheme://www ...