实验一:跨交换机实现VLAN
一、实验环境:Windows7操作系统的计算机;
Boson Netsim for CCNA v6.0
二、实验步骤;
pc1接到sw1的PA0/1,pc2接到sw1的PA0/2,pc3接到sw2的PA0/1,pc4接到sw2的PA0/2;sw1的PA0/12接到sw2的PA0/12作为主干道,配置如下:
(1) switch1的配置
Switch>enable
Switch#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname switch1
switch1(config)#vlan 10
VLAN 10 added:
Name:VLAN0010
switch1(config)#interface fa 0/1
switch1(config-if)#switchport access vlan 10
switch1(config-if)#exit
switch1(config)#vlan 20
VLAN 20 added:
Name:VLAN0020
switch1(config)#inter fa 0/2
switch1(config-if)#switchport access vlan 20
switch1(config-if)#exit
switch1(config)#interface fa 0/12
switch1config-if)#switchport mode trunk
switch1(config-if)#end
(2) switch2的配置
Switch>enable
Switch#conf term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname switch2
switch2config)#vlan 10
VLAN 10 added:
Name:VLAN0010
switch2(config)#interface fa 0/1
switch2config-if)#switchport access vlan 10
switch2(config-if)#exit
switch2(config)#vlan 20
VLAN 20 added:
Name:VLAN0020
switch2(config)#interface fa 0/2
switch2(config-if)#switchport access vlan 20
switch2(config-if)#exit
switch2(config)#interface fa 0/12
switch2(config-if)#switch mode trunk
switch2(config-if)#end
(3) 配置PC机的IP地址与网关
C:>win
PC1:192.168.100.1 255.255.255.0 GATEWAY 192.168.1.1
PC2:192.168.100.2 255.255.255.0 GATEWAY 192.168.1.1
PC3:192.168.100.3 255.255.255.0 GATEWAY 192.168.1.1
PC4:192.168.100.4 255.255.255.0 GATEWAY 192.168.1.1
三、最终配置列表:
switch1 switch2 PC1 PC2 PC3 PC4 子端口Vlan0010Vlan0010
子端口Vlan0020Vlan0020
主端口
Ethernet
ip
192.168.
100.1 192.168.
100.2
192.168.
100.3
192.168.
100.4
子网掩码
255.255.
255.0 255.255.
255.0
255.255.
255.0
255.255.
255.0
默认网关
192.168.
1.1 19
2.168.
1.1
192.168.
1.1
192.168.
1.1
四、结果分析:
在PC1上PING:
C:>ping 192.168.100.2
Pinging 192.168.100.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.100.2:
Packets: Sent = 5, Received = 0, Lost = 5 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:>ping 192.168.100.3
Pinging 192.168.100.3 with 32 bytes of data:
Reply from 192.168.100.3: bytes=32 time=60ms TTL=241
Reply from 192.168.100.3: bytes=32 time=60ms TTL=241
Reply from 192.168.100.3: bytes=32 time=60ms TTL=241
Reply from 192.168.100.3: bytes=32 time=60ms TTL=241
Reply from 192.168.100.3: bytes=32 time=60ms TTL=241
Ping statistics for 192.168.100.3: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 50ms, Maximum = 60ms, Average = 55ms
C:>ping 192.168.100.4
Pinging 192.168.100.4 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.100.4:
Packets: Sent = 5, Received = 0, Lost = 5 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
五、实验拓扑截图:
六、心得体会:
通过本次实验,掌握了交换机的配置过程,并顺利完成了跨交换机实现vlan的目标,但在实验过程中还是对命令不熟悉,有时会出错,今后要加强这方面的训练。