cisco交换机-简单配置生成树协议rstp和端口聚合

拓扑:
在这里插入图片描述

1、为sw01、sw02、sw03设置生成树协议

sw01(config)#spanning-tree mode rapid-pvst
sw02(config)#spanning-tree mode rapid-pvst
sw03(config)#spanning-tree mode rapid-pvst

2、设置端口聚合(省略了一些无用的输出)
1)sw01
sw01(config)#interface port-channel 1
sw01(config-if)#interface range f0/1-2
sw01(config-if-range)#switchport mode trunk
sw01(config-if-range)#
sw01(config-if-range)#channel-group 1 mode on
sw01(config-if-range)#
sw01(config-if-range)#exit
sw01(config)#interface port-channel 3
sw01(config-if)#interface range f0/5-6
sw01(config-if-range)#switchport mode trunk

sw01(config-if-range)#
sw01(config-if-range)#channel-group 3 mode on
sw01(config-if-range)#
sw01(config-if-range)#end
sw01#
%SYS-5-CONFIG_I: Configured from console by console

sw01#show spanning-tree 
VLAN0001
  Spanning tree enabled protocol rstp
  Root ID    Priority    32769
             Address     0002.164A.39E2
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0002.164A.39E2
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Po1              Desg FWD 9         128.27   Shr
Po3              Desg FWD 9         128.28   Shr

sw01#show etherchannel sum
sw01#show etherchannel summary 
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------

1      Po1(SU)           -      Fa0/1(P) Fa0/2(P) 
3      Po3(SU)           -      Fa0/5(P) Fa0/6(P) 
2)sw02

(忘记保存项目了,只剩之前的截图)
在这里插入图片描述

3)sw03
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname sw03
sw03(config)#spann
sw03(config)#spanning-tree mode ra
sw03(config)#spanning-tree mode rapid-pvst 
sw03(config)#
sw03(config)#interface port-channel 2
sw03(config-if)#interface range f0/3-4
sw03(config-if-range)#switchport mode trunk
sw03(config-if-range)#
sw03(config-if-range)#channel-grou
sw03(config-if-range)#channel-group 2 mode on
sw03(config-if-range)#exit
sw03(config)#interface port-channel 3
sw03(config-if)#interface range f0/5-6
sw03(config-if-range)#switchport mode trunk
sw03(config-if-range)#channel-grou
sw03(config-if-range)#channel-group 3 mode on
sw03(config-if-range)#end
sw03#show etherchannel summ
sw03#show etherchannel summary 
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port


Number of channel-groups in use: 2
Number of aggregators:           2

Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------

2      Po2(SU)           -      Fa0/3(P) Fa0/4(P) 
3      Po3(SU)           -      Fa0/5(P) Fa0/6(P) 
3、配置vlan10、vlan20、vlan30,pc的ip
1)sw01
sw01>en
sw01#conf t
sw01(config)#vlan 10
sw01(config-vlan)#interface f0/11
sw01(config-if)#switchport mode access
sw01(config-if)#switchport access vlan 10
sw01(config-if)#exit
sw01(config)#vlan 30
sw01(config-vlan)#interface f0/10	
sw01(config-if)#switchport mode access
sw01(config-if)#switchport access vlan 30
sw01(config-if)#end
sw01#
2)sw02
sw02>en
sw02#conf t
sw02(config)#vlan 10
sw02(config-vlan)#interface f0/11
sw02(config-if)#switchport mode access
sw02(config-if)#switchport access vlan 10
sw02(config-if)#exit
sw02(config)#vlan 20
sw02(config-vlan)#interface f0/10	
sw02(config-if)#switchport mode access
sw02(config-if)#switchport access vlan 20
sw02(config-if)#end
sw02#
3)sw03
sw03>en
sw03#conf t
sw03(config)#vlan 20
sw03(config-vlan)#interface f0/10
sw03(config-if)#switchport mode access
sw03(config-if)#switchport access vlan 20
sw03(config-if)#exit
sw03(config)#vlan 30
sw03(config-vlan)#interface f0/11	
sw03(config-if)#switchport mode access
sw03(config-if)#switchport access vlan 30
sw03(config-if)#end
sw03#show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/12, Fa0/13, Fa0/14
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18
                                                Fa0/19, Fa0/20, Fa0/21, Fa0/22
                                                Fa0/23, Fa0/24, Gig0/1, Gig0/2
20   VLAN0020                         active    Fa0/10
30   VLAN0030                         active    Fa0/11
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
20   enet  100020     1500  -      -      -        -    -        0      0
30   enet  100030     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        0      0   
1003 tr    101003     1500  -      -      -        -    -        0      0   

sw03#

上面都需要配置一步:
no spanning-tree vlan 10
no spanning-tree vlan 20
no spanning-tree vlan 30

4、配置流量均衡

port-channel load-balance method
源地址src-ip
目的地址 dst-ip
源和目的地址 src-dst-ip
源mac地址 src-mac
目的mac地址 dst-mac
源和目的mac src-dst-mac

所以配置SW01基于源MAC地址,SW02基于目的MAC地址:

Sw01(config)#port-channel load-balance src-mac Sw02(config)#port-channel load-balance dst-mac

5、测试截图

Vlan 10里的PC5 ping PC0
在这里插入图片描述

Vlan 10里的PC5 ping vlan 20里的PC1
在这里插入图片描述

  • 6
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值