中南财经政法大学武汉学院课程论文
图6 设备的连接
7.2、为每台PC分配TP地址
单击PC,选择Desktop中IP。选择静态(static)IP,地址分配情况如下表1所示:
表1 PC PC 0 PC 1 PC 2 PC 3 PC 4 PC 5 PC 6 IP Address 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 192.168.1.6 192.168.1.7 Subnet Mask 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 当接口为绿灯时,则表示连通,如图6所示。验证是否连通,单击任意一台PC,选择Desktop中run,执行ping命令。例如:用PC 6 ping PC 0,能够通信,如图7所示
9
中南财经政法大学武汉学院课程论文
图7 ping命令
7.3、对每台PC进行VLAN的分配
对VLAN的划分情况如表2所示 表2
设备 2950-24 Switch 0 VLAN划分情况 创建VLAN10:VLAN20; VLAN10:Fast Ethernet 0/1 VLAN20:Fast Ethernet 0/2 VLAN10:Fast Ethernet 0/3 2950-24 Switch 1 创建VLAN10:VLAN20; VLAN10:Fast Ethernet 0/1 VLAN20:Fast Ethernet 0/2 默认VLAN:Fast Ethernet 0/3 2950-24 Switch 2
默认VLAN: Fast Ethernet 0/1 7.4、配置步骤
①2950-24 Switch 0交换机
具体配置语句如下: Switch>enable
Switch#configure
10
中南财经政法大学武汉学院课程论文
Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#do show vlan
显示结果如下图8所示:
图8 do show vlan显示结果 Switch(config-vlan)#exit Switch(config)#interface f0/1
Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)# exit Switch(config)#interface f0/2
Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20 Switch(config-if)#exit Switch(config)#interface f0/3
Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)#exit Switch(config)#do show vlan 显示结果如图9所示
11
中南财经政法大学武汉学院课程论文
图 9 分配VLAN后do show vlan显示结果
②2950-24 Switch 1交换机 具体配置语句如下: Switch>enable Switch#configure
Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#exit Switch(config)#interface f0/1
Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)#exit Switch(config)#interface f0/2
Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 20
7.5、验证位于相同交换机下相同vlan 、不同vlan之间以及不同交换下的PC的通信情况
通过ping命令方式验证。任意选择一台PC,例如:PC 3在DOS提示符
12
中南财经政法大学武汉学院课程论文
C:\\>下,利用ping命令检验两台交换机下的PC之间能否通信,如图10所示,可知不能通信。在检验同一台交换机下下相同vlan之间的PC能否通信,如图11所示,可知可以正常通信。不同vlan之间的PC能否通信,如图12所示,可知不能通信。
图10 不同交换机下的PC之间不能通信
图11 相同交换机下的相同vlan之间能通信
图12 相同交换机下的不同vlan之间不能通信
13