拓扑介绍

Eth-Trunk5 down down 0% 0% 0 0
10GE1/0/5 down down 0.01% 0.01% 0 0
10GE2/0/5 down down 0.01% 0% 0 0

10GE1/0/33 up up 0% 0.01% 0 0
10GE2/0/33 up up 0% 0.01% 0 0

enp是linux主机上的4个万兆光口
这两个口做了聚合
10GE1/0/5 enp28s0f0 192.168.7.13
10GE2/0/5 enp46s0f0

下面两个口未做聚合
10GE1/0/33 enp28s0f1 192.168.3.13
10GE2/0/33 enp46s0f1

=========================================

交换机上的配置

<HUAWEI>dis ver
Huawei Versatile Routing Platform Software
VRP (R) software, Version 8.150 (CE6810LI V200R002C50SPC800)
Copyright (C) 2012-2017 Huawei Technologies Co., Ltd.
HUAWEI CE6810-48S4Q-LI uptime is 32 days, 22 hours, 26 minutes
Patch Version: V200R002SPH006

CE6810-48S4Q-LI(Master) 1 : uptime is 32 days, 22 hours, 25 minutes
StartupTime 2019/03/14 10:50:12
Memory Size : 2048 M bytes
Flash Size : 512 M bytes
CE6810-48S4Q-LI version information
1. PCB Version : CEM48S4QP04 VER A
2. MAB Version : 1
3. Board Type : CE6810-48S4Q-LI
4. CPLD1 Version : 101
5. CPLD2 Version : 101
6. BIOS Version : 386

CE6810-48S4Q-LI(Standby) 2 : uptime is 32 days, 22 hours, 25 minutes
StartupTime 2019/03/14 10:50:38
Memory Size : 2048 M bytes
Flash Size : 512 M bytes
CE6810-48S4Q-LI version information
1. PCB Version : CEM48S4QP04 VER A
2. MAB Version : 1
3. Board Type : CE6810-48S4Q-LI
4. CPLD1 Version : 101
5. CPLD2 Version : 101
6. BIOS Version : 386

<HUAWEI>display eth-trunk 5
Eth-Trunk5's state information is:
Working Mode: Normal Hash Arithmetic: src-dst-mac
Least Active-linknumber: 1 Max Bandwidth-affected-linknumber: 16
Operating Status: up Number of Up Ports in Trunk: 2
--------------------------------------------------------------------------------
PortName Status Weight
10GE1/0/5 Up 1
10GE2/0/5 Up 1

<HUAWEI>

<HUAWEI>display current-configuration interface Eth-Trunk 5
#
interface Eth-Trunk5
port link-type trunk
port trunk allow-pass vlan 2 to 4094
load-balance src-dst-mac
#
return
<HUAWEI>

交换机eth-trunk5接口上的vlan是没有打tag的,下面的10GE1/0/33是打了vlan3的tag的。
<HUAWEI>display current-configuration interface 10GE1/0/33
#
interface 10GE1/0/33
port default vlan 3
device transceiver 10GBASE-FIBER
#
return
<HUAWEI>display current-configuration interface 10GE2/0/33
#
interface 10GE2/0/33
port default vlan 3
device transceiver 10GBASE-FIBER
#
return
<HUAWEI>

=========================================

主机上配置

# rpm –aq|grep NetworkManager
# rpm –e NetworkManager --nodeps
# lsmod|grep 8021q #如果没有使用一下命令将模组载入内核:modprobe -a 8021q
# modprobe bonding
# modprobe 8021q

[root@localhost network-scripts]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@localhost network-scripts]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost network-scripts]# rpm -qa|wc -l
305
minimal安装

如果交换机那边打标签,则不需要在服务器端打TAG vlan标签,只配置到bond0即可

如果交换机那边没有打标签,则需要在服务器端打TAG vlan标签,需要配置bond0.7(需要bond0和bond0.7两个配置文件)

在两张网卡上的f0口做bond0,然后在bond0上做vlan7,vlan8
[root@localhost network-scripts]# modprobe bonding
[root@localhost network-scripts]# modprobe 8021q
[root@localhost network-scripts]# pwd
/etc/sysconfig/network-scripts
[root@localhost network-scripts]# cat ifcfg-enp28s0f0
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
NAME=enp28s0f0
DEVICE=enp28s0f0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@localhost network-scripts]# cat ifcfg-enp46s0f0
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
NAME=enp46s0f0
DEVICE=enp46s0f0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@localhost network-scripts]# cat ifcfg-bond0
DEVICE=bond0
TYPE=Ethernet
NAME=bond0
BONDING_MASTER=yes
ONBOOT=yes
BOOTPROTO=none
[root@localhost network-scripts]# cat ifcfg-bond0.7
DEVICE=bond0.7
TYPE=Ethernet
NAME=bond0.7
BONDING_MASTER=yes
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.7.36
NETMASK=255.255.255.0
GATEWAY=192.168.7.254
DNS1=8.8.8.8
VLAN=yes
[root@localhost network-scripts]# cat ifcfg-bond0.8
DEVICE=bond0.8
TYPE=Ethernet
NAME=bond0.8
BONDING_MASTER=yes
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.8.36
NETMASK=255.255.255.0
GATEWAY=192.168.8.254
DNS1=8.8.8.8
VLAN=yes

[root@localhost network-scripts]# ifup bond0
[root@localhost network-scripts]# ifup bond0.7
[root@localhost network-scripts]# ip a s
[root@localhost network-scripts]# ifdown bond0.7
[root@localhost network-scripts]# ifdown bond0
[root@localhost network-scripts]# ip a s

bonding_opts可以加在网卡配置文件上,也可以放在bonding.conf中

BONDING_OPTS="mode=802.3ad miimon=100 lacp_rate=fast"
VLAN=yes

# cd /etc/modprobe.d/
# vi bonding.conf
alias bond0 bonding
options bond0 miimon=100 mode=1

# service network restart
#或systemctl restart network

=====================================

将这两个模块加入开机自动启动,这样网络在主机重启动之后,就正常了

[root@localhost network-scripts]# vi /etc/sysconfig/modules/bond_vlan.modules
#!/bin/bash
modprobe bonding
insmod /lib/modules/3.10.0-862.el7.x86_64/kernel/drivers/net/bonding/bonding.ko.xz
modprobe 8021q
insmod /lib/modules/3.10.0-862.el7.x86_64/kernel/net/8021q/8021q.ko.xz

[root@t1 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: enp28s0f0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 90:e2:ba:89:5a:34
Slave queue ID: 0

Slave Interface: enp46s0f0
MII Status: up
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 90:e2:ba:88:c8:18
Slave queue ID: 0

[root@t1 ~]# ethtool bond0
Settings for bond0:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 20000Mb/s
Duplex: Full
Port: Other
PHYAD: 0
Transceiver: internal
Auto-negotiation: off
Link detected: yes

====================================

modprobe bonding

modprobe 8021q

vi /var/log/messages

Apr 17 09:56:29 t1 kernel: [ 1308.332988] 8021q: 802.1Q VLAN Support v1.8

Apr 17 09:56:29 t1 kernel: [ 1308.333004] 8021q: adding VLAN 0 to HW filter on device enp50s0f0

Apr 17 09:56:37 t1 kernel: [ 1315.932745] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Apr 17 09:57:26 t1 kernel: [ 1364.677078] ixgbe 0000:1c:00.0: registered PHC device on enp28s0f0
Apr 17 09:57:26 t1 kernel: [ 1364.782654] 8021q: adding VLAN 0 to HW filter on device enp28s0f0
Apr 17 09:57:26 t1 kernel: [ 1364.783789] bond0: Enslaving enp28s0f0 as an active interface with an up link
Apr 17 09:57:26 t1 kernel: [ 1364.856881] ixgbe 0000:1c:00.0 enp28s0f0: detected SFP+: 5
Apr 17 09:57:26 t1 kernel: [ 1365.117659] ixgbe 0000:1c:00.0 enp28s0f0: NIC Link is Up 10 Gbps, Flow Control: RX/TX

Apr 17 09:57:26 t1 kernel: [ 1365.068979] ixgbe 0000:2e:00.0: registered PHC device on enp46s0f0
Apr 17 09:57:26 t1 kernel: [ 1365.174687] 8021q: adding VLAN 0 to HW filter on device enp46s0f0
Apr 17 09:57:26 t1 kernel: [ 1365.175842] bond0: Enslaving enp46s0f0 as an active interface with an up link
Apr 17 09:57:26 t1 kernel: [ 1365.249587] ixgbe 0000:2e:00.0 enp46s0f0: detected SFP+: 5
Apr 17 09:57:26 t1 kernel: [ 1365.513702] ixgbe 0000:2e:00.0 enp46s0f0: NIC Link is Up 10 Gbps, Flow Control: RX/TX

Apr 17 09:57:26 t1 kernel: [ 1365.192762] 8021q: adding VLAN 0 to HW filter on device bond0

bond-vlan-bridge的更多相关文章

  1. #centos7 设置bond、bridge、vlan

    #centos7 设置bond.bridge.vlan #centos7 设置bond.bridge.vlan # CentOS7中 nmcli命令由NetworkManager提供 # 可以用于设置 ...

  2. Centos 下使用VLAN+Bridge 搭建KVM基础网络环境

    一.使用环境介绍 宿主机上同时运行多网段虚拟机,为了解决宿主机网卡资源紧张问题,采用如下网络模式:(本实验vlan 105:192.168.5.x    vlan108:192.168.8.x) 二. ...

  3. nmcli工具详解

    目录 1. nmcli 安装 2. nmcli 基本选项 3. general 常规选项 3.1 status 3.2 hostname 3.3 permissions 3.4 loggin 4. n ...

  4. nmcli详解

    1. nmcli 安装 [root@liujunjun ~]# yum install -y NetworkManager CentOS7默认已安装了 2. nmcli 基本选项 选项 作用 -t 简 ...

  5. nmcli的基本使用

    介绍NetworkManager.centos8.nmcli CentOS 7中同时支持network.service和NetworkManager.service(简称NM)2种方式配置网络,而在C ...

  6. centos8平台用NetworkManager/nmcli管理网络

    一,centos8上,网络服务的管理需要NetworkManager服务 1,NetworkManager的服务操作 启动 [root@localhost network-scripts]# syst ...

  7. 云计算底层技术-虚拟网络设备(Bridge,VLAN)( 转发)

    云计算底层技术-虚拟网络设备(Bridge,VLAN) Posted on September 24, 2017 by opengers in openstack openstack底层技术-各种虚拟 ...

  8. 理解 neutron(15):Neutron Linux Bridge + VLAN/VXLAN 虚拟网络

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  9. Openvswitch手册(5): VLAN and Bonding

    我们这一节来看Port 一般来说一个Port就是一个Interface,当然也有一个Port对应多个Interface的情况,成为Bond VLAN Configuration Port的一个重要的方 ...

  10. 理解 neutron(15):Neutron linux-bridge-agent 创建 linux bridge 的简要过程

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

随机推荐

  1. CentOS6.5 - linux在虚拟机连接主机(使用nat)

    NAT模式:是虚拟系统借助NAT(网络地址转换)功能,通过宿主机器所在的网络来访问公网.也就是说,使用NAT模式可以实现在虚拟系统里访问互联网. NAT模式下的虚拟系统的TCP/IP配置信息是由VMn ...

  2. MVP 实践

    今天有时间看了看google的官方文档,下载todo源码,仔细研读了一下,觉得其思想对开发还是有很大帮助的.个人认为,MVP通过Activity与业务逻辑的解耦,其作为Controller的职责更加单 ...

  3. tensorFlow入门实践(三)实现lenet5(代码结构优化)

    这两周我学习了北京大学曹建老师的TensorFlow笔记课程,认为老师讲的很不错的,很适合于想要在短期内上手完成一个相关项目的同学,课程在b站和MOOC平台都可以找到. 在卷积神经网络一节,课程以le ...

  4. FCC-js算法题解题笔记

    题目链接:https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm ...

  5. python之路之简单介绍:

    python介绍: a. python 基础 - 基础 - 基本的数据类型 - 函数 - 面向对象 python 安装 python 安装在os上 执行操作: 写一个文件,文件中按照python规则写 ...

  6. 2018-计算机系机试-A

    #include<stdio.h> #include<cstdio> #include<cmath> #include<cstring> #includ ...

  7. JavaSpcript初识

    ---恢复内容开始--- 1-语法标准(Ecmascript) DOM BOM 2=特点以及适用范围 简单易用:封装好了一些方法,属性 基于对象 面向对象: 属于编程思维(思想) C#,C++,Jav ...

  8. C#字符串的CompareTo比较,让我疑惑的地方

    在学习选择排序算法的时候,用到CopareTo方法.由于比较的数字,是自己随意输入的. 当我输入字符串“8”,它和字符串“16”比较时候. string str1 = "8"; s ...

  9. 简单几步,教你学会PHP,新手必看!

    学习php的方法,学东西,永远不要妄想有速成这一说,告诉你了一个方式,但是缺少努力这一环节,那也是白搭.掌握好的学习方法非常必要,看看这篇如何学习PHP培训的方法,在此提醒一下大家,PHP不像别的科目 ...

  10. 3.13 练习题4:邮件发送(smtp)

    3.13 练习题4:邮件发送(smtp) 前言本篇总结了QQ邮箱和163邮箱发送邮件,邮件包含html中文和附件,可以发给多个收件人,专治各种不行,总之看完这篇麻麻再也不用担心我的邮件收不到了.以下代 ...