频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

交换机VLAN的配置

来源:blog.yesky 作者: 出处:巧巧读书 2006-01-09 进入讨论组
上一页 1 2 

第1步:设置好超级终端,连接上1900交换机,通过超级终端配置交换机的VLAN,连接成功后出现如下所示的主配置界面(交换机在此之前已完成了基本信息的配置):

1 user(s) now active on Management Console.

User Interface Menu

[M] Menus

[K] Command Line

[I] IP Configuration

Enter Selection:

【注】超级终端是利用Windows系统自带的"超级终端"(Hypertrm)程序进行的,具体参见有关资料。

第2步:单击"K"按键,选择主界面菜单中"[K] Command Line"选项 ,进入如下命令行配置界面:

CLI session with the switch is open.

To end the CLI session,enter [Exit ].

>

此时我们进入了交换机的普通用户模式,就象路由器一样,这种模式只能查看现在的配置,不能更改配置,并且能够使用的命令很有限。所以我们必须进入"特权模式"。

第3步:在上一步">"提示符下输入进入特权模式命令"enable",进入特权模式,命令格式为">enable",此时就进入了交换机配置的特权模式提示符:

#config t

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

(config)#

第4步:为了安全和方便起见,我们分别给这3个Catalyst 1900交换机起个名字,并且设置特权模式的登陆密码。下面仅以Switch1为例进行介绍。配置代码如下:

(config)#hostname Switch1

Switch1(config)# enable password level 15 XXXXXX

Switch1(config)#

【注】特权模式密码必须是4~8位字符这,要注意,这里所输入的密码是以明文形式直接显示的,要注意保密。交换机用 level 级别的大小来决定密码的权限。Level 1 是进入命令行界面的密码,也就是说,设置了 level 1 的密码后,你下次连上交换机,并输入 K 后,就会让你输入密码,这个密码就是 level 1 设置的密码。而 level 15 是你输入了"enable"命令后让你输入的特权模式密码。

第5步:设置VLAN名称。因四个VLAN分属于不同的交换机,VLAN命名的命令为" vlan 'vlan号'name 'vlan名称',在Switch1、Switch2、Switch3、交换机上配置2、3、4、5号VLAN的代码为:

Switch1 (config)#vlan 2 name Prod

Switch2 (config)#vlan 3 name Fina

Switch3 (config)#vlan 4 name Huma

Switch3 (config)#vlan 5 name Info

【注】以上配置是按表1规则进行的。

第6步:上一步我们对各交换机配置了VLAN组,现在要把这些VLAN对应于表1所规定的交换机端口号。对应端口号的命令是"vlan-membership static/ dynamic' VLAN号'"。在这个命令中"static"(静态)和"dynamic"(动态)分配方式两者必须选择一个,不过通常都是选择"static"(静态)方式。VLAN端口号应用配置如下:

(1). 名为"Switch1"的交换机的VLAN端口号配置如下:

Switch1(config)#int e0/2

Switch1(config-if)#vlan-membership static 2

Switch1(config-if)#int e0/3

Switch1(config-if)#vlan-membership static 2

Switch1(config-if)#int e0/4

Switch1(config-if)#vlan-membership static 2

……

Switch1(config-if)#int e0/20

Switch(config-if)#vlan-membership static 3

Switch1(config-if)#int e0/21

Switch1(config-if)#vlan-membership static 3

Switch1(config-if)#

【注】"int"是"nterface"命令缩写,是接口的意思。"e0/3"是"ethernet 0/2"的缩写,代表交换机的0号模块2号端口。

(2). 名为"Switch2"的交换机的VLAN端口号配置如下:

Switch2(config)#int e0/2

Switch2(config-if)#vlan-membership static 3

Switch2(config-if)#int e0/3

Switch2(config-if)#vlan-membership static 3

Switch2(config-if)#int e0/4

Switch2(config-if)#vlan-membership static 3

……

Switch2(config-if)#int e0/15

Switch2(config-if)#vlan-membership static 3

Switch2(config-if)#int e0/16

Switch2(config-if)#vlan-membership static 3

Switch2(config-if)#

(3). 名为"Switch3"的交换机的VLAN端口号配置如下(它包括两个VLAN组的配置),先看VLAN 4(Huma)的配置代码:

Switch3(config)#int e0/2

Switch3(config-if)#vlan-membership static 4

Switch3(config-if)#int e0/3

Switch3(config-if)#vlan-membership static 4

Switch3(config-if)#int e0/4

Switch3(config-if)#vlan-membership static 4

……

Switch3(config-if)#int e0/8

Switch3(config-if)#vlan-membership static 4

Switch3(config-if)#int e0/9

Switch3(config-if)#vlan-membership static 4

Switch3(config-if)#

下面是VLAN5(Info)的配置代码:

Switch3(config)#int e0/10

Switch3(config-if)#vlan-membership static 5

Switch3(config-if)#int e0/11

Switch3(config-if)#vlan-membership static 5

Switch3(config-if)#int e0/12

Switch3(config-if)#vlan-membership static 5

……

Switch3(config-if)#int e0/20

Switch3(config-if)#vlan-membership static 5

Switch3(config-if)#int e0/21

Switch3(config-if)#vlan-membership static 5

Switch3(config-if)#

好了,我们已经按表1要求把VLAN都定义到了相应交换机的端口上了。为了验证我们的配置,可以在特权模式使用"show vlan"命令显示出刚才所做的配置,检查一下是否正确。

以上是就Cisco Catalyst 1900交换机的VLAN配置进行介绍了,其它交换机的VLAN配置方法基本类似,参照有关交换机说明书即可。

本篇介绍了交换机的常用应用技术VLAN技术及其配置方法,下一篇将正式介绍另一个常见网络设备--路由器。路由器在网络之间的通信中所起的作用是不可替代的,同样也是一种非常关键的网络设备,希望大家与我一起来认识它。

转 载:http://www.qqread.com/exchange/h341205108.html 更多文章 更多内容请看三层交换技术专题交换机与路由器密码恢复交换机的选购专题,或进入讨论组讨论。
上一页 1 2 
收藏此文】【 】【打印】【关闭
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
巧巧读书宗旨
相关专题
讨论组问题推荐
站内各频道最新更新文档
站内最新制作专题
热门关键字导读
Photoshop教 程照片处理 照片制作 PS快捷键 抠图
计 算 机 故 障XP系统修复
艺 术 与 设 计设计 流媒体 设计欣赏 边框
计 算 机 安 全ARP
站内频道文章精选
巧巧电脑频道编辑信箱  告诉我们您想看的专题或文章