一 、路径的选择:
配置思路:
配置思路:
1.终端设备
给PC配置IP地址
2.配置网络设备
-交换机配置初始化配置
-所有的交换机创建vlan 16 25 34
-链接PC端口是access并加入对于vlan
-链接交换机的端口是trunk并允许所以vlan通过
-测试互通所有相同网段的主机是可以互通的
3.mstp配置
-模式的修改mstp
-进去到配置区域
-给区域起名字
-创建实例并关联vlan
-激活实例
-根据情况调整实例的优先级 0
1、交换机的初始化配置
<Huawei>undo terminal monitor \\关闭终端消息提示
<Huawei>system-view \\进去系统视图
[Huawei]sysname A \\修改设备名为A
[A]vlan batch 16 25 34 \\创建vlan 16 25 34
[A]quit \\返回
<Huawei>undo terminal monitor \\关闭终端消息提示
<Huawei>system-view \\进去系统视图
[Huawei]sysname B \\修改设备名为B
[B]vlan batch 16 25 34 \\创建vlan 16 25 34
[B]quit \\返回
<Huawei>undo terminal monitor \\关闭终端消息提示
<Huawei>system-view \\进去系统视图
[Huawei]sysname C \\修改设备名为C
[C]vlan batch 16 25 34 \\创建vlan 16 25 34
[C]quit \\返回
<Huawei>undo terminal monitor \\关闭终端消息提示
<Huawei>system-view \\进去系统视图
[Huawei]sysname D \\修改设备名为D
[D]vlan batch 16 25 34 \\创建vlan 16 25 34
[D]quit \\返回
2、交换机连接PC端口的配置 模式access并加入对应的vlan
[A]interface Ethernet 0/0/1 \\进去接口0/0/1
[A-Ethernet0/0/1]port link-type access \\设置端口模式为access
[A-Ethernet0/0/1]port default vlan 16 \\将端口加入vlan 16
[A-Ethernet0/0/1]quit \\返回
[B]interface Ethernet 0/0/4 \\进去接口0/0/4
[B-Ethernet0/0/4]port link-type access \\设置端口模式为access
[B-Ethernet0/0/4]port default vlan 34 \\将端口加入vlan 34
[B-Ethernet0/0/4]quit \\返回
[C]interface Ethernet 0/0/2 \\进去接口0/0/2
[C-Ethernet0/0/2]port link-type access \\设置端口模式为access
[C-Ethernet0/0/2]port default vlan 25 \\将端口加入vlan 25
[C-Ethernet0/0/2]quit \\返回
[C]interface Ethernet 0/0/3 \\进去接口0/0/3
[C-Ethernet0/0/3]port link-type access \\设置端口模式为access
[C-Ethernet0/0/3]port default vlan 34 \\将端口加入vlan 34
[C-Ethernet0/0/3]quit \\返回
[D]interface Ethernet 0/0/5 \\进去接口0/0/5
[D-Ethernet0/0/5]port link-type access \\设置端口模式为access
[D-Ethernet0/0/5]port default vlan 16 \\将端口加入vlan 16
[D-Ethernet0/0/5]quit \\返回
[D]interface Ethernet 0/0/6 \\进去接口0/0/6
[D-Ethernet0/0/6]port link-type access \\设置端口模式为access
[D-Ethernet0/0/6]port default vlan 25 \\将端口加入vlan 25
[D-Ethernet0/0/6]quit \\返回
3、交换机连接交换机端口的配置模式为trunk 并允许所有的vlan 通过
[A]port-group group-member e0/0/11 to e0/0/13 \\创建临时组将e0/0/11 e0/0/13组建一起
[A-port-group]port link-type trunk \\设置端口模式为trunk
[A-port-group]port trunk allow-pass vlan all \\并允许所有的vlan通过
[A-port-group]quit \\返回
[B]port-group group-member e0/0/11 to e0/0/13 \\创建临时组将e0/0/11 e0/0/13组建一起
[B-port-group]port link-type trunk \\设置端口模式为trunk
[B-port-group]port trunk allow-pass vlan all \\并允许所有的vlan通过
[B-port-group]quit \\返回
[C]port-group group-member e0/0/11 to e0/0/13 \\创建临时组将e0/0/11 e0/0/13组建一起
[C-port-group]port link-type trunk \\设置端口模式为trunk
[C-port-group]port trunk allow-pass vlan all \\并允许所有的vlan通过
[C-port-group]quit \\返回
[D]port-group group-member e0/0/11 to e0/0/13 \\创建临时组将e0/0/11 e0/0/13组建一起
[D-port-group]port link-type trunk \\设置端口模式为trunk
[D-port-group]port trunk allow-pass vlan all \\并允许所有的vlan通过
[D-port-group]quit \\返回
4、MSTP的配置
[A]stp mode mstp \\设置模式为mstp
[A]stp region-configuration \\进去STP的配置区域
[A-mst-region]region-name ntd \\配置区域名
[A-mst-region]instance 16 vlan 16 \\创建实例16并捆绑给vlan 16
[A-mst-region]instance 25 vlan 25 \\创建实例25并捆绑给vlan 25
[A-mst-region]instance 34 vlan 34 \\创建实例34并捆绑给vlan 34
[A-mst-region]active region-configuration \\激活区域
[A-mst-region]quit \\返回
[B]stp mode mstp \\设置模式为mstp
[B]stp region-configuration \\进去STP的配置区域
[B-mst-region]region-name ntd \\配置区域名
[B-mst-region]instance 16 vlan 16 \\创建实例16并捆绑给vlan 16
[B-mst-region]instance 25 vlan 25 \\创建实例25并捆绑给vlan 25
[B-mst-region]instance 34 vlan 34 \\创建实例34并捆绑给vlan 34
[B-mst-region]active region-configuration \\激活区域
[B-mst-region]quit \\返回
[C]stp mode mstp \\设置模式为mstp
[C]stp region-configuration \\进去STP的配置区域
[C-mst-region]region-name ntd \\配置区域名
[C-mst-region]instance 16 vlan 16 \\创建实例16并捆绑给vlan 16
[C-mst-region]instance 25 vlan 25 \\创建实例25并捆绑给vlan 25
[C-mst-region]instance 34 vlan 34 \\创建实例34并捆绑给vlan 34
[C-mst-region]active region-configuration \\激活区域
[C-mst-region]quit \\返回
[D]stp mode mstp \\设置模式为mstp
[D]stp region-configuration \\进去STP的配置区域
[D-mst-region]region-name ntd \\配置区域名
[D-mst-region]instance 16 vlan 16 \\创建实例16并捆绑给vlan 16
[D-mst-region]instance 25 vlan 25 \\创建实例25并捆绑给vlan 25
[D-mst-region]instance 34 vlan 34 \\创建实例34并捆绑给vlan 34
[D-mst-region]active region-configuration \\激活区域
[D-mst-region]quit \\返回
5、将交换机D设置为vlan 16的根交换机
[D]stp instance 16 priority 0
6、将交换机B设置为vlan 34的根交换机
[B]stp instance 34 priority 0
7、将交换机c设置为vlan25的根交换机
[C]stp instance 25 priority 0
二、链路聚合技术
随着我们网络的不断拓展,业务流量也随之增多,那么我们就开始需要多链路进行通信
故研究出一个技术==Eth-Trunk(链路捆绑)
作用:
可以把多个独立的物理端口绑定在一起,当做一个大带宽逻辑接口去使用,这样的方法既不用替换端口也不必浪费IP地址资源
组建网络遇到的问题:
1. 网络需求大,单链路无法完成,增加链路又浪费IP地址,更换高带宽接口(E口换G口)又会增加维护设备的成本
2. 如果链路发生故障,又会影响通信和办公
解决:
两个问题均可以用eth-trunk来解决,将多个e口绑定为一起带宽转发就会增加(不必使用G口)由于是多个端口绑定故即便发生端口故障或者是单条链路故障也没有关系,因为其他端口也会进行转发(如果物理端口断掉,带宽转发也会稍微影响:比如,我用四条链路组成了一个链路捆绑(4000M)那么断开一个的话(-1000M),转发就会变成3000M)
Eth-Trunk链路聚合模式:
静态配置模式(手工负载分担)
动态配置模式(LACP)
Eth-trunk接口负载分担:
可以选择IP地址或者包作为负载分担依据
设置成员接口的负载分担分配
如果一个成员的分配权重值越大,承担的负载就越大
逐流负载分担:
当源地址、目标地址都相同或者报文的源MAC地址、目标MAC地址都相同时,就会在一条链路上传输
逐包负载分担:
以报文为单位分别从不同的成员链路上发送
手工负载分担模式:
当两台设备其中一个不支持LACP时,可以用手工负载方式来增加设备间的带宽和可靠性
Eth-Trunk接口配置流程:
1、交换机的初始化配置
<Huawei>undo terminal monitor \\关闭终端消息提示
<Huawei>system-view \\进去系统视图
[Huawei]sysname SW1 \\修改设备名为SW1
[sw1]vlan batch 10 20 \\创建vlan 10 20
[sw1]quit \\返回
2、交换机连接PC端口的配置 模式access并加入对应的vlan
[sw1]interface GigabitEthernet 0/0/3 \\进去接口0/0/3
[sw1-GigabitEthernet0/0/3]port link-type access \\设置端口模式为access
[sw1-GigabitEthernet0/0/3]port default vlan 10 \\将端口加入vlan 10
[sw1-GigabitEthernet0/0/3]quit \\返回
[sw1]interface GigabitEthernet 0/0/4 \\进去接口0/0/4
[sw1-GigabitEthernet0/0/4]port link-type access \\设置端口模式为access
[sw1-GigabitEthernet0/0/4]port default vlan 20 \\将端口加入vlan 20
[sw1-GigabitEthernet0/0/4]quit \\返回
[sw2]interface GigabitEthernet 0/0/3 \\进去接口0/0/3
[sw2-GigabitEthernet0/0/3]port link-type access \\设置端口模式为access
[sw2-GigabitEthernet0/0/3]port default vlan 10 \\将端口加入vlan 10
[sw2-GigabitEthernet0/0/3]quit \\返回
[sw2]interface GigabitEthernet 0/0/4 \\进去接口0/0/4
[sw2-GigabitEthernet0/0/4]port link-type access \\设置端口模式为access
[sw2-GigabitEthernet0/0/4]port default vlan 20 \\将端口加入vlan 20
[sw2-GigabitEthernet0/0/4]quit \\返回
3、交换机连接交换机之间先做链路捆绑在设置 模式trunk 并允许所有的vlan 通过
[sw1]interface Eth-Trunk 1 \\创建链路聚合接口 1
[sw1-Eth-Trunk1]mode manual load-balance \\设置模式为静态负载均衡模式
[sw1-Eth-Trunk1]trunkport g0/0/1 \\添加接口成员 g0/0/1
[sw1-Eth-Trunk1]trunkport g0/0/2 \\添加接口成员 g0/0/2
[sw1-Eth-Trunk1]port link-type trunk \\设置端口模式为trunk
[sw1-Eth-Trunk1]port trunk allow-pass vlan all \\并允许所有的vlan 通过
[sw1-Eth-Trunk1]quit \\返回
[sw2]interface Eth-Trunk 2 \\创建链路聚合接口 2
[sw2-Eth-Trunk2]mode manual load-balance \\设置模式为静态负载均衡模式
[sw2-Eth-Trunk2]trunkport g0/0/1 \\添加接口成员 g0/0/1
[sw2-Eth-Trunk2]trunkport g0/0/2 \\添加接口成员 g0/0/2
[sw2-Eth-Trunk2]port link-type trunk \\设置端口模式为trunk
[sw2-Eth-Trunk2]port trunk allow-pass vlan all \\并允许所有的vlan 通过
[sw2-Eth-Trunk2]quit \\返回
[sw2]display Eth-Trunk 2 显示eth-Trunk2的端口
一、LACP模式概述
1、LACP模式也可以称之为M:N模式
1)M代表处于活动状态的转发数据
2)N代表处于非活动状态的备份链路
3)例如我们建立的三条链路,就是其中两条转发,其中1条备份,当转发链路出现故障的时候,备份链路才会进行数据转发,平时是不转发数据的
2、LACP的选取:
3、LACP的抢占:
- LACP负载分担模式的配置命令
- 创建Eth-Trunk
命令格式:interface Eth-Trunk接口(范围0-63)
- 配置Eth-Trunk的工作模式
命令格式:mode lacp-static
- Eth-Trunk中加入接口成员
命令格式:trunkport gi0/0/1
- Eth-Trunk修改优先级(值越小优先级越大)
命令格式:lacp priority 优先级的值 (范围0-65535,默认值 32768)
- Eth-Trunk最大连接数的设置
命令格式:interface Eth-Trunk 1
max active-linkunmber 数量(范围1-8,默认值 8)
- 配置Eth-Trunk的抢占功能
命令格式:interface Eth-Trunk 1
lacp preempt enable \\开启抢占功能
- 配置动态Eth-Trunk模式
1、创建Eth-Trunk
2、配置Eth-Trunk的工作模式
3、Eth-Trunk中加入接口成员
4、配置SW2为eth-trunk的主动端,优先级设置为100
5、交换机之间的最大连接宽带为2G
命令配置:
① S1交换机的初始配置
<Huawei>u t m
<Huawei>system-view
[S1]sysname S1
② 创建vlan并将接口加入vlan设置接口的模式为acess:
[S1]vlan batch 10 20 \\创建vlan 10 20
[S1]interface g0/0/4 \\进入接口0/0/4
[S1-GigabitEthernet0/0/4]port link-type access \\设置接口模式为接入链路
[S1-GigabitEthernet0/0/4]port default vlan 10 \\将接口加入vlan10
[S1]interface gth0/0/5 \\进入接口0/0/5
[S1-GigabitEthernet0/0/5]port link-type access \\设置接口模式为接入链路
[S1-GigabitEthernet0/0/5]port default vlan 20 \\将接口加入vlan20
③ 配置链路聚合:LACP模式
[S1] interface eth-trunk 1 \\创建链路聚合的端口1 (0-63)
[S1-Eth-Trunk1]mode lacp-static
[S1-Eth-Trunk1]trunkport g0/0/1 \\将接口加入到负载模式
[S1-Eth-Trunk1]trunkport g0/0/2 \\将接口加入到负载模式
[S1-Eth-Trunk1]trunkport g0/0/3 \\将接口加入到负载模式
[S1-Eth-Trunk1]port link-type trunk \\设置为trunk链路
[S1-Eth-Trunk1]port trunk allow-pass vlan all \\ 设置为允许所有vlan
[S1-Eth-Trunk1]display eth-trunk 1 \\查看 eth-trunk
[S1]int eth-trunk 1 \\进入eth-trunk1
④ S2交换机的初始配置
<Huawei> u t m
<Huawei>system-view
[Huawei]sysname S2
⑤ 创建vlan并将接口加入vlan:
[S2]vlan batch 10 20 \\创建vlan 10 20
[S2]interface g0/0/4 \\进入接口0/0/5
[S2-GigabitEthernet0/0/4]port link-type access \\设置接口模式为接入链路
[S2-GigabitEthernet0/0/4]port default vlan 10 \\将接口加入vlan10
[S2]interface g0/0/5 \\进入接口0/0/5
[S2-GigabitEthernet0/0/5]port link-type access \\设置接口模式为接入链路
[S2-GigabitEthernet0/0/5]port default vlan 20 \\将接口加入vlan20
⑥ 配置链路聚合:LACP模式
[S2] interface eth-trunk 1 \\创建链路聚合的端口1 (0-63)
[S2-Eth-Trunk1] mode lacp-static
[S2-Eth-Trunk1]trunkport g0/0/1 \\将接口加入到负载模式
[S2-Eth-Trunk1]trunkport g0/0/2 \\将接口加入到负载模式
[S2-Eth-Trunk1]trunkport g0/0/3 \\将接口加入到负载模式
[S2-Eth-Trunk1]port link-type trunk \\设置为trunk链路
[S2-Eth-Trunk1]port trunk allow-pass vlpe trunkan all \\ 设置为允许所有vlan
[S2-Eth-Trunk1]display eth-trunk 1 \\查看 eth-trunk
[S2]display port vlan \\查看 vlan
[S2]display eth-trunk 1 \\查看 eth-trunk
Local:本地信息 Partner:对端信息
Svstem Prioritv:32768 系统的优先级
System ID:4clf-cc4e-5 系统的mac地址
MAX Active-linknumber:8 最大的活动链路数是8条
链路数是可以进行调整的我们可以调整为2条
Number of Up Port In Trunk:0 目前有几条
端口的编号 端口的状态 端口的带宽 接口的优先级 接口编号
UNSELECT 为备份端口 Selected 为活动端口
我们使用的是千兆端口,目前对方的信息都是0还没有启动
S2设置他的链路为2:
[S2]display eth-trunk 1 \\查看 eth-trunk
[S2]int eth-trunk 1 \\进入eth-trunk1
[S2-Eth-Trunk1]max active-linknumber 2 \\设置为2条链路
修改sw2为主设备,默认值是32768 我们可以设置为100
[S2]lacp priority 100 \\设置默认值为100
[S2]display eth-trunk 1 \\查看 eth-trunk
设置S2抢占功能:
模拟1接口出现故障了
[S2]int g0/0/1 \\加入接口1
[S2-GigabitEthernet0/0/1]shutdows \\关闭接口
[S2]display eth-trunk 1 \\查看 eth-trunk
[S2]display eth-trunk \\查看 eth-trunk
Preempt Delay:Disabled 当前抢占功能未开启
配置启用抢占模式 S1 S2都需要开启
[S2]display eth-trunk 2 \\查看 eth-trunk
[S2-Eth-Trunk1]lacp preempt enable \\配置抢占模式
[S1]display eth-trunk 1 \\查看 eth-trunk
[S1-Eth-Trunk1]lacp preempt enable \\配置抢占模式
[S2]display eth-trunk \\查看 eth-trunk
Preempt Delay Time:30 当前抢占功能已开启 30秒后抢
- 链路聚合综合实战
1、配置思路:
1.配置终端设备
给PC机配置IP地址参数
2.配置网络设备
-先初始化配置
-创建vlan
-将接口加入vlan并设置端口模式为access
eth-trunk
-创建eth-trunk的端口
-设置ETH-TRUNK模式
-添加接口成员
-设置端口模式为trunk并允许所有的vlan通过
2、配置命令:
二层交换机的配置 S3 S4 S5 S6
- S3交换机的初始配置
<Huawei>u t m \\关闭信息干扰
<Huawei>system-view \\进入系统视图
[Huawei]sysname S3 \\设置交换机的名字为S3
- S3创建vlan 10 20
[S3]vlan batch 10 20 \\创建vlan 10 20
- S3将e0/0/1加入vlan10 并设置链路是access链路
[S3]int e0/0/1 \\进入接口0/0/1
[S3-Ethernet0/0/1]port link-type access \\设置链路为接入链路(access链路)
[S3-Ethernet0/0/1]port default vlan 10 \\将接口加入vlan10
- 创建链路聚合接口eth-trunk 1 并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
[S3]interface Eth-Trunk 1 \\创建链路聚合的端口1
[S3-Eth-Trunk1]mode lacp-static \\设置链路为动态lacp
[S3-Eth-Trunk1]trunkport e0/0/3 \\将接口加入到负载模式
[S3-Eth-Trunk1]trunkport e0/0/4 \\将接口加入到负载模式
[S3-Eth-Trunk1]port link-type trunk \\设置为trunk链路
[S3-Eth-Trunk1] port trunk allow-pass vlan all \\并允许所有vlan通过
[S3-Eth-Trunk1]display eth-trunk 1 \\查看 eth-trunk
- S4交换机的初始配置
<Huawei>u t m \\关闭信息干扰
<Huawei>system-view \\进入系统视图
[Huawei]sysname S4 \\设置交换机的名字为S4
- S4创建vlan 10 20
[S4]vlan batch 10 20 \\创建vlan 10 20
- S4将e0/0/1加入vlan10 并设置链路是access链路
[S4]int e0/0/1 \\进入接口0/0/1
[S4-Ethernet0/0/1]port link-type access \\设置链路为接入链路(access链路)
[S4-Ethernet0/0/1]port default vlan 20 \\将接口加入vlan20
- 创建链路聚合接口eth-trunk 1 并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
[S4]interface Eth-Trunk 2 \\创建链路聚合的端口2
[S4-Eth-Trunk2]mode lacp-static \\设置链路为动态lacp
[S4-Eth-Trunk2]trunkport e0/0/5 \\将接口加入到负载模式
[S4-Eth-Trunk2]trunkport e0/0/6 \\将接口加入到负载模式
[S4-Eth-Trunk2]port link-type trunk \\设置为trunk链路
[S4-Eth-Trunk2] port trunk allow-pass vlan all \\并允许所有vlan通过
[S4-Eth-Trunk2]display eth-trunk 1 \\查看 eth-trunk
- S5交换机的初始配置
<Huawei>u t m \\关闭信息干扰
<Huawei>system-view \\进入系统视图
[Huawei]sysname S5 \\设置交换机的名字为S5
- S5创建vlan 10 20
[S5]vlan batch 10 20 \\创建vlan 10 20
- S5将e0/0/1加入vlan10 并设置链路是access链路
[S5]int e0/0/1 \\进入接口0/0/1
[S5-Ethernet0/0/1]port link-type access \\设置链路为接入链路(access链路)
[S5-Ethernet0/0/1]port default vlan 10 \\将接口加入vlan10
- 创建链路聚合接口eth-trunk 1 并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
[S5]interface Eth-Trunk 1 \\创建链路聚合的端口1
[S5-Eth-Trunk1]mode lacp-static \\设置链路为动态lacp
[S5-Eth-Trunk1]trunkport e0/0/3 \\将接口加入到负载模式
[S5-Eth-Trunk1]trunkport e0/0/4 \\将接口加入到负载模式
[S5-Eth-Trunk1]port link-type trunk \\设置为trunk链路
[S5-Eth-Trunk1] port trunk allow-pass vlan all \\并允许所有vlan通过
[S5-Eth-Trunk1]display eth-trunk 1 \\查看 eth-trunk
- S6交换机的初始配置
<Huawei>u t m \\关闭信息干扰
<Huawei>system-view \\进入系统视图
[Huawei]sysname S6 \\设置交换机的名字为S6
- S6创建vlan 10 20
[S6]vlan batch 10 20 \\创建vlan 10 20
- S6将e0/0/1加入vlan10 并设置链路是access链路
[S6]int e0/0/1 \\进入接口0/0/1
[S6-Ethernet0/0/1]port link-type access \\设置链路为接入链路(access链路)
[S6-Ethernet0/0/1]port default vlan 20 \\将接口加入vlan20
- 创建链路聚合接口eth-trunk 1 并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
[S6]interface Eth-Trunk 2 \\创建链路聚合的端口2
[S6-Eth-Trunk2]mode lacp-static \\设置链路为动态lacp
[S6-Eth-Trunk2]trunkport e0/0/5 \\将接口加入到负载模式
[S6-Eth-Trunk2]trunkport e0/0/6 \\将接口加入到负载模式
[S6-Eth-Trunk2]port link-type trunk \\设置为trunk链路
[S6-Eth-Trunk2] port trunk allow-pass vlan all \\并允许所有vlan通过
[S6-Eth-Trunk2]display eth-trunk 1 \\查看 eth-trunk
三层交换机的配置 S1 S2
S1交换机的初始配置
<Huawei>u t m \\关闭信息干扰
<Huawei>system-view \\进入系统视图
[Huawei]sysname S1 \\设置交换机的名字为S1
S1创建vlan 10 20
[S1]vlan batch 10 20 \\创建vlan 10 20
3.创建链路聚合接口eth-trunk 1 、2并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
[S1]interface Eth-Trunk 1 \\创建链路聚合的端口1
[S1-Eth-Trunk1]mode lacp-static \\设置链路为动态lacp
[S1-Eth-Trunk1]trunkport g0/0/3 \\将接口加入到负载模式
[S1-Eth-Trunk1]trunkport g0/0/4 \\将接口加入到负载模式
[S1-Eth-Trunk1]port link-type trunk \\设置为trunk链路
[S1-Eth-Trunk1] port trunk allow-pass vlan all \\并允许所有vlan通过
[S1]interface Eth-Trunk 2 \\创建链路聚合的端口2
[S1-Eth-Trunk2]mode lacp-static \\设置链路为动态lacp
[S1-Eth-Trunk2]trunkport g0/0/5 \\将接口加入到负载模式
[S1-Eth-Trunk2]trunkport g0/0/6 \\将接口加入到负载模式
[S1-Eth-Trunk2]port link-type trunk \\设置为trunk链路
[S1-Eth-Trunk2] port trunk allow-pass vlan all \\并允许所有vlan通过
[S1]interface Eth-Trunk 3 \\创建链路聚合的端口3
[S1-Eth-Trunk3]mode lacp-static \\设置链路为动态lacp
[S1-Eth-Trunk3]trunkport g0/0/7 \\将接口加入到负载模式
[S1-Eth-Trunk3]trunkport g0/0/8 \\将接口加入到负载模式
[S1-Eth-Trunk3]port link-type trunk \\设置为trunk链路
[S1-Eth-Trunk3] port trunk allow-pass vlan all \\并允许所有vlan通过
[S1]display eth-trunk 1 \\查看 eth-trunk
[S1]display eth-trunk 2 \\查看 eth-trunk
[S1]display eth-trunk 3 \\查看 eth-trunk
S2交换机的初始配置
<Huawei>u t m \\关闭信息干扰
<Huawei>system-view \\进入系统视图
[Huawei]sysname S2 \\设置交换机的名字为S2
S2创建vlan 10 20
[S2]vlan batch 10 20 \\创建vlan 10 20
创建链路聚合接口eth-trunk 1 、2并将设置模式为lacp、加入成员并设置链路为tunk并允许所有vlan通过
[S2]interface Eth-Trunk 1 \\创建链路聚合的端口1
[S2-Eth-Trunk1]mode lacp-static \\设置链路为动态lacp
[S2-Eth-Trunk1]trunkport g0/0/3 \\将接口加入到负载模式
[S2-Eth-Trunk1]trunkport g0/0/4 \\将接口加入到负载模式
[S2-Eth-Trunk1]port link-type trunk \\设置为trunk链路
[S2-Eth-Trunk1] port trunk allow-pass vlan all \\并允许所有vlan通过
[S2-Eth-Trunk1]display eth-trunk 1 \\查看 eth-trunk
[S2]interface Eth-Trunk2 \\创建链路聚合的端口2
[S2-Eth-Trunk2]mode lacp-static \\设置链路为动态lacp
[S2-Eth-Trunk2]trunkport g0/0/5 \\将接口加入到负载模式
[S2-Eth-Trunk2]trunkport g0/0/6 \\将接口加入到负载模式
[S2-Eth-Trunk2]port link-type trunk \\设置为trunk链路
[S2-Eth-Trunk2] port trunk allow-pass vlan all \\并允许所有vlan通过
[S2-Eth-Trunk2]display eth-trunk 2 \\查看 eth-trunk
[S2]interface Eth-Trunk3 \\创建链路聚合的端口3
[S2-Eth-Trunk3]mode lacp-static \\设置链路为动态lacp
[S2-Eth-Trunk3]trunkport g0/0/7 \\将接口加入到负载模式
[S2-Eth-Trunk3]trunkport g0/0/8 \\将接口加入到负载模式
[S2-Eth-Trunk3]port link-type trunk \\设置为trunk链路
[S2-Eth-Trunk3] port trunk allow-pass vlan all \\并允许所有vlan通过
[S2-Eth-Trunk3]display eth-trunk 3 \\查看 eth-trunk
二、Mux VLAN 原理
1、为什么要使用Mux VLAN技术?
不同广播域(部门)的隔离 VLAN
允许特定的VLAN之间访问
VLAN+Hybrid(VLAN的合并)
2、特殊情况:
--每个部门一个VLAN,VLAN间不能访问;
--服务器单独在一个VLAN,所有VLAN的主机都可以访问服务器;
--外来访问人员需要在一个单独的VLAN,可以访问服务器,
外来人员之间不能互相访问;
3、Mux VLAN原理
--是对VLAN技术的补充
--把VLAN分成了不同类型
#主VLAN:任何VLAN的主机都可以访问的VLAN
一般把服务器放置在主VLAN 网关
#辅助VLAN:
*组VLAN:VLAN内的主机可以互相访问的VLAN
*隔离VLAN:VLAN内的主机不可以互相访问的VLAN
1、初始化的配置
<Huawei>undo terminal monitor \\关闭终端信息提示
<Huawei>system-view \\进去系统视图
[Huawei]sysname sw1 \\修改设备名为sw1
[sw1]vlan batch 100 200 300 \\创建vlan 100 200 300
2、设置mux-vlan的角色
[sw1]vlan 100 \\进入vlan 100
[sw1-vlan100]mux-vlan \\将vlan100设置为主vlan
[sw1-vlan100]subordinate group 300 \\将vlan300设置为组vlan
[sw1-vlan100]subordinate separate 200 \\将vlan2300设置隔离vlan
[sw1-vlan100]quit \\返回
[sw1]display vlan \\查询vlan相关信息
[sw1]display mux-vlan \\查询mux vlan的接口信息
3、连接PC的端口将设置模式为access 并加入对应的vlan
[sw1]interface Ethernet 0/0/1 \\进入端口0/0/1接口
[sw1-Ethernet0/0/1]port link-type access \\设置端口模式access
[sw1-Ethernet0/0/1]port default vlan 200 \\将端加入vlan 200
[sw1-Ethernet0/0/1]port mux-vlan enable \\开启mux-vlan功能
[sw1-Ethernet0/0/1]quit \\返回
[sw1]interface Ethernet 0/0/2 \\进入端口0/0/1接口
[sw1-Ethernet0/0/2]port link-type access \\设置端口模式access
[sw1-Ethernet0/0/2]port default vlan 200 \\将端加入vlan 200
[sw1-Ethernet0/0/2]port mux-vlan enable \\开启mux-vlan功能
[sw1-Ethernet0/0/2]quit \\返回
[sw1]port-group group-member e0/0/3 e0/0/4
[sw1-port-group]port link-type access \\设置端口模式access
[sw1-port-group]port default vlan 300 \\将端加入vlan 300
[sw1-port-group]port mux-vlan enable \\开启mux-vlan功能
[sw1-port-group]quit \\返回
3、连接路由器的端口将设置模式为access 并加入对应的vlan
[sw1]interface GigabitEthernet 0/0/1 \\进入端口0/0/1接口
[sw1-GigabitEthernet0/0/1]port link-type access \\设置端口模式access
[sw1-GigabitEthernet0/0/1]port default vlan 100 \\将端加入vlan 100
[sw1-GigabitEthernet0/0/1]port mux-vlan enable \\开启mux-vlan功能
[sw1-GigabitEthernet0/0/1]quit \\返回
4、路由器的配置
<Huawei>undo terminal monitor \\关闭终端信息提示
<Huawei>system-view \\进去系统视图
[Huawei]sysname r1 \\修改设备名为r1
[r1]interface GigabitEthernet 0/0/0 \\进入端口0/0/0接口
[r1-GigabitEthernet0/0/0]ip address 192.168.1.254 24 \\给接口配置IP地址
[r1-GigabitEthernet0/0/0]quit \\返回
[r1]interface GigabitEthernet 0/0/1 \\进入端口0/0/1接口
[r1-GigabitEthernet0/0/1]ip address 192.168.88.254 24 \\给接口配置IP地址
[r1-GigabitEthernet0/0/1]quit \\返回
在上一个实验的基础之上,加一台主机vlan 400
Vlan 400是组vlan
验证:vlan 300 和vlan 400之间不能互通,
说明:不同组vlan 之间不能互通,但是可以和主互通
[sw1]vlan 400 \\创建vlan 400
[sw1-vlan400]quit \\返回
[sw1]vlan 100 \\进入vlan 100
[sw1-vlan100]subordinate group 400 \\将vlan400设置为组vlan
[sw1-vlan100]quit \\返回
[sw1]interface Ethernet 0/0/5 \\进入端口0/0/5接口
[sw1-Ethernet0/0/5]port link-type access \\设置端口模式access
[sw1-Ethernet0/0/5]port default vlan 400 \\将端加入vlan 400
[sw1-Ethernet0/0/5]port mux-vlan enable \\开启mux-vlan功能
[sw1-Ethernet0/0/5]quit \\返回
[sw1]display mux-vlan \\查询