Vlan、链路聚合、端口安全与生成树协议是交换机应用中的基础,这四者在应用中,链路聚合后作为生成树协议应用的一条备份链路,在应用案例中讲到的很少。本案例即设计这样一个应用案例,将四者整合到一个拓扑中,谨供大家参考。(版权所有,引用联系作者)
一、配置要求:
1、按拓扑图配置各PC的IP,划分Vlan10、Vlan20,分别将PC连接到f0/1、f0/11,并加入相应Vlan
2、配置路由,使整个网络连通
3、配置链路聚合(使用主从模式,自定义主端)和生成树协议,实现备份链路和带宽扩展。
4、测试链路的连通性,并查看生成树协议和聚合结果。
二、具体配置
1、左侧交换机:
en
conf t
vl 10 创建Vlan10
vl 20
int fa0/1 指向端口f0/1
sw ac vlan 10 指定端口所属Vlan
sw mode access 指定端口类型
shut 关闭端口
sw port-security 启动端口安全
sw po max 1 指定端口可接入的最大MAC地址
sw po violation shut 指定接入违规时的处理方式(Down)
sw po mac-address 00E0.B0DA.C552 绑定MAC
no shut 启动端口
int f0/11
sw ac vlan 20
int range f0/21-22 指定聚合的端口范围
channel-g 1 mo active 设置聚合端口为主端
in po 1 形成聚合通道
sw mode trunk 设置通道为trunk(备份通道)
int g0/1 设置为trunk口(主通道)
sw m t
2、中间交换机:
en
conf t
vl 10 创建Vlan10
vl 20
int fa0/1 指向端口f0/1
sw ac vlan 10 指定端口所属Vlan
int f0/11
sw ac vlan 20
int range f0/21-22 指定聚合的端口范围
channel-g 1 mo passive 设置聚合端口为从端
in po 1 形成聚合通道
sw mode trunk 设置通道为trunk(备份通道)
int range f0/23-24 指定聚合的端口范围
channel-g 2 mo active 设置聚合端口为主端
in po 2 形成聚合通道
sw mode trunk 设置通道为trunk(备份通道)
int range g0/1-2 设置为trunk口(主通道)
sw m t
3、右侧三层交换机:
en
conf t
vl 10 创建Vlan10
vl 20
int fa0/1 指向端口f0/1
sw ac vlan 10 指定端口所属Vlan
int f0/11
sw ac vlan 20
int range f0/23-24 指定聚合的端口范围
channel-g 2 mo passive 设置聚合端口为从端
in po 2 形成聚合通道
int vl 10 设置网关
ip add 192.168.10.1 255.255.255.0
int vl 20
ip add 192.168.11.1 255.255.255.0
ip routing 启动路由功能
三、验证:
1、验证连通性
2、查看生成树协议
左侧交换机
中间交换机
3、查看聚合结果
左侧交换机
中间交换机
右侧交换机
四、问题:
Cisco交换机默认是启用生成树协议的,如果你再次配置:sp mo pvst启动生成树协议类的指令,在PKT模拟器6.2版本,则会出现频闪(应该是出现了环路风暴),此时ping是不通的。我推测这应该是软件的问题。谨以说明。