cisco交换机配置vlan的资料_第1页
cisco交换机配置vlan的资料_第2页
cisco交换机配置vlan的资料_第3页
cisco交换机配置vlan的资料_第4页
cisco交换机配置vlan的资料_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、* vian 配置思路(access、Trunk)(1) 创建 Vian在基于IOS的交换机上配置静态VLAN:switch# vla n databaseswitch(vla n)# vlan vlan-num n ame vlan-n ameswitch(vla n)# exitswitch# con figure terim inalswitch(c on fig)# in terface in terface module/nu mberswitch(c on fig-if)# switchport mode access / 设置端口模式为 access 模式switch(c on

2、fig-if)# switchport access vla n vla n-num /设置端口所属的VLANswitch(c on fig-if)# end核验配置:show vlan(2) 配置干道链路干道是在两台catalyst交换机端口或catalyst交换机与路由器间的一条点对点链路。干道链路可以承载多个vlan。在基于IOS的交换机上配置干道链路switch(c on fig)# in terface in terface mod/portswitch(config-if)# switchport mode trunk /设置端口模式为 trunk 模式switch(config-

3、if)# switchport trunk encapsulation isl|dotlq / 设置 trunk 所圭寸装的帧switch(config-if)# switchport trunk allowed vlan remove vlan-list /允许那些 VLAN 通过干路( 附: switchport trunk allowed vlan add | all | except | remove vlan-list )* no switchportno switchport /把物理端口变成三层口,即把三层口当成路由器上的口,当将一个端口配置成三层端口之后,就可以在此端口上分配

4、IP地址了,当然还是可以连接 PC机的,。路no switchport命令生成的端口,所有的由口:路由口是指某一物理端口在端口配置状态下用 三层都需要IP地址以实现路由交换。配置举例如下:Switch# con figure termi nalSwitch(c on fig)# in terface gigabitethernetO/2Switch(c on fig-if)# no switchportSwitch(co nfig-if)# ip address 192.20.135.21 255.255.255.0Switch(c on fig-if)# no shutdow nSwitch

5、(c on fig-if)# end附:show in terfaces in terface-id switchport /显示二层端口的状态,可以用来决定此口是否为二层或三层口。Eg: Switch# show in terfaces fastether net 0/1 switchport*三层交换机上VLAN的设置(1) 方法一:一般常规配置Switch# con figure termi nalSwitch(co nfig)# vlan 20Switch(c on fig-vla n)# n ame test20Switch(co nfig-vla n)#ip address 1.1

6、.1.1 255.255.255.0Switch(c on fig-vla n)# end方法二:也可以在enable状态下,进行 VLAN配置:Switch# vlan database / 进入 VLAN 配置状态Switch(vlan)# vlan 20 name test20 / 加入 VLAN 号及 VLAN 名Switch(vlan)# exit 更新VLAN数据库并退出(2) 将端口分配给某个VLANSwitch(c on fig)# in terface fastether net0/1Switch(co nfig-if)# switchport mode access / 定

7、义二层口的工作模式为接入模式Switch(co nfig-if)# switchport access vlan 2 /把端口分配给某一VLANSwitch(c on fig-if)# endSwitch#(3) 配置 VLAN TrunksSwitch# con figure termi nalSwitch(c on fig)# in terface fastether netO/4Switch(c on fig-if)# switchport mode trunkSwitch(c on fig-if)# switchport trunk en capsulati on dot1qSwitc

8、h(c on fig-if)# end附:switchport trunk encapsulation isl | dot1q | negotiate / 配置 trunk 圭寸装 ISL 或 802.1Q或自动协商switchport mode dynamic auto | desirable | trunk(般不用它),配置二层 trunk 模式。(dynamic auto 自动协商是否成为 trunk ; dynamic desirable 把端口设置为 trunk如果对方 端口是trunk, desirable,或自动模式;trunk 设置端口为强制的 trunk方式,而不理会对方端

9、口是否为trunk)(4) 定义trunk允许的VLANSwitch(c on fig)# in terface fastethernetO/1Switch(config-if)# switchport trunk allowed vlan remove 2 / 配置 trunk 允许的 VLANSwitch(c on fig-if)# end附: switchport trunk allowed vlan add | all | except | remove vlan-list(5) 配置 Native VLAN ( 802.1q)switch(config-if)# switchport

10、 trunk native vlan-num /圭寸装 802.1q 的 trunk 端口可以接受带有标签和不带标签的数据流,交换机向native vlan传送不带标签的数据流,缺省情况下native VLAN 是 VLAN 1使用no switchport trunk native vlan 端口配置命令回到缺省的状态(6) 配置一组端口4006# con figure term inal4006(co nfig)# in terface range fastethernet2/1 -54006(c on fig-if-ra nge)# no shutdow n/注意:端口号之间需要加入空格

11、,如:in terface ran ge fastethernet 2/1 -5是有效的,而 in terface range fastether net 2/1-5 是无效的.以下的例子显示使用逗号来配置不同类型端口的组:4006# con figure term inal4006(co nfig)# in terface range fastethernet2/1 -3, gigabitethernet3/1 - 24006(c on fig-if-ra nge)# no shutdow n(7) 其它常用命令duplex auto | full | half /设置全双工或半双工.spe

12、ed 10 | 100 | 1000 | auto | nonegotiate 设置端口速率 / 注:1000 只工作在千兆口 . GBIC 模块只工作在 1000 Mbps 下.nonegotiate 只能在这些 GBIC 上用 1000BASE-SX, -LX, and -ZX GBIC.copy runnin g-c onfig startup-c onfig / 保存设置(8) 配置 EtherChannel以太通道捆绑几个以太端口为一个独立的逻辑链路。如4006交换机,你可以捆绑在4006任何模 块上最多8个兼容的具有相同速率的端口。每个以太通道具有一个port-channel端口号

13、。要捆绑一个以太通道时,会产生一个逻辑port- channel端口,逻辑端口下的配置可影响与之捆绑的物理端口,但物理端口下的配置不能影响逻辑端口的配置。1) 三层以太通道(逻辑 port-cha nne)的配置Switch# con figure termi nalSwitch(co nfig)# in terface port-cha nnel 1 /创建一个逻辑端口Switch(co nfig-if)# ip address 172.32.52.10 255.255.255.0Switch(c on fig-if)# end2)三层物理端口配置Switch# con figure ter

14、mi nalSwitch(co nfig)# in terface range fastethernet 5/4 -5 (注意:空格是必需的)Switch(co nfig-if)# no switchport /改变该端口为三层接口Switch(config-if)# no ip address / 确认接口没有配置 IP 地址Switch(c on fig-if)# cha nn el-group 1 mode desirableSwitch(c on fig-if)# end附:Switch(c on fig-if)# cha nn el-group port_cha nnel_nu mb

15、er mode auto | desirable | on /将该物理端口加入一个以太通道中,并确定PagP模式。3) 二层以太通道配置Switch# con figure termi nalSwitch(co nfig)# in terface range fastethernet 5/6 - 7 (注意:空格是必需的)Switch(c on fig-if-ra nge)# cha nn el-group 2 mode desirableSwitch(c on fig-if-ra nge)# endSwitch# show runnin g-c onfig in terface port-c

16、ha nnel 2Buildi ng con figuratio n.Current con figuratio n:!in terface Port-cha nn el2switchport access vlan 10switchport mode accessend*如何作端口聚合Switch#如果要配置二台6509之间的Trunk联接,首先将二6509用千兆光纤相联好,然后分别配置二相联端口的trunk,可以是只用一双光纤,或用二对光纤做port cha nnel,配置如下:一双光纤相联时,分别在二台65上进行以下的配置:in terface GigabitEthernet1/1no

17、ip addressswitchportswitchport trunk en capsulati on dot1qswitchport trunk n ative vlan 1二对光纤相联时,必须要做port channel,分别在二台65上进行以下的配置:in terface port-cha nne1no ip addressswitchportswitchport trunk en capsulati on dot1qswitchport trunk n ative vlan 1!in terface GigabitEthernet1/1no ip addressduplex full

18、speed 1000switchport mode trunkswitchport trunk en capsulati on dot1qswitchport trunk n ative vlan 1cha nn el-group 1 mode onin terface GigabitEthernet1/2no ip addressduplex fullspeed 1000switchport mode trunkswitchport trunk en capsulati on dot1qswitchport trunk n ative vlan 1cha nn el-group 1 mode on* VTP裁剪(1) 在基于IOS的交换机上配置 VTP模式:switch# vla n databaseswitch(vla n)# vtp domai n doma in-n ameswitch(vla n)# vtp sever|cile nt|tra nspare ntswitch(vla n)# vtp password password在基于CLI的交换机上配置 VTP模式:switch(enable) set vtp domain domain-name mode s

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论