您的当前位置:首页正文

VLAN的划分和trunk链路的配置

来源:九壹网


VLAN的划分和TRUNK链路的配置

一、 VLAN划分 1、VLAN的作用: VLAN,是英文

Virtual Local Area Network的缩写,中文名为\"虚拟局域网\", VLAN是 一种将局域网(LAN)设备从逻辑上划分成一个个网段(或者 说是更小的局域网LAN),从而实现虚拟工作组(单元)的数据交换技术。

2、实验拓扑图

3、实验步骤及命令

○1设置四台PC 的IP地址和子网掩码

○2将PC1和PC2划分在VLAN10中

第一台交换机命令: Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#exit

Switch(config)#int f0/1

Switch(config-if)#switchport access vlan 10

第二台交换机命令:

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#exit

Switch(config)#int f0/1

Switch(config-if)#switchport access vlan 10

○3将PC3和PC4划分到VLAN20中

第一台交换机命令:

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 20

Switch(config-vlan)#exit

Switch(config)#int f0/10

Switch(config-if)#switchport access vlan 20

第二台交换机命令:

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#vlan 20

Switch(config-vlan)#exit

Switch(config)#int f0/10

Switch(config-if)#switchport access vlan 20

4、检测连通性

二、Trunk链路:

1、作用:○1、 Trunk功能用于交换机与服务器之间的相联,为服务器提供独享的高带宽。

○2、Trunk功能用于交换机之间的级联,为交换机之间的数据交换提供高带宽的数据传

输能力,提高网络速度,突破网络瓶颈,进而大幅提高网络性能(主要应用)。

2、实验拓扑图

3、配置命令

○1、将f0/24接口设置成trunk模式

Switch>

Switch>enable 进入特权模式

Switch#

Switch#conf t 进入全局视图

Switch(config)#

Switch(config)#int f0/24 进入f0/24接口

Switch(config-if)#switchport mode trunk 设置成trunk模式

Switch(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up

○2、添加VLAN

Switch(config-if)#switchport trunk allowed vlan all 配置端口f0/24加入所有VLAN

3、用同样的方法设置第二个交换机 ○

3、检测连通性

VLAN10ping通

VLAN20 ping通

因篇幅问题不能全部显示,请点此查看更多更全内容

Top