神州数码设备调试之跨交换机相同VLAN互访
 
 
实验目的
 
  掌握神州数码二层交换机相同vlan间通信及配置方法<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

掌握交换机接口的trunk模式和access模式
 
实验拓扑
 

 

 
实验设备
 
 DCS 二层交换机两台
实验步骤:

 

swA的配置:

switch(Config)#hostname swA                            //设置交换机名

swA(Config)#int vlan 1                                  //进入默认VLAN1

swA(Config-If-Vlan1)#ip address 192.168.1.1 255.255.255.0    //vlan中设置管理ip

swA(Config-If-Vlan1)#no shutdown                        //激活VLAN端口

wA(Config)#vlan 100                                    //创建vlan100

swA(Config-Vlan100)#name V100                         //设置vlan

swA(Config-Vlan100)#vlan 200                         

swA(Config-Vlan200)#name V200

swA(Config)#int ethernet 0/0/1-8                           //进入端口1-8

swA(Config-Port-Range)#switchport mode access             //设置端口为接入模式

swA(Config-Port-Range)#switchport access vlan 100          //把端口划进vlan100

swA(Config-Port-Range)#int ethernet 0/0/9-16

swA(Config-Port-Range)#switchport mode access

swA(Config-Port-Range)#switchport access vlan 200

swA(Config)#int ethernet 0/0/24

swA(Config-Ethernet0/0/24)#switchport mode trunk           //设置该端口为中继模式 

swA(Config-Ethernet0/0/24)#switchport trunk allowed vlan all  

        //设置该端口应许所有vlan通过

 

 

 

swA的配置:

switch(Config)#hostname swB

swB(Config)#int vlan 1

swB(Config-If-Vlan1)#ip address 192.168.1.2 255.255.255.0

swB(Config-If-Vlan1)#no shutdown

swB(Config)#vlan 100

swB(Config-Vlan100)#name V100

swB(Config-Vlan100)#vlan 200

swB(Config-Vlan200)#name V200

swB(Config)#int ethernet 0/0/1-8

swB(Config-Port-Range)#switchport mode access

swB(Config-Port-Range)#switchport access vlan 100

swB(Config-Port-Range)#int ethernet 0/0/9-16

swB(Config-Port-Range)#switchport mode access

swB(Config-Port-Range)#switchport access vlan 200

swB(Config)#int ethernet 0/0/24

swB(Config-Ethernet0/0/24)#switchport mode trunk

swB(Config-Ethernet0/0/24)#switchport trunk allowed vlan all

 

实验验证

 
交换机B ping 交换机A

swB#ping 192.168.1.1

Type ^c to abort.

Sending 5 56-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds.

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms

swB#

 
分别查看两台交换机的vlan划分情况

swB# sh vlan

VLAN Name         Type       Media     Ports

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

1    default      Static     ENET      Ethernet0/0/17      Ethernet0/0/18

                                       Ethernet0/0/19      Ethernet0/0/20

                                       Ethernet0/0/21      Ethernet0/0/22

                                       Ethernet0/0/23      Ethernet0/0/24

100  V100         Static     ENET      Ethernet0/0/1       Ethernet0/0/2

                                       Ethernet0/0/3       Ethernet0/0/4

                                       Ethernet0/0/5       Ethernet0/0/6

                                       Ethernet0/0/7       Ethernet0/0/8

200  V200         Static     ENET      Ethernet0/0/9       Ethernet0/0/10

                                       Ethernet0/0/11      Ethernet0/0/12

                                       Ethernet0/0/13      Ethernet0/0/14

                                       Ethernet0/0/15      Ethernet0/0/16

 

 

 

swA#sh vlan

VLAN Name         Type       Media     Ports

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

1    default      Static     ENET      Ethernet0/0/17      Ethernet0/0/18

                                       Ethernet0/0/19      Ethernet0/0/20

                                       Ethernet0/0/21      Ethernet0/0/22

                                       Ethernet0/0/23      Ethernet0/0/24(T)

100  V100         Static     ENET      Ethernet0/0/1       Ethernet0/0/2

                                       Ethernet0/0/3       Ethernet0/0/4

                                       Ethernet0/0/5       Ethernet0/0/6

                                       Ethernet0/0/7       Ethernet0/0/8

                                       Ethernet0/0/24(T)

200  V200         Static     ENET      Ethernet0/0/9       Ethernet0/0/10

                                       Ethernet0/0/11      Ethernet0/0/12

                                       Ethernet0/0/13      Ethernet0/0/14

                                       Ethernet0/0/15      Ethernet0/0/16

                                       Ethernet0/0/24(T)

swA#