CCNA入门---三台交换机的VLAN实验
2010-08-01 22:04
441 查看
VLAN(Virtual Local Area Network)的中文名为"虚拟局域网"。VLAN是一种将局域网设备从逻辑上划分成一个个网段,从而实现虚拟工作组的新兴数据交换技术。这一新兴技术主要应用于交换机和路由器中,但主流应用还是在交换机之中。
实验拓扑:
PC[/b]的[/b]IP[/b]地址配置:[/b][/b]
PC-1:
PC-2:
PC-3:
PC-1-1:
PC-2-1:
PC-3-1:
测试一下连通性:
PC-1 Ping PC-3:
PC-1 Ping PC-2:
PC-3 Ping PC-1:
PC-1 Ping PC-3-1:
OK!测试成功!
下面我们配置交换机并划分VLAN,让这些PC在指定的范围内通信。
交换机的配置:[/b][/b]
SW-1:[/b]
Switch>enable ---进入特权模式
Switch#conf t ---进入全局配置模式
Switch(config)#hostname SW-1 ---给设备起名为SW-1
SW-1(config)#interface range g1/1 -2 ---进入G1/1,G1/2接口
SW-1(config-if-range)#switchport mode trunk ---接口配置为主干道
SW-1(config-if-range)#exit
SW-1(config)#vtp domain ccxx ---指定VTP域名为CCXX
Domain name already set to ccxx.
SW-1(config)#vtp password cisco ---指定VTP域的密码
Password already set to cisco
SW-1(config)#vtp mode server ---指定交换机为VTP Server模式
Device mode already VTP SERVER.
SW-2:[/b]
Switch>enable
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW-2
SW-2(config)#vtp domain ccxx ---设定VTP域名
Domain name already set to ccxx.
SW-2(config)#vtp password cisco ---设定VTP 密码
Setting device VLAN database password to cisco
SW-2(config)#vtp mode client ---指定交换机为VTP Client模式
Setting device to VTP CLIENT mode.
SW-2(config)#interface g1/1
SW-2(config-if)#switchport mode trunk
SW-2(config-if)#exit
SW-2(config)#^Z ---退出并保存
SW-3:[/b]
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW-3
SW-3(config)#vtp domain ccxx ---指定VTP域名
Domain name already set to ccxx.
SW-3(config)#vtp password cisco ---指定VTP密码
Setting device VLAN database password to cisco
SW-3(config)#vtp mode client ---指定交换机为VTP Client模式
Setting device to VTP CLIENT mode.
SW-3(config)#interface g1/1
SW-3(config-if)#switchport mode trunk
SW-3(config-if)#exit
SW-3(config)#^Z
下面我们分别show一下SW-1,SW-2,SW-3的VTP信息:
SW-1:
SW-2:
SW-3:
下面是VLAN信息:
SW-1:[/b]
下面是VLAN信息:
SW-2:[/b]
下面是VLAN信息:
SW-3:[/b]
从上面可以看出,SW-2和SW-3已经与SW-1(VTP Server)同步了VLAN信息。
下面我们开始划分[/b]VLAN[/b],然后看[/b]VTP[/b]的配置修订号变化。[/b][/b]
SW-1[/b]的配置:[/b][/b]
SW-1(config)#interface f0/1 ---进入F0/1接口
SW-1(config-if)#switchport mode access --设定接口为访问模式
SW-1(config-if)#switchport access vlan 100 ---将接口加入VLAN 100
SW-1(config-if)#exit ---退出并保存
SW-1(config)#interface f0/2
SW-1(config-if)#switchport mode access ---设定接口为访问模式
SW-1(config-if)#switchport access vlan 200 ---将接口加入VLAN 200
SW-1(config-if)#exit
SW-2[/b]的配置:[/b][/b]
SW-2(config)#interface f0/1
SW-2(config-if)#switchport mode access
SW-2(config-if)#switchport access vlan 100
SW-2(config-if)#exit
SW-2(config)#interface f0/2
SW-2(config-if)#switchport mode access
SW-2(config-if)#switchport access vlan 200
SW-2(config-if)#exit
SW-3[/b]的配置:[/b][/b]
SW-3(config)#interface f0/1
SW-3(config-if)#switchport mode access
SW-3(config-if)#switchport access vlan 100
SW-3(config-if)#exit
SW-3(config)#interface f0/2
SW-3(config-if)#switchport mode access
SW-3(config-if)#switchport access vlan 200
SW-3(config-if)#exit
好!所有交换机上的VLAN都划分完毕,测试一下看看。
OK!VLAN 200中的PC不能PING通VLAN100中的PC了。
试验完成!
本文出自 “YYJCWXF(三毛)” 博客,请务必保留此出处http://weixianfei.blog.51cto.com/950271/365157
实验拓扑:
PC[/b]的[/b]IP[/b]地址配置:[/b][/b]
PC-1:
PC-2:
PC-3:
PC-1-1:
PC-2-1:
PC-3-1:
测试一下连通性:
PC-1 Ping PC-3:
PC-1 Ping PC-2:
PC-3 Ping PC-1:
PC-1 Ping PC-3-1:
OK!测试成功!
下面我们配置交换机并划分VLAN,让这些PC在指定的范围内通信。
交换机的配置:[/b][/b]
SW-1:[/b]
Switch>enable ---进入特权模式
Switch#conf t ---进入全局配置模式
Switch(config)#hostname SW-1 ---给设备起名为SW-1
SW-1(config)#interface range g1/1 -2 ---进入G1/1,G1/2接口
SW-1(config-if-range)#switchport mode trunk ---接口配置为主干道
SW-1(config-if-range)#exit
SW-1(config)#vtp domain ccxx ---指定VTP域名为CCXX
Domain name already set to ccxx.
SW-1(config)#vtp password cisco ---指定VTP域的密码
Password already set to cisco
SW-1(config)#vtp mode server ---指定交换机为VTP Server模式
Device mode already VTP SERVER.
SW-2:[/b]
Switch>enable
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW-2
SW-2(config)#vtp domain ccxx ---设定VTP域名
Domain name already set to ccxx.
SW-2(config)#vtp password cisco ---设定VTP 密码
Setting device VLAN database password to cisco
SW-2(config)#vtp mode client ---指定交换机为VTP Client模式
Setting device to VTP CLIENT mode.
SW-2(config)#interface g1/1
SW-2(config-if)#switchport mode trunk
SW-2(config-if)#exit
SW-2(config)#^Z ---退出并保存
SW-3:[/b]
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname SW-3
SW-3(config)#vtp domain ccxx ---指定VTP域名
Domain name already set to ccxx.
SW-3(config)#vtp password cisco ---指定VTP密码
Setting device VLAN database password to cisco
SW-3(config)#vtp mode client ---指定交换机为VTP Client模式
Setting device to VTP CLIENT mode.
SW-3(config)#interface g1/1
SW-3(config-if)#switchport mode trunk
SW-3(config-if)#exit
SW-3(config)#^Z
下面我们分别show一下SW-1,SW-2,SW-3的VTP信息:
SW-1:
SW-2:
SW-3:
下面是VLAN信息:
SW-1:[/b]
下面是VLAN信息:
SW-2:[/b]
下面是VLAN信息:
SW-3:[/b]
从上面可以看出,SW-2和SW-3已经与SW-1(VTP Server)同步了VLAN信息。
下面我们开始划分[/b]VLAN[/b],然后看[/b]VTP[/b]的配置修订号变化。[/b][/b]
SW-1[/b]的配置:[/b][/b]
SW-1(config)#interface f0/1 ---进入F0/1接口
SW-1(config-if)#switchport mode access --设定接口为访问模式
SW-1(config-if)#switchport access vlan 100 ---将接口加入VLAN 100
SW-1(config-if)#exit ---退出并保存
SW-1(config)#interface f0/2
SW-1(config-if)#switchport mode access ---设定接口为访问模式
SW-1(config-if)#switchport access vlan 200 ---将接口加入VLAN 200
SW-1(config-if)#exit
SW-2[/b]的配置:[/b][/b]
SW-2(config)#interface f0/1
SW-2(config-if)#switchport mode access
SW-2(config-if)#switchport access vlan 100
SW-2(config-if)#exit
SW-2(config)#interface f0/2
SW-2(config-if)#switchport mode access
SW-2(config-if)#switchport access vlan 200
SW-2(config-if)#exit
SW-3[/b]的配置:[/b][/b]
SW-3(config)#interface f0/1
SW-3(config-if)#switchport mode access
SW-3(config-if)#switchport access vlan 100
SW-3(config-if)#exit
SW-3(config)#interface f0/2
SW-3(config-if)#switchport mode access
SW-3(config-if)#switchport access vlan 200
SW-3(config-if)#exit
好!所有交换机上的VLAN都划分完毕,测试一下看看。
OK!VLAN 200中的PC不能PING通VLAN100中的PC了。
试验完成!
本文出自 “YYJCWXF(三毛)” 博客,请务必保留此出处http://weixianfei.blog.51cto.com/950271/365157
相关文章推荐
- 交换机上VLAN的定义及划分 CiSCO之CCNA篇实验五
- CCNA之旅-交换机的基本配置-stp、vtp、vlan间通信实验
- CCNA实验:VLan间路由实验配置 (单臂路由)
- Cisco 3550交换机 Vlan间路由实验(单臂路由实现法)
- Packet Tracer 5.0实验(三) 交换机划分VLAN配置
- CCNA网络技术实验手册:交换机密码恢复
- Packet Tracer 5.0建构CCNA实验攻略(2)——配置VLAN
- 网络实验(四跨交换机的VLAN的划分)
- 实验四 相同VLAN跨交换机通信
- 87、交换机安全VLAN攻击配置实验之PVLAN
- 一步一步CCNA之五:交换机vlan配置
- [实验1]:在单个交换机上划分VLAN
- CCNA实验2.VLAN
- Packet Tracer 5.0 构建CCNA实验(3)—— 路由器实现vlan间通信
- Packet Tracer 5.0实验(三) 交换机划分VLAN配置
- 交换机VLAN 划分实验
- 实验二 跨交换机实现VLAN
- CCNA实验十七 交换机端口镜像