09
2010
11

配置STP

实验环境

   按下图连接网络,链路均为100M链路,其中交换机设备都为默认配置.

实验描述

   要求配置VLAN2和VLAN3,并实现SW1成为VLAN1的根网桥,SW2成为VLAN2的根网桥,SW3成为VLAN3的根网桥

具体配置

  

SW1上的配置

Router>en   进入特权模式

Router#conf t   进入全局模式

Router(config)#ho sw1   更改设备名称

sw1(config)#no ip do lo   关闭域名解析

sw1(config)#lin 0   进入控制台

sw1(config-line)#no exec-t   关闭超时

sw1(config-line)#logg s   关闭日志同步

sw1(config-line)#int ran f0/14 -15    进入F0/14F0/15接口

sw1(config-if-range)#sw mode trun   配置成中继链路

sw1(config-if-range)#end   返回特权模式

sw1#vlan da   进入VLAN配置模式

sw1(vlan)#vtp domain feiniao   配置VTP域名

Changing VTP domain name from NULL to feiniao

sw1(vlan)#vlan 2   添加VLAN2

VLAN 2 added:

    Name: VLAN0002

sw1(vlan)#vlan 3   添加VLAN3

VLAN 3 added:

    Name: VLAN0003

sw1(vlan)#exit    保存并退出

APPLY completed.

Exiting....

sw1#conf t    进入全局模式

sw1(config)#spanning-tree vlan 1 pri 4096   配置VLAN优先级

sw1(config)#end  返回特权模式

 

SW2上的配置

Router>en   进入特权模式

Router#conf t   进入全局模式

Router(config)#ho sw2   更改设备名称

s sw2(config)#no ip do lo   关闭域名解析

w2(config)#lin 0   进入控制台

sw2(config-line)#no exec-t  关闭超时

sw2(config-line)#logg s   关闭日志同步

sw2(config-line)#int ran f0/14 -15   进入f0/14F0/15

sw2(config-if-range)#sw mode trun   配置成中继链路

sw2(config-if-range)#end    返回特权模式

sw2#show vlan-s b   查看VLAN信息

 

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Fa0/0, Fa0/1, Fa0/2, Fa0/3

                                                Fa0/4, Fa0/5, Fa0/6, Fa0/7

                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11

                                                Fa0/12, Fa0/13

2    VLAN0002                         active   

3    VLAN0003                         active   

1002 fddi-default                     active   

1003 token-ring-default               active   

1004 fddinet-default                  active   

1005 trnet-default                    active   

sw2#conf t   进入全局模式

sw2(config)#spanning-tree vlan 2 pri 4096   配置VLAN优先级

sw2(config)#end   返回特权模式

 

SW3上的配置

Router>en   进入特权模式

Router#conf t   进入全局模式

Router(config)#ho sw3  更改设备名称

sw3(config)#no ip do lo   关闭域名解析

sw3(config)#lin 0   进入控制台

sw3(config-line)#no exec-t   关闭超时

sw3(config-line)#logg s   关闭日志同步

sw3(config-line)#int ran f0/14 -15   进入f0/14f0/15

sw3(config-if-range)#sw mode trun   配置成中继链路

sw3(config-if-range)#end  返回特权模式

sw3#show vlan-s b   查看VLAN信息

 

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Fa0/0, Fa0/1, Fa0/2, Fa0/3

                                                Fa0/4, Fa0/5, Fa0/6, Fa0/7

                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11

                                                Fa0/12, Fa0/13

2    VLAN0002                         active   

3    VLAN0003                         active   

1002 fddi-default                     active   

1003 token-ring-default               active   

1004 fddinet-default                  active   

1005 trnet-default                    active   

sw3#conf t   进入全局模式

sw3(config)#spanning-tree vlan 3 pri 4096   配置VLAN优先级

sw3(config)#end  返回特权模式

 

验证配置

sw1#show spanning-tree brief   查看生成树信息

VLAN1

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0ff8.0000

             This bridge is the root

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    4096

             Address     cc00.0ff8.0000

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 FWD     0  4096 cc00.0ff8.0000 128.15

FastEthernet0/15     128.16   128    19 FWD     0  4096 cc00.0ff8.0000 128.16

 

         

VLAN2

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0fd0.0001

             Cost        19

             Port        16 (FastEthernet0/15)

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    32768

             Address     cc00.0ff8.0001

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 BLK    19 32768 cc00.0fc0.0001 128.16

FastEthernet0/15     128.16   128    19 LRN     0  4096 cc00.0fd0.0001 128.16

 

         

VLAN3

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0fc0.0002

             Cost        19

             Port        15 (FastEthernet0/14)

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    32768

             Address     cc00.0ff8.0002

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 FWD     0  4096 cc00.0fc0.0002 128.16

FastEthernet0/15     128.16   128    19 BLK    19 32768 cc00.0fd0.0002 128.16

 

sw1#

 

sw2#show spanning-tree brief      查看生成树信息

 

VLAN1

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0ff8.0000

             Cost        19

             Port        16 (FastEthernet0/15)

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    32768

             Address     cc00.0fd0.0000

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 BLK    19 32768 cc00.0fc0.0000 128.15

FastEthernet0/15     128.16   128    19 FWD     0  4096 cc00.0ff8.0000 128.16

 

          

VLAN2    

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0fd0.0001

             This bridge is the root

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    4096

             Address     cc00.0fd0.0001

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 FWD     0  4096 cc00.0fd0.0001 128.15

FastEthernet0/15     128.16   128    19 FWD     0  4096 cc00.0fd0.0001 128.16

 

         

VLAN3

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0fc0.0002

             Cost        19

             Port        15 (FastEthernet0/14)

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    32768

             Address     cc00.0fd0.0002

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 FWD     0  4096 cc00.0fc0.0002 128.15

FastEthernet0/15     128.16   128    19 FWD    19 32768 cc00.0fd0.0002 128.16

 

sw2#

 

sw3#show spanning-tree brief       查看生成树信息

 

VLAN1

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0ff8.0000

             Cost        19

             Port        16 (FastEthernet0/15)

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    32768

             Address     cc00.0fc0.0000

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 FWD    19 32768 cc00.0fc0.0000 128.15

FastEthernet0/15     128.16   128    19 FWD     0  4096 cc00.0ff8.0000 128.15

 

         

VLAN2

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0fd0.0001

             Cost        19

             Port        15 (FastEthernet0/14)

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    32768

             Address     cc00.0fc0.0001

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 FWD     0  4096 cc00.0fd0.0001 128.15

FastEthernet0/15     128.16   128    19 FWD    19 32768 cc00.0fc0.0001 128.16

 

         

VLAN3

  Spanning tree enabled protocol ieee

  Root ID    Priority    4096

             Address     cc00.0fc0.0002

             This bridge is the root

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

 

  Bridge ID  Priority    4096

             Address     cc00.0fc0.0002

             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

             Aging Time 300

 

Interface                                   Designated

Name                 Port ID Prio Cost  Sts Cost  Bridge ID            Port ID

-------------------- ------- ---- ----- --- ----- -------------------- -------

FastEthernet0/14     128.15   128    19 FWD     0  4096 cc00.0fc0.0002 128.15

FastEthernet0/15     128.16   128    19 FWD     0  4096 cc00.0fc0.0002 128.16

 

sw3#

« 上一篇下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。