文本版|topic 高级搜索
   名人堂 帮助 论坛制度 意见反馈 | 首页 博客 周新贴 专题 求职 读书
RSS 底部
 
社区导航: 专家门诊   网络技术   操作系统   数据库   程序设计   系统应用   考试认证   CIO及信息化   站长交流   综合交流   下载基地  51CTO产品服务 设为首页 | 收藏本站
51CTO技术论坛» 锐捷技术 » 交换机802.1q vlan 的配置方法       [ 打印]  [ 订阅]  [ 收藏]  [ 推荐给朋友]   [ 本帖文本页]

论坛跳转:
     
标题: [原创] 交换机802.1q vlan 的配置方法  ( 查看:382  回复:3 )   
 
coolboshi
技术员  点击可查看详细


十二生肖之龙   行业勋章   技术勋章  
帖子 127
精华 0
无忧币 324
积分 311
阅读权限 30
来自 (保密)
注册日期 2006-3-16
最后登录 2008-10-12 离线

[查看资料]  [发短消息]  [Blog
[个人主页]    QQ       
发表于:2008-4-25 10:51   标题:交换机802.1q vlan 的配置方法
上一帖 |
配置VLAN
创建、修改一个VLAN
步骤如下:
song#configure terminal
!进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
song(config)#vlan 2
! 输入一个vlan id,如果输入的是一个新的vlan id,则交换机会创建一个vlan,如果输入的是已经存在的vlan id,则修改相应的vlan。在此是创建一个vlan号为2的。并进入vlan 2修改
2006-03-14 10:13:53  @5-CONFIG:Configured from outband
song(config-vlan)#name vlan2name
!设置vlan 2的名字为vlan2name
2006-03-14 10:14:09  @5-CONFIG:Configured from outband
song(config-vlan)#end
!退回到特权模式
2006-03-14 10:14:14  @5-CONFIG:Configured from outband
song#show vlan id 2
!查看vlan 2的信息
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
2    vlan2name                        active

song#wr
!保存当前所有设置
Building configuration...
[OK]

如果您想把vlan的名字改回缺省名字,如下配置
song# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
song(config)#vlan 2
2006-03-14 10:22:56  @5-CONFIG:Configured from outband
song(config-vlan)#no name
!将vlan 2的名字改为缺省名字
2006-03-14 10:22:59  @5-CONFIG:Configured from outband
song(config-vlan)#end
2006-03-14 10:23:09  @5-CONFIG:Configured from outband
song#show vlan id 2

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
2    VLAN0002                         active


删除一个VLAN
步骤如下:
song# configure terminal
!进入全局模式
Enter configuration commands, one per line.  End with CNTL/Z.
song(config)# no vlan 2
!输入一个vlan id。删除它
2006-03-14 10:27:34  @5-CONFIG:Configured from outband
song(config)# end
!退回到特权模式
2006-03-14 10:27:36  @5-CONFIG:Configured from outband
song# show vlan

VLAN 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/12
                                                Fa0/13,Fa0/14,Fa0/15,Fa0/16
                                                Fa0/17,Fa0/18,Fa0/19,Fa0/20
                                                Fa0/21,Fa0/22,Fa0/23,Fa0/24
!检查一下是否删除vlan 2
song#wr
!保存
Building configuration...
[OK]
向VLAN分配Access口
步骤如下:
song# configure terminal
!进入全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
2006-03-14 10:57:54  @5-CONFIG:Configured from outband
song(config)# interface fastEthernet 0/3
!输入想要加入vlan的interface id
2006-03-14 10:57:57  @5-CONFIG:Configured from outband
song(config-if)# switchport mode access
!定义该接口的VLAN成员类型
2006-03-14 10:58:18  @5-CONFIG:Configured from outband
song(config-if)#switchport access vlan 3
!将这个端口分配到vlan 3中
2006-03-14 10:58:32  @5-CONFIG:Configured from outband
%Warning : Access VLAN does not exist. Creating vlan 3
song(config-if)#end
!退回到特权模式
2006-03-14 10:58:37  @5-CONFIG:Configured from outband
song# show interfaces fastEthernet 0/3 switchport
Interface  Switchport Mode      Access  Native   Protected VLAN lists
---------- ---------- --------- ------- -------- --------- ---------------------

Fa0/3      Enabled    Access    3       1        Disabled  All
!检查接口的完整信息
song# write
!保存
Building configuration...
[OK]
song#

配置VLAN Trunks
Trunk口基本配置
步骤如下:

song# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
song(config)# interface fastEthernet 0/4
!输入你所要设置成trunk的接口
2006-03-14 11:09:53  @5-CONFIG:Configured from outband
song(config-if)#switchport mode trunk
!定义该接口为二层trunk口
2006-03-14 11:10:22  @5-CONFIG:Configured from outband
song(config-if)#switchport trunk native vlan 3
!为这个接口指定一个vlan号
2006-03-14 11:10:38  @5-CONFIG:Configured from outband
song(config-if)#end
2006-03-14 11:10:40  @5-CONFIG:Configured from outband
song#show interfaces fastEthernet 0/4 switchport
Interface  Switchport Mode      Access  Native   Protected VLAN lists
---------- ---------- --------- ------- -------- --------- ---------------------

Fa0/4      Enabled    Trunk     1       3        Disabled  All
!检查接口完整信息
song#show interfaces fastEthernet 0/4 trunk
Interface            Mode   Native VLAN VLAN lists
-------------------- ------ ----------- --------------------
Fa0/4                On     3           All
!显示这个接口的trunk设置
song#wr
Building configuration...
[OK]
定义Trunk口的许可VLAN列表
注:一个trunk口缺省可以传输本交换机支持的所有vlan(1-4094)的流量。但是,您也可以通过设置Trunk口的许可VLAN列表来限制某些VLAN的流量不能通过这个Trunk口
如把vlan 3从端口0/15中移出的例子
步骤如下:
song# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
song(config)# interface fastEthernet 0/15
!输入想要修改许可VLAN列表的Trunk口的interface id
2006-03-14 11:24:15  @5-CONFIG:Configured from outband
!定义该接口的类型为二层Trunk口
song(config-if)# switchport trunk allowed vlan remove 2
!把vlan2从端口15中移出
2006-03-14 11:24:31  @5-CONFIG:Configured from outband
song(config-if)#end
2006-03-14 11:24:35  @5-CONFIG:Configured from outband
song# show interfaces fastEthernet 0/15 switchport
Interface  Switchport Mode      Access  Native   Protected VLAN lists
---------- ---------- --------- ------- -------- --------- ---------------------

Fa0/15     Enabled    Access    1       1        Disabled  1,3-4094

配置Native VLAN
步骤如下:
song# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
song(config)# interface fastEthernet 0/6
!输入需要配置成native vlan的trunk口的interface id
2006-03-14 11:32:59  @5-CONFIG:Configured from outband
song(config-if)# switchport trunk native vlan 5
!配置native VLAN
2006-03-14 11:33:23  @5-CONFIG:Configured from outband
song(config-if)# end
2006-03-14 11:33:26  @5-CONFIG:Configured from outband
song# show interfaces fastEthernet 0/6 switchport
!验证配置
Interface  Switchport Mode      Access  Native   Protected VLAN lists
---------- ---------- --------- ------- -------- --------- ---------------------

Fa0/6      Enabled    Access    1       5(NA)    Disabled  All

song# wr
Building configuration...
[OK]

显示VLAN
song# show vlan
!直接输入此命令即可查看到所有VLAN的信息



论坛活动:测测你对IT技术大会的了解指数(赠微软礼品、无忧币)
2008-4-25 10:511楼
[ 顶部 ]
 
sylar_lu
技术员  点击可查看详细



十二生肖之龙   魔蝎座   行业勋章   技术勋章   诚信兄弟  
帖子 161
精华 0
无忧币 1378
积分 578
阅读权限 30
注册日期 2008-4-22
最后登录 2008-10-12 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-25 22:40 
顶个   哈哈



论坛活动:测测你对IT技术大会的了解指数(赠微软礼品、无忧币)
2008-4-25 22:402楼
[ 顶部 ]
 
sylar_lu
技术员  点击可查看详细



十二生肖之龙   魔蝎座   行业勋章   技术勋章   诚信兄弟  
帖子 161
精华 0
无忧币 1378
积分 578
阅读权限 30
注册日期 2008-4-22
最后登录 2008-10-12 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-27 21:41 
顶顶顶顶顶



论坛活动:测测你对IT技术大会的了解指数(赠微软礼品、无忧币)
2008-4-27 21:413楼
[ 顶部 ]
 
pengjun521
新新人类  点击可查看详细



帖子 21
精华 0
无忧币 -2
积分 16
阅读权限 20
注册日期 2008-6-14
最后登录 2008-10-2 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-9-18 22:33 
比较详细啊  HOHO 



论坛活动:测测你对IT技术大会的了解指数(赠微软礼品、无忧币)
2008-9-18 22:334楼
[ 顶部 ]
     
论坛跳转:  

| | |

| | |

| | |

标记已读 · 删除论坛Cookies · 文本版 · WAP
 
| 诚征版主 | 版主堂 | 意见建议 | 大史记 | 论坛地图
Copyright©2005-2008 51CTO.COM  Powered by Discuz!
本论坛言论纯属发布者个人意见,不代表51CTO网站立场!如有疑义,请与管理员联系。
京ICP备05051492号