Presentation is loading. Please wait.

Presentation is loading. Please wait.

谢聪.

Similar presentations


Presentation on theme: "谢聪."— Presentation transcript:

1 谢聪

2 实验2.4 VLAN基础配置实验 实验背景 1 实验目的与内容 2 实验设备 3 实验步骤 4

3 实验背景 【实验背景】 VLAN即虚拟局域网,是一种将局域网设备逻辑地而不是根据物理地址划分成一个个网段的技术。VLAN技术将广播流量控制在一个VLAN内,降低广播包消耗带宽的比例。每一个VLAN都包含一组有着相同需求的计算机用户,但由于它是逻辑地而不是物理地划分,因此同一个VLAN内的各个计算机用户无需被放置在同一个物理空间里。一个VLAN内部的广播和单播流量都不会转发到其他VLAN中,从而有助于控制广播流量、简化网络管理、提高网络的安全性和组网的灵活性。划分VLAN可基于端口、协议、MAC地址等,本实验主要以基于端口的VLAN来实验。

4 实验背景 某学校有财务处、人事处等部门,为了学校资料的安全,要求两个部门都不能互相访问其他部门的计算机资料,但部门内部可以互访。在这种需求下,可以划分VLAN来实现。GARP(Generic Attribute Registration Protocol,通用属性注册协议)作为一个属性注册协议的载体,可以用来传播属性。遵循GARP的应用实体称为GARP应用,GVRP(GARP VLAN Registration Protocol,GARP VLAN注册协议)就是GARP的应用之一,用于注册和注销VLAN属性,而VTP(VLAN Trunk Protocol,虚拟局域网干道协议)是思科的私有协议,GVRP和VTP都是VLAN常用的管理技术。

5 实验目的与内容 【实验目的】 【实验内容】 (1)掌握VLAN相关命令。 (2)掌握端口的trunk应用。 (1)创建和删除VLAN。

6 实验设备 【实验设备】 交换机两台,PC四台,直通线4根,交叉线1根,网络拓扑结构如图2.7所示。

7 实验步骤 1.Vlan级联静态配置 (1)创建Vlan。首先进入第一台交换机Switch0全局模式,创建vlan 10和vlan 20,然后为所划分的vlan指定端口,命令如下: Switch(config)#vlan 10 //创建vlan 10 Switch(config-vlan)#name Vlan10 //vlan10 命名为Vlan10 Switch(config-vlan)#interface f0/1 //进入端口f0/1模式 Switch(config-if)#switchport access vlan 10 //将f0/1端口分配给vlan10 Switch(config-if)#exit //退出到全局模式 Switch(config)#vlan 20 //创建vlan 20 Switch(config-vlan)#name Vlan20 //vlan10 命名为Vlan10 Switch(config-vlan)#interface f0/2 //进入端口f0/2模式 Switch(config-if)#switchport access vlan 20 //将f0/2端口分配给vlan20

8 实验步骤 (2)设置端口的trunk属性。 通过设置交换机端口的trunk属性,可以允许跨交换机的vlan通信。默认的trunk口属于所有的vlan,传输所有的vlan数据。图2.7中相同vlan内的pc1和pc2或者pc0和pc3通信就需要设置两台交换机的Fa0/23口为trunk口以传输来自vlan的数据。配置命令为: Switch(config-if)#exit //退出子模式 Switch(config)#interface f0/24 //进入f0/24端口 Switch(config-if)#switchport mode trunk //设置f0/24为trunk模式 Switch(config-if)#no switchport trunk allowed vlan //允许所有的vlan数据帧通过.也可以单独设置某个vlan数据通过.方法为: Switch(config-if)#no switchport trunk allowed vlan 10

9 实验步骤 (3)按同样方法配置Switch1 Switch(config)#vlan 10
Switch(config-vlan)#name Vlan10 Switch(config-vlan)#interface f0/1 Switch(config-if)#switchport access vlan 10 Switch(config-if)#exit Switch(config)#vlan 20 Switch(config-vlan)#name Vlan20 Switch(config-vlan)#interface f0/2 Switch(config-if)#switchport access vlan 20 Switch(config)#interface f0/24 Switch(config-if)#switch mode trunk Switch(config-if)#no switchport trunk allowed vlan

10 实验步骤 (4)配置各台主机 单击PC的图标,在弹出的窗口中,点击”Desktop选项卡,”在”IP Configuration”里直接配置IP地址和子网掩码.设置PC0-3的IP地址在同一网段.如分别设置为 , , , ,子网掩码均为 或者在”Command Prompt”里,输入命令ipconfig ip_address net_mask

11 实验结果 (5)在Switch1上show vlan查看VLAN信息 Switch>en Switch#show vlan
VLAN Name Status Ports 1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 Fa0/11, Fa0/12, Fa0/13, Fa0/14 Fa0/15, Fa0/16, Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23 10 Vlan active Fa0/1 20 Vlan active Fa0/2 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup

12 实验结果 (6)在Switch1上show interface f0/1 switchport 查看f0/1端口信息
Name: Fa0/1 Switchport: Enabled Administrative Mode: dynamic auto Operational Mode: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: native Negotiation of Trunking: On Access Mode VLAN: 10 (Vlan10) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Appliance trust: none

13 实验结果 (7)在Switch1上show interface f0/2 switchport 查看f0/2端口信息
Name: Fa0/2 Switchport: Enabled Administrative Mode: dynamic auto Operational Mode: static access Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: native Negotiation of Trunking: On Access Mode VLAN: 20 (Vlan20) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Appliance trust: none

14 实验结果 (8)在Switch1上show interface f0/24 switchport 查看f0/24端口信息
Name: Fa0/24 Switchport: Enabled Administrative Mode: trunk Operational Mode: trunk Administrative Trunking Encapsulation: dot1q Operational Trunking Encapsulation: dot1q Negotiation of Trunking: On Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Voice VLAN: none Administrative private-vlan host-association: none Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: none Trunking VLANs Enabled: ALL Pruning VLANs Enabled: Capture Mode Disabled Capture VLANs Allowed: ALL Protected: false Appliance trust: none


Download ppt "谢聪."

Similar presentations


Ads by Google