实验拓朴:
 
 
 
实验目标:
 

目标1.  按照实验要求连接拓扑
目标2.  配置VTP域:SWITCH1、SWITCH2为VTP SERVER并开启VLTP修剪;SWITCH3、SWITCH4为VTP CLIENT;并在SERVER上创建VLAN2、3、4     
目标3.  将SWITCH1配置为VLAN1、VLAN3的根桥,VLAN2、VLAN4的次根桥
              将SWITCH2配置为VLAN2、VLAN4的根桥,VLAN1、VLAN3的次根桥
目标4.  在VTP CLIENT上将接口配置进正确的VLAN
目标5.  配置SWITCH1和SWITCH2之间的以太网通道
目标6.  在SWITCH1、SWITCH2、ROUTER1上配置RIP路由协议
目标7.   测试网络联通性:VLAN内PC连通性;VLAN间PC连通性;VLAN内PC与INTERNET连通性
 
实验步骤:
 
 
目标1:
 
1.搭环境.
 
Router1 E0/0  <---->     Switch1 F0/0
Router1 E0/1  <---->     Switch2 F0/0
Switch1 F0/14  <---->  Switch2 F0/14
Switch1 F0/15  <---->  Switch2 F0/15
Switch1 F0/1  <---->    Switch3 F0/1
Switch1 F0/2  <---->    Switch4 F0/1
Switch1 F0/3  <---->    Switch5 F0/1
Switch2 F0/1  <---->    Switch3 F0/2
Switch2 F0/2  <---->    Switch4 F0/2
Switch2 F0/3  <---->    Switch5 F0/2
Switch3 F0/14   <---->  VPCS V0/1
Switch3 F0/15  <---->  VPCS V0/2
Switch4 F0/14  <---->  VPCS V0/3
Switch4 F0/15  <---->  VPCS V0/4
Switch5 F0/14  <---->  VPCS V0/5
Switch5 F0/15   <---->  VPCS V0/6
 
2.R1相关配置:
 
 R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface e0/0
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config)#interface e0/1
R1(config-if)#ip add 10.1.2.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#
 
R1#show ip in br
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                10.1.1.1        YES manual up                    up     
Ethernet0/1                10.1.2.1        YES manual up                    up     
Ethernet0/2                unassigned      YES unset  administratively down down   
Ethernet0/3                unassigned      YES unset  administratively down down   
Loopback0                 202.16.2.1      YES manual up                    up 
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C    202.16.2.0/24 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 2 subnets
C       10.1.2.0 is directly connected, Ethernet0/1
C       10.1.1.0 is directly connected, Ethernet0/0
 
目标2:
配置VTP域:SWITCH1、SWITCH2为VTP SERVER并开启VLTP修   剪;SWITCH3、SWITCH4,5为VTP CLIENT;并在SERVER上创建VLAN2、 3、4
 
 
1.sw1-3(config)#interface ra                           (trunk)
sw1-3(config)#interface range f0/0 - 3
sw1-3(config-if-range)#switchport mode trunk
sw1-3(config-if-range)#no sh
sw1-3(config-if-range)#exit
sw1-3(config)#interface range f0/14 - 15
sw1-3(config-if-range)#switchport mode trunk
sw1-3(config-if-range)#no sh
 
2.sw1-3#show interfaces switchp                        (test trunk)
Name: Fa0/0
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
Name: Fa0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
Name: Fa0/2
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
Name: Fa0/3
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
Name: Fa0/14
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
Name: Fa0/15
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
 
3. SW2-3上面配置TRUNK 和SW1-3 同样的过程。(详细过程略)
 
4.sw3(config)#interface ra f0/1 -2                              (TRUNK)
sw3(config-if-range)#switchport mode trunk
sw3(config-if-range)#no sh
sw3#show interfaces switchport
Name: Fa0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
Name: Fa0/2
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: ALL
Trunking VLANs Active: 1
Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Applianc
 
5. sw4(config)#interface range f0/1 -2
sw4(config-if-range)#switchport mode trunk
sw4(config-if-range)#no sh
sw4(config-if-range)#exit
sw4(config)#exit
sw5(config)#interface range f0/1 -2
sw5(config-if-range)#switchport mode trunk  
sw5(config-if-range)#no sh
 
 
6. sw1-3# vl da                                    (start vtp)
sw1-3(vlan)#vtp domain test
Changing VTP domain name from NULL to test
sw1-3(vlan)#vtp server
Device mode already VTP SERVER.
sw1-3(vlan)#vtp password 111111
Setting device VLAN database password to 111111.
sw1-3(vlan)#vtp v2-mode
V2 mode enabled.
sw1-3(vlan)#vtp pruning
Pruning switched ON
sw1-3(vlan)#exit
APPLY completed.
Exiting....
 
sw1-3#show vtp status
VTP Version                     : 2
Configuration Revision          : 1
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Server
VTP Domain Name                 : test
VTP Pruning Mode                : Enabled
VTP V2 Mode                     : Enabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xEE 0x18 0x41 0xD1 0x2B 0xFB 0x4F 0x52
Configuration last modified by 0.0.0.0 at 3-1-02 00:49:43
Local updater ID is 0.0.0.0 (no valid interface found)
sw1-3#
 
7.  sw2-3#vl da                                   (start vtp)
sw2-3(vlan)#vtp domain test
Changing VTP domain name from test\ to test
sw2-3(vlan)#vtp server
Device mode already VTP SERVER.
sw2-3(vlan)#vtp password 111111
Setting device VLAN database password to 111111.
sw2-3(vlan)#vtp v2-mode
V2 mode enabled.
sw2-3(vlan)#vtp pruning
Pruning switched ON
sw2-3(vlan)#exit
APPLY completed.
Exiting....
 
sw2-3#show vtp status
VTP Version                     : 2
Configuration Revision          : 1
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Server
VTP Domain Name                 : test
VTP Pruning Mode                : Enabled
VTP V2 Mode                     : Enabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x7A 0x2A 0x67 0xAE 0x1E 0xBE 0x30 0x0E
Configuration last modified by 0.0.0.0 at 3-1-02 00:52:44
Local updater ID is 0.0.0.0 (no valid interface found)
sw2-3#
 
8. sw3#vl da                                        (start vtp client)
sw3(vlan)#vtp domain test
Domain name already set to test .
sw3(vlan)#vtp client
Setting device to VTP CLIENT mode.
sw3(vlan)#vtp password 111111
Setting device VLAN database password to 111111.
sw3(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
 
sw3#show vtp st
sw3#show vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Client
VTP Domain Name                 : test
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x05 0xFC 0x00 0x59 0x49 0xAF 0x1D 0xE2
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
 
sw4#vl da                                         (start vtp client)
sw4(vlan)#vtp domain test
Domain name already set to test .
sw4(vlan)#vtp client
Setting device to VTP CLIENT mode.
sw4(vlan)#vtp password 111111
Setting device VLAN database password to 111111.
sw4(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
 
 sw4#show vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Client
VTP Domain Name                 : test
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x05 0xFC 0x00 0x59 0x49 0xAF 0x1D 0xE2
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
sw4#
 
sw5#vl da                                              (start vtp client)
sw5(vlan)#vtp domain test
Domain name already set to test .
sw5(vlan)#vtp client
Setting device to VTP CLIENT mode.
sw5(vlan)#vtp password 111111
Setting device VLAN database password to 111111.
sw5(vlan)#exit
In CLIENT state, no apply attempted.
Exiting....
 
sw5#show vtp status
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 256
Number of existing VLANs        : 5
VTP Operating Mode              : Client
VTP Domain Name                 : test
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x05 0xFC 0x00 0x59 0x49 0xAF 0x1D 0xE2
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
sw5#
 
9. sw1-3#vl da                                 (create vlan 2,3,4.)
sw1-3(vlan)#vlan 2 name v2
VLAN 2 added:                   
    Name: v2
sw1-3(vlan)#apply
APPLY completed.
sw1-3(vlan)#vlan 3 name v3
VLAN 3 added:
    Name: v3
sw1-3(vlan)#apply
APPLY completed.
sw1-3(vlan)#vlan 4 name v4
VLAN 4 added:
    Name: v4
sw1-3(vlan)#apply
APPLY completed.
sw1-3(vlan)#exit
APPLY completed.
Exiting....
 
sw1-3#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/4, Fa0/5, Fa0/6, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                                Fa0/12, Fa0/13
2    v2                               active   
3    v3                               active   
4    v4                               active   
1002 fddi-default                     active   
1003 trcrf-default                    active   
1004 fddinet-default                  active   
1005 trbrf-default                    active   

10.client test
sw2-3#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/4, Fa0/5, Fa0/6, Fa0/7
                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11
                                                Fa0/12, Fa0/13
2    v2                               active   
3    v3                               active   
4    v4                               active   
1002 fddi-default                     active   
1003 trcrf-default                    active   
1004 fddinet-default                  active   
1005 trbrf-default                    active
sw3#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15
2    v2                               active   
3    v3                               active   
4    v4                               active   
1002 fddi-default                     active   
1003 trcrf-default                    active   
1004 fddinet-default                  active   
1005 trbrf-default                    active   
 
sw4#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15
2    v2                               active   
3    v3                               active   
4    v4                               active   
sw5#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15
2    v2                               active   
3    v3                               active   
4    v4                               active   
 
 
标3:
将SWITCH1配置为VLAN1、VLAN3的根桥,VLAN2、VLAN4的次根桥
将SWITCH2配置为VLAN2、VLAN4的根桥,VLAN1、VLAN3的次根桥
1. sw1-3#conf t                                  (config stp)
sw1-3(config)#spanning-tree vlan 1 root primary
% This switch is already the root of VLAN1 spanning tree
 VLAN 1 bridge priority set to 8192
 VLAN 1 bridge max aging time unchanged at 20
 VLAN 1 bridge hello time unchanged at 2
 VLAN 1 bridge forward delay unchanged at 15
sw1-3(config)#spanning-tree vlan 3 root primary
% This switch is already the root of VLAN3 spanning tree
 VLAN 3 bridge priority set to 8192
 VLAN 3 bridge max aging time unchanged at 20
 VLAN 3 bridge hello time unchanged at 2
 VLAN 3 bridge forward delay unchanged at 15    
sw1-3(config)#spanning-tree vlan 2 root secondary
 VLAN 2 bridge priority set to 16384
 VLAN 2 bridge max aging time unchanged at 20
 VLAN 2 bridge hello time unchanged at 2
 VLAN 2 bridge forward delay unchanged at 15
sw1-3(config)#spanning-tree vlan 4 root secondary
 VLAN 4 bridge priority set to 16384
 VLAN 4 bridge max aging time unchanged at 20
 VLAN 4 bridge hello time unchanged at 2
 VLAN 4 bridge forward delay unchanged at 15
.
sw1-3#show spanning-tree br
 
VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.00f8.0000
             This bridge is the root
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    8192
             Address     cc00.00f8.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/0      128.1    128    19 FWD     0  8192 cc00.00f8.0000 128.1 
FastEthernet0/1      128.2    128    19 FWD     0  8192 cc00.00f8.0000 128.2 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.00f8.0000 128.3 
FastEthernet0/3      128.4    128    19 FWD     0  8192 cc00.00f8.0000 128.4 
FastEthernet0/14     128.15   128    19 FWD     0  8192 cc00.00f8.0000 128.15
FastEthernet0/15     128.16   128    19 FWD     0  8192 cc00.00f8.0000 128.16
 --More—
 
2. sw2-3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
sw2-3(config)#spanning-tree vlan 2 root primary
 VLAN 2 bridge priority set to 8192
 VLAN 2 bridge max aging time unchanged at 20
 VLAN 2 bridge hello time unchanged at 2
 VLAN 2 bridge forward delay unchanged at 15
sw2-3(config)#spanning-tree vlan 4 root primary
 VLAN 4 bridge priority set to 8192
 VLAN 4 bridge max aging time unchanged at 20
 VLAN 4 bridge hello time unchanged at 2
 VLAN 4 bridge forward delay unchanged at 15 
sw2-3(config)#spanning-tree vlan 1 root secondary
 VLAN 1 bridge priority set to 16384
 VLAN 1 bridge max aging time unchanged at 20
 VLAN 1 bridge hello time unchanged at 2
 VLAN 1 bridge forward delay unchanged at 15
sw2-3(config)#spanning-tree vlan 3 root secondary
 VLAN 3 bridge priority set to 16384
 VLAN 3 bridge max aging time unchanged at 20
 VLAN 3 bridge hello time unchanged at 2
 VLAN 3 bridge forward delay unchanged at 15
 
3.  w4#show spanning-tree br                             (test stp )
 
VLAN1
  Spanning   enabled protocol ieee
  Root ID    Priority    81 92
             Address     cc00.00f8.0000
             Cost        19
             Port        2 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32768
             Address     cc00.058c.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/1      128.2    128    19 FWD     0  8192 cc00.00f8.0000 128.3 
FastEthernet0/2      128.3    128    19 BLK    19 16384 cc00.088c.0000 128.3 
FastEthernet0/14     128.15   128    19 FWD    19 32768 cc00.058c.0000 128.15
FastEthernet0/15     128.16   128    19 FWD    19 32768 cc00.058c.0000 128.16
         
VLAN2    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.088c.0001
             Cost        19
             Port        3 (FastEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.058c.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/1      128.2    128    19 BLK    19 16384 cc00.00f8.0001 128.3 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.088c.0001 128.3 
         
         
VLAN3    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.00f8.0002
             Cost        19
             Port        2 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.058c.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/1      128.2    128    19 FWD     0  8192 cc00.00f8.0002 128.3 
FastEthernet0/2      128.3    128    19 BLK    19 16384 cc00.088c.0002 128.3 
         
         
VLAN4    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.088c.0003
             Cost        19
             Port        3 (FastEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.058c.0003
             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/1      128.2    128    19 BLK    19 16384 cc00.00f8.0003 128.3 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.088c.0003 128.3 
 
目标4:
在VTP CLIENT上将接口配置进正确的VLAN
 
1. sw3#conf t                          (划接口进不同的VALN)
Enter configuration commands, one per line.  End with CNTL/Z.
sw3(config)#interface f0/14
sw3(config-if)#switchport access vlan 2
sw3(config-if)#switchport mode access
sw3(config-if)#no sh
sw3(config-if)#exit
sw3(config)#interface f0/15
sw3(config-if)#switchport access vlan 3
sw3(config-if)#switchport mode access
sw3(config-if)#no sh
sw3(config-if)#exit
sw3(config)#exit
 
sw3#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
2    v2                               active    Fa0/14
3    v3                               active    Fa0/15
4    v4                               active   
1002 fddi-default                     active   
1003 trcrf-default                    active   
1004 fddinet-default                  active   
1005 trbrf-default                    active   
 
sw3#show spanning-tree br
 
VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.00f8.0000
             Cost        19
             Port        2 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32768
             Address     cc00.0f1c.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/1      128.2    128    19 FWD     0  8192 cc00.00f8.0000 128.2 
FastEthernet0/2      128.3    128    19 BLK    19 16384 cc00.088c.0000 128.2 
         
VLAN2    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.088c.0001
             Cost        19
             Port        3 (FastEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.0f1c.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/1      128.2    128    19 BLK    19 16384 cc00.00f8.0001 128.2 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.088c.0001 128.2 
FastEthernet0/14     128.15   128    19 FWD    19 32768 cc00.0f1c.0001 128.15
         
         
VLAN3    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.00f8.0002
             Cost        19
             Port        2 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.0f1c.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/1      128.2    128    19 FWD     0  8192 cc00.00f8.0002 128.2 
FastEthernet0/2      128.3    128    19 BLK    19 16384 cc00.088c.0002 128.2 
FastEthernet0/15     128.16   128    19 FWD    19 32768 cc00.0f1c.0002 128.16
         
         
VLAN4    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.088c.0003
             Cost        19
             Port        3 (FastEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.0f1c.0003
             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/1      128.2    128    19 BLK    19 16384 cc00.00f8.0003 128.2 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.088c.0003 128.2 
         
 
2. sw4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
sw4(config)#interface f0/14
sw4(config-if)#switchport access vlan 3
sw4(config-if)#switchport mode access
sw4(config-if)#no sh
sw4(config-if)#exit
sw4(config)#interface f0/15
sw4(config-if)#switchport access vlan 4
sw4(config-if)#switchport mode access
sw4(config-if)#no sh
sw4(config-if)#exit
sw4(config)#exit
 
sw4#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
2    v2                               active   
3    v3                               active    Fa0/14
4    v4                               active    Fa0/15
1002 fddi-default                     active   
1003 trcrf-default                    active   
1004 fddinet-default                  active   
1005 trbrf-default                    active   

 sw4#show spanning-tree br
 
VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.00f8.0000
             Cost        19
             Port        2 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32768
             Address     cc00.058c.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/1      128.2    128    19 FWD     0  8192 cc00.00f8.0000 128.3 
FastEthernet0/2      128.3    128    19 BLK    19 16384 cc00.088c.0000 128.3 
         
VLAN2    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.088c.0001
             Cost        19
             Port        3 (FastEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.058c.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/1      128.2    128    19 BLK    19 16384 cc00.00f8.0001 128.3 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.088c.0001 128.3 
         
         
VLAN3    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.00f8.0002
             Cost        19
             Port        2 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.058c.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/1      128.2    128    19 FWD     0  8192 cc00.00f8.0002 128.3 
FastEthernet0/2      128.3    128    19 BLK    19 16384 cc00.088c.0002 128.3 
FastEthernet0/14     128.15   128    19 FWD    19 32768 cc00.058c.0002 128.15
         
         
VLAN4    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.088c.0003
             Cost        19
             Port        3 (FastEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.058c.0003
             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/1      128.2    128    19 BLK    19 16384 cc00.00f8.0003 128.3 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.088c.0003 128.3 
FastEthernet0/15     128.16   128    19 FWD    19 32768 cc00.058c.0003 128.16
           
3.sw5#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
sw5(config)#interface f0/14c
sw5(config-if)#switchport access vlan 4
sw5(config-if)#switchport mode access
sw5(config-if)#no sh
sw5(config-if)#exit
sw5(config)#interface f0/15
sw5(config-if)#switchport access vlan 2
sw5(config-if)#switchport mode access
sw5(config-if)#no sh
sw5(config-if)#exit
sw5(config)#exit
sw5#show vlan-switch
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/0, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
2    v2                               active    Fa0/15
3    v3                               active   
4    v4                               active    Fa0/14
1002 fddi-default                     active   
1003 trcrf-default                    active   
1004 fddinet-default                  active   
1005 trbrf-default                    active   
 
sw5#show spanning-tree br
 
VLAN1
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.00f8.0000
             Cost        19
             Port        2 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
  Bridge ID  Priority    32768
             Address     cc00.07dc.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/1      128.2    128    19 FWD     0  8192 cc00.00f8.0000 128.4 
FastEthernet0/2      128.3    128    19 BLK    19 16384 cc00.088c.0000 128.4 
         
VLAN2    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.088c.0001
             Cost        19
             Port        3 (FastEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.07dc.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/1      128.2    128    19 BLK    19 16384 cc00.00f8.0001 128.4 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.088c.0001 128.4 
FastEthernet0/15     128.16   128    19 FWD    19 32768 cc00.07dc.0001 128.16
         
         
VLAN3    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.00f8.0002
             Cost        19
             Port        2 (FastEthernet0/1)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.07dc.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/1      128.2    128    19 FWD     0  8192 cc00.00f8.0002 128.4 
FastEthernet0/2      128.3    128    19 BLK    19 16384 cc00.088c.0002 128.4 
         
         
VLAN4    
  Spanning tree enabled protocol ieee
  Root ID    Priority    8192
             Address     cc00.088c.0003
             Cost        19
             Port        3 (FastEthernet0/2)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
         
  Bridge ID  Priority    32768
             Address     cc00.07dc.0003
             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/1      128.2    128    19 BLK    19 16384 cc00.00f8.0003 128.4 
FastEthernet0/2      128.3    128    19 FWD     0  8192 cc00.088c.0003 128.4 
FastEthernet0/14     128.15   128    19 FWD    19 32768 cc00.07dc.0003 128.15
         
  
分析很明显,VLAN 这次的显示和第一次的有些不同,接口划分到VLAN 中后,它们的端口所属也在发生变化,但是,不变的是,它们一直都是处于转发状态。
 
4.测试相同VLAN中的主机是否能够通信.
 
 
 
 
分析:
由此可见,相同VLAN 不同交换机的VALN是可以PING 通的了。不 同VALN 之间目前还是不能PING 通。