实验二:构建局域网
(一)在Boson Network Designer中
(1)在这里选用switch-2950
(2)选用pc机两个,PC1,PC2
构建局域网,实现两个pc机的通信。
(二)然后再在Boson Netsin for CCNA中进行设置
选中estations
给pc机配置IP地址:
(2)给pc1配置IP地址
ipconfig /ip 200.0.01 255.255.255.0
ipconfig /all查看所有的IP地址
给pc2设置ip地址
ipconfig /ip 200.0.0.2 255.255.255.0
验证:局域网是否构建成功:
从pc1机上:
ping 200.0.0.2
(3)在介绍一下几种模式:
遇到不会的时请按下“?”会有提示
enable特权模式
configure terminal 全局配置模式下
interface fastethernet 0/1端口模式下
实验三:交换机vlan配置(—)
交换机S1
/ \ \
pc11 pc21 pc22
交换机Switch ,对交换机端口VLAN划分,(即划分成相互独立的逻辑分组)
VLAN划分可以让pc11和pc21,pc22不能互相访问,以确保不同部门之间的重要信息不泄露。
现在划分如下:
(1)创建vlan分组
enable进入到特权模式,
show vlan查看当前的的vlan的分组
configure terminal切换到交换机的特权模式下,才可以创建分组、
vlan 2
exit退回到特权模式下查看是否分好vlan分组
show vlan
Switch>enable
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 2
VLAN 2 added:
Name:VLAN0002
Switch(config)#exit
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
2 VLAN0002 active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
2 enet 100002 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface fastethernet 0/2
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#exit
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/11, Fa0/12
2 VLAN0002 active Gi0/-10
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
2 enet 100002 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
(2)讲pc21和pc22划分到vlan2分组中
enable切换到特权模式下
configure terminal 全局配置模式下
interface fastethernet 0/2切换到0/2端口模式下
switchport access vlan 2讲0/2端口划分到vlan 2 下。
exit
exit
show vlan
可以查看到pc21即0/2已划分到vlan 2 下
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface fastethernet 0/3
Switch(config-if)#switch access vlan 2
Switch(config-if)#exit
Switch(config)#exit
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12
2 VLAN0002 active Gi0/-10, Gi0/-9
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1 enet 100001 1500 - - - - - 0 0
2 enet 100002 1500 - - - - - 0 0
1002 fddi 101002 1500 - - - - - 0 0
1003 tr 101003 1500 - - - - - 0 0
1004 fdnet 101004 1500 - - - ieee - 0 0
1005 trnet 101005 1500 - - - ibm - 0 0
同理将pc22划分到vlan2中
enable切换到特权模式下
configure terminal 全局配置模式下
interface fastethernet 0/3切换到0/3端口模式下
switchport access vlan 2讲0/3端口划分到vlan 3 下。
exit
exit
show vlan
可以查看到pc22即0/3已划分到vlan 2 下
(3)进行通信测试,先分配ip地址
在pc11下
ipconfig /ip 172.16.1.1 255.255.255.0
pc21下
ipconfig /ip 172.16.1.2 255.255.255.0
pc22下
ipconfig /ip 172.16.1.3 255.255.255.0
pc21
C:>
C:>ipconfig /ip 172.16.1.2 255.255.0.0
测试如下:
pc11 ping 172.16.1.2 255.255.255.0
不能通信
pc11-----pc21不能通信
pc11
ping 172.16.1.2
Pinging 172.16.1.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 172.16.1.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 172.16.1.3
Pinging 172.16.1.3 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 172.16.1.3:
Packets: Sent = 5, Received = 0, Lost = 5 (100% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:>
pc21和pc22可以通信:
pc21
C:>
C:>ipconfig /ip 172.16.1.2 255.255.0.0
C:>
C:>ping 172.16.1.3
Pinging 172.16.1.3 with 32 bytes of data:
Reply from 172.16.1.3: bytes=32 time=60ms TTL=241
Reply from 172.16.1.3: bytes=32 time=60ms TTL=241
Reply from 172.16.1.3: bytes=32 time=60ms TTL=241
Reply from 172.16.1.3: bytes=32 time=60ms TTL=241
Reply from 172.16.1.3: bytes=32 time=60ms TTL=241
Ping statistics for 172.16.1.3: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 50ms, Maximum = 60ms, Average = 55ms
C:>