虚拟局域网VLAN配置实验 200705161179315050671.jpg (38.89 KB) 2007-5-20 00:13SW1配置:SW1#vlan databaseSW1(vlan)#vlan 10VLAN 10 added: Name: VLAN0010SW1(vlan)#vlan 20VLAN 20 added: Name: VLAN0020SW1(vlan)#vlan 30VLAN 30 added: Name: VLAN0030SW1(vlan)#exitAPPLY completed.Exiting....SW1#vlan databaseSW1(vlan)#vtp serverDevice mode already VTP SERVER.SW1(vlan)#vtp domain zhenChanging VTP domain name from NULL to zhenSW1(vlan)#vtp password ciscoSetting device VLAN database password to cisco.SW1(vlan)#exitAPPLY completed.Exiting....SW1#show vtp statusVTP Version : 2Configuration Revision : 1Maximum VLANs supported locally : 256Number of existing VLANs : 8VTP Operating Mode : ServerVTP Domain Name : zhenVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0x08 0xB4 0x36 0x38 0xE0 0x28 0x51 0x65 Configuration last modified by 0.0.0.0 at 3-1-02 00:03:05Local updater ID is 0.0.0.0 (no valid interface found)SW1#conf tEnter configuration commands, one per line. End with CNTL/Z.SW1(config)#int f0/1SW1(config-if)#switchport mode trunkSW1(config-if)#switchport trunk encapsulation dot1qSW1(config-if)#int f0/2SW1(config-if)#switchport mode accessSW1(config-if)#switchport access vlan 10SW1(config-if)#endSW1#show int f0/1 switchportName: Fa0/1Switchport: EnabledAdministrative Mode: trunkOperational Mode: trunkAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: DisabledAccess Mode VLAN: 0 ((Inactive))Trunking Native Mode VLAN: 1 (default)Trunking VLANs Enabled: ALLTrunking VLANs Active: 1,10,20,30Priority for untagged frames: 0Override vlan tag priority: FALSEVoice VLAN: none Appliance trust: noneSW2配置: 以下内容需要回复才能看到SW2#vlan databaseSW2(vlan)#vtp clientSetting device to VTP CLIENT mode.SW2(vlan)#vtp domain zhenChanging VTP domain name from NULL to zhenSW2(vlan)#vtp password ciscoSetting device VLAN database password to cisco.SW2(vlan)#exitIn CLIENT state, no apply attempted.Exiting....SW2#show vtp statusVTP Version : 2Configuration Revision : 0Maximum VLANs supported locally : 256Number of existing VLANs : 5VTP Operating Mode : ClientVTP Domain Name : zhenVTP Pruning Mode : DisabledVTP V2 Mode : DisabledVTP Traps Generation : DisabledMD5 digest : 0xD1 0x4D 0x99 0xC4 0x39 0x0F 0x22 0x2F Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00SW2#conf tEnter configuration commands, one per line. End with CNTL/Z.SW2(config)#int f0/1SW2(config-if)#switchport mode trunkSW2(config-if)#switchport trunk encapsulation dot1qSW2(config-if)#enSW2#show vlan-swVLAN Name Status Ports---- -------------------------------- --------- -------------------------------1 default active Fa0/0, Fa0/2, 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/1510 VLAN0010 active 20 VLAN0020 active 30 VLAN0030 active 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active SW2#conf tEnter configuration commands, one per line. End with CNTL/Z.SW2(config)#int f0/2SW2(config-if)#switchport mode accessSW2(config-if)#switchport access vlan 10SW2(config-if)#end客户机配置:PC1:IP:192.168.1.1/24PC2:IP:192.168.1.2/24测试连通性:PC1#ping 192.168.1.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 44/76/144 ms

评论