网络实验(二构建局域网和交换机VLAN的配置)

来源:互联网 发布:js遍历数组对象的属性 编辑:程序博客网 时间:2024/05/29 18:05

实验二:构建局域网

(一)在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>enableSwitch#show vlanVLAN 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/121002 fddi-default                     active1003 token-ring-default               active1004 fddinet-default                  active1005 trnet-default                    activeVLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1    enet  100001     1500  -      -      -        -    -        0      01002 fddi  101002     1500  -      -      -        -    -        0      01003 tr    101003     1500  -      -      -        -    -        0      01004 fdnet 101004     1500  -      -      -        ieee -        0      01005 trnet 101005     1500  -      -      -        ibm  -        0      0Switch#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.Switch(config)#vlan 2VLAN 2 added:    Name:VLAN0002Switch(config)#exitSwitch#show vlanVLAN 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/122    VLAN0002                         active    1002 fddi-default                     active1003 token-ring-default               active1004 fddinet-default                  active1005 trnet-default                    activeVLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1    enet  100001     1500  -      -      -        -    -        0      02    enet  100002     1500  -      -      -        -    -        0      01002 fddi  101002     1500  -      -      -        -    -        0      01003 tr    101003     1500  -      -      -        -    -        0      01004 fdnet 101004     1500  -      -      -        ieee -        0      01005 trnet 101005     1500  -      -      -        ibm  -        0      0Switch#configure terminalEnter configuration commands, one per line.  End with CNTL/Z.Switch(config)#interface fastethernet 0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#exitSwitch(config)#exitSwitch#show vlanVLAN 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/122    VLAN0002                         active    Gi0/-101002 fddi-default                     active1003 token-ring-default               active1004 fddinet-default                  active1005 trnet-default                    activeVLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1    enet  100001     1500  -      -      -        -    -        0      02    enet  100002     1500  -      -      -        -    -        0      01002 fddi  101002     1500  -      -      -        -    -        0      01003 tr    101003     1500  -      -      -        -    -        0      01004 fdnet 101004     1500  -      -      -        ieee -        0      01005 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 terminalEnter configuration commands, one per line.  End with CNTL/Z.Switch(config)#interface fastethernet 0/3Switch(config-if)#switch access vlan 2Switch(config-if)#exitSwitch(config)#exitSwitch#show vlanVLAN 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/122    VLAN0002                         active    Gi0/-10, Gi0/-91002 fddi-default                     active1003 token-ring-default               active1004 fddinet-default                  active1005 trnet-default                    activeVLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1    enet  100001     1500  -      -      -        -    -        0      02    enet  100002     1500  -      -      -        -    -        0      01002 fddi  101002     1500  -      -      -        -    -        0      01003 tr    101003     1500  -      -      -        -    -        0      01004 fdnet 101004     1500  -      -      -        ieee -        0      01005 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

pc21C:>C:>ipconfig /ip 172.16.1.2 255.255.0.0


 

测试如下:

pc11 ping 172.16.1.2 255.255.255.0

不能通信

pc11-----pc21不能通信

pc11ping 172.16.1.2Pinging 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 =  0msC:>ping 172.16.1.3Pinging 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 =  0msC:>

pc21和pc22可以通信:

pc21C:>C:>ipconfig /ip 172.16.1.2 255.255.0.0C:>C:>ping 172.16.1.3Pinging 172.16.1.3 with 32 bytes of data:Reply from 172.16.1.3: bytes=32 time=60ms TTL=241Reply from 172.16.1.3: bytes=32 time=60ms TTL=241Reply from 172.16.1.3: bytes=32 time=60ms TTL=241Reply from 172.16.1.3: bytes=32 time=60ms TTL=241Reply from 172.16.1.3: bytes=32 time=60ms TTL=241Ping 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 =  55msC:>


 

原创粉丝点击