Debian 16.04 配置双网卡绑定bond

Debian 16.04 bonding多网卡配置

  1. 安装负载均衡软件 fenslave
root@ubuntu:~# apt-get install ifenslave
root@ubuntu:~# dpkg -l | grep ifenslave
ii ifenslave 2.7ubuntu1 all configure network interfaces for parallel routing (bonding)
  1. 添加 bonding 模块,使之可以开机自动加载该模块
root@ubuntu:~# echo "bonding" >> /etc/modules
root@ubuntu:~# cat /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@ubuntu:~# modprobe bonding
root@ubuntu:~# lsmod | grep bonding
bonding
  1. 编辑 /etc/network/interfaces 配置文件
  • 设置主备模式 (active-backup
root@ubuntu:~# vim /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 eth0 #该网卡使用来远程使用的
iface eth0 inet static
address 192.168.121.16
netmask 255.255.255.0
gateway 192.168.121.2 auto eth1 #绑定的网卡eth1
iface eth1 inet manual #最好设置为手动,设置为static可能会出问题
bond-master bond0 #绑定的接口
bond-primary eth1 #表示该网卡是主网卡,有流浪优先走该网卡 auto eth2 #绑定的网卡eth2
iface eth2 inet manual
bond-master bond0 #绑定的接口 auto bond0 #绑定网卡名
iface bond0 inet static
address 192.168.121.100
netmask 255.255.255.0
gateway 192.168.121.2
bond-slaves none #主备模式,没有从属网卡
bond-mode 1 #1代表主备模式active-backup
bond-miimon 200 #200毫秒监测一次网卡状态,如果有一条线路不通就切换另一条线路
  • 设置负载均衡模式 (balace-rr)
root@ubuntu:~# vim /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 eth0
iface eth0 inet static
address 192.168.121.16
netmask 255.255.255.0
gateway 192.168.121.2 auto eth1
iface eth1 inet manual
bond-master bond0 auto eth2
iface eth2 inet manual
bond-master bond0 auto bond0
iface bond0 inet static
address 192.168.121.100
netmask 255.255.255.0
gateway 192.168.121.2
bond-slaves eth1 eth2 #添加两个从属网卡
bond-mode 0 #0表示负载均衡模式
bond-miimon 200
  1. 重启网络服务
root@ubuntu:~# systemctl restart networking
  1. 查看bond
root@ubuntu:~# 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:57:67:25 brd ff:ff:ff:ff:ff:ff
inet 192.168.121.16/24 brd 192.168.121.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe57:6725/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:57:67:39 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:57:67:39 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:57:67:39 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:fe57:6739/64 scope link tentative dadfailed
valid_lft forever preferred_lft forever

Debian 16.04 配置双网卡绑定bond的更多相关文章

  1. Linux双网卡绑定bond详解--单网卡绑定多个IP

    Linux双网卡绑定bond详解 1 什么是bond 网卡bond是通过多张网卡绑定为一个逻辑网卡,实现本地网卡的冗余,带宽扩容和负载均衡,在生产场景中是一种常用的技术.Kernels 2.4.12及 ...

  2. 日常工作问题解决:rhel7下使用teamd配置双网卡绑定

    目录 1.情景描述 2.准备工作 2.1 确认网卡信息 2.2 删除原有网卡配置信息 3.配置网卡绑定 3.1 配置千兆网卡双网卡热备用作心跳 3.2 配置网兆网卡双网卡负载均衡用作业务 1.情景描述 ...

  3. ubuntu16.04 配置双网卡机器

    本文介绍一台具有双有线网卡的机器在Linux下如何配置双网卡 系统平台:Ubuntu16.04 1:查看机器网卡信息,是否双网卡都能正确被机器pci识别 可以通过以下命令查看设备网卡,若果看到两条网卡 ...

  4. Linux下双网卡绑定bond配置实例详解

    本文源自:http://blog.itpub.net/31015730/viewspace-2150185/ 一.什么是bond? 网卡bond是通过多张网卡绑定为一个逻辑网卡,实现本地网卡冗余,带宽 ...

  5. CentOS7配置双网卡绑定

    配置team0配置文件: [root@CentOS7 ~]# cat /etc/sysconfig/network-scripts/ifcfg-team0DEVICE=team0DEVICETYPE= ...

  6. Linux双网卡绑定bond详解

    参考资料: 1.https://blog.csdn.net/shengerjianku/article/details/79221886

  7. CentOS 6.X 双网卡绑定配置

    相关环境 主机:Dell PowerEdge R720服务器(背板有4个GE网口) 操作系统:CentOS(RHEL)6.X 网线连接 使用6类网线 将Dell R720 GE网口 0,与交换机A相连 ...

  8. ubuntu16.04 双网卡绑定

    ubuntu 16.04 双网卡绑定仅仅需要配置/etc/network/interfaces 添加标记内容即可 apt-get install ifenslave 默认已经安装

  9. Linux双网卡绑定配置

    Linux双网卡绑定配置                                       环境介绍 Linux Redhat 6.5.4张网卡 需求 4张网卡两两绑定,4张网卡分别是eth ...

随机推荐

  1. Go+gRPC-Gateway(V2) 微服务实战,小程序登录鉴权服务(四):客户端强类型约束,自动生成 API TS 类型定义

    系列 云原生 API 网关,gRPC-Gateway V2 初探 Go + gRPC-Gateway(V2) 构建微服务实战系列,小程序登录鉴权服务:第一篇 Go + gRPC-Gateway(V2) ...

  2. [Skill]VBA零基础入门及实践:根据链接展示图片

    简介 VBA(Visual Basic for Applications)是依附在应用程序(例如Excel)中的VB语言.只要你安装了Office Excel就自动默认安装了VBA,同样Word和Po ...

  3. Crackme_003

    功能: 拿到文件,先执行一下.功能如下: 1.nag窗口 会先出现如下nag窗口,持续几秒 2.注册窗口: 出现错误会提示:You Get Wrong  Try Again 破解: 1.查壳: 无壳, ...

  4. 【笔记】《算法竞赛入门》习题7-6 UVa12113_重叠的正方形

    title: 习题7-6 UVa12113_重叠的正方形 date: 2021-01-31 19:08:00 categories: 算法竞赛入门 tags: 数据结构 算法 UVa <算法竞赛 ...

  5. 使用Vue-TreeSelect组件实现公司-部门-人员级联下拉列表的处理

    最近在改造原有Bootstrap开发框架,增加一个Vue&Element前端的时候,发现需要处理一个级联更新的过程,就是选择公司,然后更新部门,选择部门,或者人员列表,选择作为主管的一个实现, ...

  6. CSS完成视差滚动效果

    一.是什么 视差滚动(Parallax Scrolling)是指多层背景以不同的速度移动,形成立体的运动效果,带来非常出色的视觉体验 我们可以把网页解刨成:背景层.内容层.悬浮层 当滚动鼠标滑轮的时候 ...

  7. JAVAEE_02_BS/CS架构

    BS/CS架构 系统构架分为? C/S: Client/Server B/S: Browser/Server B/S的优缺点? 优点: 1. 不需要安装特定的客户端软件,只需要浏览器. 2. 升级只需 ...

  8. Day06_31_接口(Interface)

    java 接口(Interface) 接口和抽象类的区别? 子类只能通过extends关键字去继承抽象类(Abstract),子类(如果不是抽象类)则必须覆写抽象类之中的全部抽象方法(如果子类没有实现 ...

  9. 【WPF】将控件事件中的参数,传递到ViewModel中

    在MVVM模式下,在通常使用命令(Command)绑定的方式的时候 ,使用的是 CommandParameter 属性进行参数的传递. 但是很多时候,有一些事件我们需要使用其中的一些事件里面的参数,以 ...

  10. Java 高精度浮点数计算工具

    说起编程中的高精度数值,我第一反应就是double类型了.的确,double阶码11位,尾数52位,几乎能应对任何苛刻的要求......然而,当我天真地尝试用double来算泰勒展开式的函数值,离散代 ...