bond-vlan

拓扑介绍

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>


<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>


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


主机上配置

[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安装

在两张网卡上的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

猜你喜欢

转载自www.cnblogs.com/createyuan/p/10714917.html
今日推荐