十五、Port Channel 配置命令
- 格式:doc
- 大小:50.50 KB
- 文档页数:5
端口操作目录目录第1章端口配置..................................................................................1-11.1 端口介绍........................................................................................................................1-11.2 端口配置........................................................................................................................1-11.2.1 业务端口配置.....................................................................................................1-11.2.2 VLAN接口配置..................................................................................................1-21.3 端口配置举例................................................................................................................1-31.4 端口排错帮助................................................................................................................1-41.5 镜像................................................................................................................................1-41.5.1 镜像介绍.............................................................................................................1-41.5.2 镜像配置任务序列.............................................................................................1-41.5.3 镜像举例.............................................................................................................1-51.5.4 镜像排错帮助.....................................................................................................1-6第2章 Port Channel配置...................................................................2-12.1 Port Channel介绍..........................................................................................................2-12.2 Port Channel配置..........................................................................................................2-22.3 Port Channel举例..........................................................................................................2-22.4 Port Channel排错帮助..................................................................................................2-5第1章 端口配置1.1 端口介绍DCRS-5900系列交换机端口包括电口和Combo端口,Combo端口可以选择配置为千兆电口,也可以选择配置为千兆SFP光口,两者只能选择其中之一。
EtherChannel(PAgP、LACP)基本配置--端⼝聚合--(转)EtherChannelEtherChannel(以太通道)也叫端⼝聚合或链路聚合,特别提⼀下。
建议我们在使⽤中,物理链路的汇聚,我们可以叫链路(端⼝)汇聚或链路(端⼝)聚合。
⽽VLAN的中继聚合,我们叫vlan聚合或VLAN汇聚,或直接叫trunk! 很容易搞混哦!是由Cisco研发的,应⽤于交换机之间的多链路捆绑技术。
它的基本原理是:将两个设备间多条相同特性的快速以太或千兆位以太物理链路捆绑在⼀起组成⼀条逻辑链路,从⽽达到带宽倍增的⽬的。
除了增加带宽外,EtherChannel还可以在多条链路上均衡分配流量,起到负载分担的作⽤;当⼀条或多条链路故障时,只要还有链路正常,流量将转移到其它的链路上,整个过程在⼏毫秒内完成,从⽽起到冗余的作⽤,增强了⽹络的稳定性和安全性。
在EtherChannel中,负载在各个链路上的分布可以根据源IP地址、⽬的IP地址、源MAC地址、⽬的MAC地址、源IP地址和⽬的IP地址组合,以及源MAC地址和⽬的MAC地址组合等来进⾏分布。
两台交换机之间是否形成EtherChannel也可以⽤协议⾃动协商。
⽬前有两个协商协议:PAgP和LACP,PAgP(端⼝汇聚协议 Port Aggregation Protocol)是Cisco私有的协议,⽽LACP(链路汇聚控制协议 Link Aggregation Control Protocol)是基于IEEE 802.3ad的国际标准。
能形成EtherChannel的模式总结:EtherChannel命令组合:如果想把端⼝配置为on:sw1(config-if-range)#channel-group 1 mode on如果想把端⼝配置为PAgP的desirable:sw1(config-if-range)#channel-protocol pagpsw1(config-if-range)#channel-group 1 mode desirable如果想把端⼝配置为PAgP的auto:sw1(config-if-range)#channel-protocol pagpsw1(config-if-range)#channel-group 1 mode auto如果想把端⼝配置为LACP的active:sw1(config-if-range)#channel-protocol lacpsw1(config-if-range)#channel-group 1 mode active如果想把端⼝配置为LACP的passive:sw1(config-if-range)#channel-protocol lacpsw1(config-if-range)#channel-group 1 mode passiveEtherChannel说明:①Cisco最多允许EtherChannel绑定8个端⼝;1>如果是快速以太⽹,总带宽可达1600Mbit/s;2>如果是Gbit以太⽹,总带宽可达16Gbit/s。
华为交换机基本配置命令一、单交换机VLAN划分命令命令解释system 进入系统视图system-view 进入系统视图quit 退到系统视图undo vlan 20 删除vlan 20sysname 交换机命名disp vlan 显示vlanvlan 20 创建vlan(也可进入vlan 20)port e1/0/1toe1/0/5 把端口1-5放入VLAN 20 中5700系列单个端口放入VLAN[Huawei]intg0/0/1[Huawei]port link-typeaccess(注:接口类型access,hybrid、trunk)[Huawei]port default vlan 10批量端口放入VLAN[Huawei]port-group 1[Huawei-port-group-1]group-member ethernet G0/0/1 to ethernet G0/0/20[Huawei-port-group-1]port hybrid untagged vlan 3删除group(组)vlan 200内的15端口[Huawei]intg0/0/15[Huawei-GigabitEthernet0/0/15]undo port hybrid untagged vlan 200通过group端口限速设置[Huawei]Port-group 2[Huawei]group-member g0/0/2 to g0/0/23[Huawei]qos lr outbound cir 2000 cbs 20000disp vlan 20 显示vlan里的端口20int e1/0/24 进入端口24undo port e1/0/10 表示删除当前VLAN端口10disp curr 显示当前配置return 返回Save 保存info-center source DS channel 0 log state off trap state off通过关闭日志信息命令改变DS模块来实现(关闭配置后的确认信息显示)info-center source DS channel 0 log state on trap state on 通过打开日志信息命令改变DS模块来实现(打开配置后的确认信息显示)二、配置交换机支持TELNEsystem 进入系统视图sysname 交换机命名int vlan 1 进入VLAN 1ip address 192.168.3.100 255.255.255.0 配置IP地址user-int vty 0 4 进入虚拟终端authentication-mode password (aut password) 设置口令模式set authentication password simple 222 (set aut pass sim 222) 设置口令user privilege level 3(use priv lev 3) 配置用户级别disp current-configuration (disp cur) 查看当前配置disp ip int 查看交换机VLAN IP配置删除配置必须退到用户模式reset saved-configuration(reset saved) 删除配置Reboot 重启交换机三、跨交换机VLAN的通讯在sw1上:vlan 10 建立VLAN 10int e1/0/5 进入端口5port access vlan 10 把端口5加入vlan 10vlan 20 建立VLAN 20int e1/0/15 进入端口15port access vlan 20 把端口15加入VLAN 20int e1/0/24 进入端口24port link-type trunk 把24端口设为TRUNK端口port trunk permit vlan all 同上在SW2上:vlan 10 建立VLAN 10int e1/0/20 进入端口20port access vlan 10 把端口20放入VLAN 10int e1/0/24 进入端口24port link-type trunk 把24端口设为TRUNK端口port trunk permit vlan all (port trunk permit vlan 10 只能为vlan 10使用)24端口为所有VLAN使用disp int e1/0/24 查看端口24是否为TRUNKundo port trunk permit vlan all 删除该句四、路由的配置命令system 进入系统模式sysname 命名int e1/0 进入端口ip address 192.168.3.100 255.255.255.0 设置IPundo shutdown 打开端口disp ip int e1/0 查看IP接口情况disp ip int brief 查看IP接口情况user-int vty 0 4 进入口令模式authentication-mode password(auth pass) 进入口令模式set authentication password simple 222 37 设置口令user privilege level 3 进入3级特权save 保存配置reset saved-configuration 删除配置(用户模式下运行)undo shutdown 配置远程登陆密码int e1/4ip route 192.168.3.0(目标网段)255.255.255.0 192.168.12.1(下一跳:下一路由器的接口)静态路由ip route 0.0.0.0 0.0.0.0 192.168.12.1 默认路由disp ip rout 显示路由列表华3C AR-18E1/0(lan1-lan4)E2/0(wan0)E3/0(WAN1)路由器连接使用直通线。
交换机部分命令一、交换机模式切换Swith>enable //切换到特权Swith#config t //切换到全局配置模式Swith(config)# interface f0/1 //进入接口f0/0Swith(config)# interface vlan 1 //进入VLAN 1中Swith(config-if)#ip address 192.168.1.1 255.255.255.0 //对VLAN1设置IP地址和子网掩码Swith(config-if)#no shutdown //激活VLAN1二、设置交换机的密码1、用户到特权的密码Swith(config)#enable password 123 (优先级低)Swith(config)#enable secret 456 (优先级高) //如果两个都设置则456生效2、控制台console密码设置Swith(config)# line con 0Swith(config-line)#loginSwith(config-line)#password console123 //设置console密码为telnet1233、启用telnet密码Swith(config)#line vty 0 15 //最多有0~15人可以telnet访问swith,合计16人Swith(config-line)#loginSwith(config-line)#password telnet123 //设置telnet密码为telnet123注:要想真正生效telnet还要设置特权密码三、交换机命名hostname BENETSW01Swith(config)#hostname BENETSW01 //使用hostname命名交换机的名字四、show命令集Swith#show version //显示IOS版本信息Swith#show int vlan 1 brief //简单的显示VLAN1的信息Swith#show running-config //显示正在运行的配置文件Swith#show startup-config //显示己经保存的配置文件Swith#show mac-address-table //显示MAC地址表Swith#show mac-address-table //显示MAC地址表更新的间隔,默认为5分钟Swith#show neighbor detail //显示邻居详细信息Swith#show traffic //显示CDP流量Swith#show五、设置交换机的网关和DNS名称服务器的IP地址Swith(config)# ip default-gateway 192.168.10.8 //交换机的网关设置为192.168.10.8 Swith(config)#ip domain -name server 202.106.0.20 //设置DNS名称服务器地址Swith(config)# no ip domain-lookup //交换机名称服务器的域名查询六、创建、删除、查看VLANSwitch#vlan database //进入vlan数据库配置模式Switch(vlan)#vlan 2 //创建VLAN2自动命名为vlan0002,同vlan2 name salesVLAN 2 added:Name: VLAN0002Switch(vlan)#exit //退出时应用生效Swith(vlan)#no vlan 2 //删除vlan2Switch(config)# interface f0/1Switch(config-if)# switchport access vlan 2 //将端口加入vlan 2中Switch(config-if)# no switchport access vlan 2 //将端口从vlan2中删除Switch(config)# interface range f0/1 – 10 // 进行F0/1到10端口范围Switch(config-if-range)# switchport access vlan 2 //将f0/1到f0/10之间的所有端口加入vlan 2 Switch# show vlan brief //查看所有VLAN的摘要信息Switch# show vlan id (vlan-id ) //查看指定VLAN的信息七、开启并查看trunk端Swith(config)#interface f0/24Swith(config-if)#swith mode trunk //将f0/24端口设置为trunkSwitch#show interface f0/24 switchport //查看f0/24的接口状态八、从Trunk中添加、删除VlanSwitch (config-if )# switchport trunk allowed vlan remove 3 //从trunk端口删除v lan3通过Switch (config-if)# switchport trunk allowed vlan add 3 //从trunk端口添加vlan3通过Switch # show interface interface-id switchport //检查中继端口允许VLAN的列表九、单臂路由配置Router(config)# interface f0/0.1Router(config-subif)# encapsolution dot1q 1 //子接口封装dot1q 针对的是VLAN1Router(config-subif)# ip address 192.168.1.1 255.255.255.0 //设置VLAN的网关地址Router(config)# interface f0/0.2Router(config-subif)# encapsolution dot1q 2 //子接口封装dot1q针对的是vlan2Router(config-subif)# ip address 192.168.2.1 255.255.255.0 //设置vlan2的网关的地址十、配置VTP服务器S1#vlan database //进入vlan配置模式S1(vlan)#vtp server //设置该交换机为VTP服务器模式,考试时选默认是透明模式,但思科是默认为服务器模式。
cisco怎么配置聚合端口cisco怎么配置聚合端口?店铺在网上找了一些教程及命令,需要的朋友可以参考下。
作为一种内部网关协议或IGP(内部网关协议),路由选择协议应用于 AS 系统。
那么cisco怎么设置路由rip协议?店铺整理了相关资料,供大家参考。
端口的聚合有两种方式,一种是手动的方式,一个是自动协商的方式。
(1)手动方式这种方式很简单,设置端口成员链路两端的模式为“on”。
命令格式为: channel-group <number组号> mode on(2)自动方式自动方式有两种协议:PAgP(Port Aggregation Protocol)和LACP(Link aggregation Control Protocol)。
PAgP:Cisco设备的端口聚合协议,有auto和desirable两种模式。
auto模式在协商中只收不发,desirable模式的端口收发协商的数据包。
LACP:标准的端口聚合协议802.3ad,有active和passive两种模式。
active相当于PAgP的auto,而passive相当于PAgP的desirable。
1:在(config)#模式下,输入int port-channel ID(1-64)2:假设要把F0/23和F0/24聚合,那么分别在起端口配置里面输入:switchport trunkencapsulation dot1qswitchport mode trunk(假设有多个VLAN)duplex fullspeed 100no cdp enablechannel-group 1 mode on(这里的1就是开始创建的数字),或者直接在需要做端口聚合的端口上执行下面命令int port-ch 10channel-g 10 mode acchannel-g p lacp(panp)然后只要在对端交换机也做同样配置就可以了以下是以思科2950以及7200设备为例的具体操作:Cat2950的配置:Cat2950#conf tCat2950(config)#vtp mode serverCat2950(config)#vtp domain ciscoCat2950(config)#vlan 10Cat2950(config-vlan)#exitCat2950(config)#vlan 20Cat2950(config-vlan)#exitCat2950(config)#int range fa0/5 - 14Cat2950(config-if-range)#switchport access vlan 10Cat2950(config-if-range)#exitCat2950(config)#int range fa0/15 - 26Cat2950(config-if-range)#switchport access vlan 20Cat2950#conf tCat2950(config)#int vlan 10Cat2950(config-if)#ip address 10.10.10.10 255.255.255.0Cat2950(config)#ip default-gateway 10.10.10.1Cat2950(config-if)#no shutdownCat2950(config)#int port-channel 1Cat2950(config-if)#exitCat2950(config)#int fa0/2Cat2950(config-if)#channel-group 1 mode onCat2950(config-if)#exitCat2950(config)#int fa0/3Cat2950(config-if)#channel-group 1 mode onCat2950(config-if)#exitCat2950(config)#int port-channel1Cat2950(config-if)#switchport mode trunkCat2950(config-if)#switchport trunk native vlan 10cisco7200的配置:Cisco7200#conf tCisco7200(config)#int port-channel 1Cisco7200(config-if)#exitCisco7200(config)#int fa3/0Cisco7200(config-if)#channel-group 1Cisco7200(config-if)#exitCisco7200(config)#int fa4/0Cisco7200(config-if)#channel-group 1Cisco7200(config-if)#exitCisco7200(config)#int port-channel 1.10Cisco7200(config-subif)#encapsulation dot1Q 10 native Cisco7200(config-subif)#ip address 10.10.10.1 255.255.255.0 Cisco7200(config-subif)#exitCisco7200(config)#int port-channel 1.20Cisco7200(config-subif)#encapsulation dot1Q 20Cisco7200(config-subif)#ip address 10.10.11.1 255.255.255.0 Cisco7200(config-subif)#exitCisco7200(config)#exit以上内容来自互联网,希望对大家有所帮助。
目录第1章交换机管理 (3)1.1 管理方式 ..................................................................................... 错误!未定义书签。
1.1.1 带外管理................................................................................................. 错误!未定义书签。
1.1.2 带内管理................................................................................................. 错误!未定义书签。
1.2 CLI界面 (4)1.2.1 配置模式介绍 (4)1.2.2 配置语法 (6)1.2.3 支持快捷键 (6)1.2.4 帮助功能 (7)1.2.5 对输入的检查 ......................................................................................... 错误!未定义书签。
1.2.6 支持不完全匹配...................................................................................... 错误!未定义书签。
第2章交换机基本配置...................................................... 错误!未定义书签。
2.1 基本配置 (7)2.2 远程管理 ..................................................................................... 错误!未定义书签。
1、访问设备的方式管理从用户与设备交互的特点来分,访问设备的方式可以分为命令行方式和Web方式。
(1)命令行方式:包括从Console口登录进行访问和通过Telnet登录进行访问;(2) Web方式:包括通过HTTP进行的普通Web访问。
2、查看CISCO 设备的简单运行状态(1)Switch> 开机时自动进入特权模式配置系统参数,升级IOS软件,备份配置文件 Switch#在非特权模式下键入ENABLE 使用quit返回非特权模式全局模式 CISCO交换机大部分配置都是在这个模式下进行 Switch(config)#在特权模式下键入configure terminal 使用quit返回特权模式监控模式升级IOS系统软件 Switch:开机时摁住面板上的MODE键约5秒钟(2)基本设置命令全局设置 config terminal设置访问用户及密码 Username username password password设置特权密码 enable secret password设置路由器名 Hostname name设置静态路由 ip route destination subnet-mask next-hop 启动IP路由 ip routing 启动IPX路由 ipx routing端口设置 interface type slot/number设置IP地址 ip address address subnet-mask设置IPX网络 ipx network network激活端口 no shutdown物理线路设置 line type number启动登录进程 login [local|tacacs server]设置登录密码 Password password显示命令任务命令查看版本及引导信息 show version查看运行设置 show running-config查看开机设置 show startup-config显示端口信息 show interface type slot/number显示路由信息 show ip route3、Catalyst 3560接口说明FE电接口:符合100Base-TX物理层规范 GE电接口:1000Base-TX物理层规范工作速率 FE电接口可以选择10Mbit/s、100Mbit/s两种速率 GE电接口可以选择10Mbit/s、100Mbit/s、1000Mbit/s三种速率工作模式自动协商模式4、Catalyst 3560接口配置3560的所有端口缺省的端口都是二层口,如果此端口已经配置成三层端口的话,则需要用switchport来使其成为二层端口(4.1) 配置端口速率及双工模式可以配置快速以太口的速率为10/100Mbps及千兆以太口的速率为10/100/1000-Mbps; 但对于SFP端口则不能配置速率及双工模式,有时可以配置nonegotiate,当需要联接不支持自适应的其它千兆端口时。
CISCO 设备的简单运行状态(1)Switch> 开机时自动进入特权模式配置系统参数,升级IOS软件,备份配置文件 Switch#在非特权模式下键入ENABLE 使用quit返回非特权模式全局模式 CISCO交换机大部分配置都是在这个模式下进行 Switch(config)#在特权模式下键入configure terminal 使用quit返回特权模式监控模式升级IOS系统软件 Switch:开机时摁住面板上的MODE键约5秒钟(2)基本设置命令全局设置 config terminal 设置访问用户及密码 Username username password password 设置特权密码 enable secret password设置路由器名 Hostname name设置静态路由 ip route destination subnet-mask next-hop启动IP路由 ip routing 启动IPX路由 ipx routing端口设置 interface type slot/number设置IP地址 ip address address subnet-mask设置IPX网络 ipx network network激活端口 no shutdown物理线路设置 line type number启动登录进程 login [local|tacacs server]设置登录密码 Password password显示命令任务命令查看版本及引导信息 show version查看运行设置 show running-config查看开机设置 show startup-config显示端口信息 show interface type slot/number显示路由信息 show ip route3、Catalyst 3560接口说明FE电接口:符合100Base-TX物理层规范 GE电接口:1000Base-TX物理层规范工作速率 FE电接口可以选择10Mbit/s、100Mbit/s两种速率 GE电接口可以选择10Mbit/s、100Mbit/s、1000Mbit/s三种速率工作模式自动协商模式4、Catalyst 3560接口配置3560的所有端口缺省的端口都是二层口,如果此端口已经配置成三层端口的话,则需要用switchport来使其成为二层端口(4.1) 配置端口速率及双工模式可以配置快速以太口的速率为10/100Mbps及千兆以太口的速率为10/100/1000-Mbps; 但对于SFP端口则不能配置速率及双工模式,有时可以配置nonegotiate,当需要联接不支持自适应的其它千兆端口时。
Cisco三层交换机配置命令及解释(2011-07-11 08:54:50)标签:分类:IT资讯cisco杂谈基本配置S> enable 进入特权模式S# configure terminal 进入全局配置模式S(config)# hostname name 改变交换机名称S(config)# enable password level level_# password 设置用户口令〔level_#=1)或特权口令〔level_#=15)S(config)# line console 0 进入控制台接口S(config-line)# password console_password 接上一条命令,设置控制台口令S(config)# line vty 0 15 进入虚拟终端S(config-line)# password telnet_password 接上一条命令,设置Telnet口令S(config-line)# login 允许Telnet登录S(config)# enable password|secret privilege_password 配置特权口令〔加密或不加密〕S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式S(config-if)# [no] shutdown 关闭或启用该接口〔默认启用〕S(config)# ip address IP_address sunbet_mask 指定IP地址S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关S# show running-config 查看当前的配置S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中S> show interface [type slot_#/port_#] 查看所有或指定接口的信息S> show ip 显示交换机的IP配置〔只在1900系列上可用〕S> show version 查看设备信息S# show ip interface brief 验证IP配置S(config-if)# speed 10|100|auto 设置接口速率S(config-if)# duplex auto|full|half 设置接口双工模式S> show mac-address-table 查看CAM表S# clear mac-address-table 清除CAM表中的动态条目1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM表中创建静态条目2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中创建静态条目1900(config)# mac-address-table restricted static MAC_address source_portlist_of_allowed_interface 设置静态端口安全措施1900(config-if)# port secure 启用粘性学习1900(config-if)# port secure max-mac-count value 设置粘性学习特性能够学到的地址数量〔默认132,取值范围是1-132〕1900(config)# address-violation suspend|ignore|disable 改变安全选项1900> show mac-address-table security 验证端口安全措施2950(config)# switchport mode access 定义接口为主机端口而不是中继端口2950(config)# switchport port-security 启用端口安全措施2950(config)# switchport port-security maximum value 指定可与此接口相关的设备的最大数量2950(config)# switchport port-security violation protect|restrict|shutdown 指定出现安全违规时应该发生的事2950(config)# switchport port-security mac-address MAC_address 指定允许与此接口相关确实切的MAC地址2950(config)# switchport port-security mac-address sticky 启用粘性学习特性2950(config)# show port interface type [slot_#/] port_# 验证接口配置2950(config-if) description name 设置接口描述信息2950# show buffers 查看系统缓存的大小1900# copy nvram tftp:// IP_address_of_TFTP_server/ file_name 将配置文件备份到TFTP服务器上1900# copy tftp:// IP_address_of_TFTP_server/ file_name nvram 从TFTP服务器上恢复配置到NVRAM1900# delete nvram 删除配置文件2950# erase startup-config 删除配置文件3550# show tcam qos TCAM_ID statistics 查看TCAM剩余容量4000> enable 进入特权模式4000>(enable) set password 设置用户模式密码4000>(enable) set enablepass 设置授权密码4000>(enable) set interface sc0 IP_address mask 配置IP地址4000>(enable) set port enable|disable slot_#/port_# 启用/禁用接口4000>(enable) show port [slot_#/port_#] 显示接口信息4000>(enable) set port name slot_#/port_# name 设置交换机接口描述信息4000>(enable) set port speed slot_#/port_# 4|10|16|100|auto 设置交换机接口速率4000>(enable) set port duplex slot_#/port_# full|half 设置交换机接口双工模式4000>(enable) clear config all 删除NVRAM中的配置信息4000>(enable) erase all 删除FLASH中的内容4000>(enable) show flash 显示FLASH中的内容4000>(enable) show cam [count] dynamic|static|permanent|system [vlan_#] 显示CAM表VLAN 1900(config)# vtp domain VTP_domain_name 定义交换机域名1900(config)# vtp server|client|transparent 定义交换机VTP模式〔默认服务器〕1900(config)# vtp password VTP_password 配置VTP口令1900(config)# vtp pruning enable|disable 启用/禁用修剪〔默认启用〕1900(config)# vtp trap enable 启用SNMP陷阱〔默认启用〕1900# show vtp 验证VTP配置2950# vtp database 访问VLAN和VTP配置〔以下均是在前用,后全是在全局配置模式下〕2950(vlan)# vtp domain VTP_domain_name 定义交换机域名2950(vlan)# vtp server|client|transparent 定义交换机VTP模式〔默认服务器〕2950(vlan)# vtp password VTP_password 配置VTP口令2950(vlan)# vtp pruning 启用/禁用修剪〔默认启用〕2950(config)# snmp-server enable traps vtp 启用SNMP陷阱〔默认启用〕2950# show vtp status 检查VTP配置2950# show vtp counters 显示与VTP消息发送与接收相关的VTP统计信息1900(config-if)# trunk on|off|desirable|auto 指定中继类型1900# show trunk A|B 验证接口中继〔A是fa0/26,B是fa0/27〕2950(config-if)# switchport mode trunk|dynamic desirable|dynamic auto|nonegotiate 指定中继类型(默认自动协商〕2950(config-if)# switchport trunk native|allowed|pruning vlan VLAN_# 配置中继2950(config-if)# switchport trunk pruning vlan remove VLAN_# 清除不希望消减的VLAN 2950# show interfaces [type 0/port_#] switchport|trunk 验证接口中继1900(config)# vlan VLAN_# [name VLAN_name] 创建VLAN1900(config-if)# vlan-membership static VLAN_# 将该接口静态地分配给一个VLAN1900# show vlan 验证VLAN1900# show vlan-membership 查看VLAN成员关系1900# show spantree [VLAN_#] 查看VLAN的STP信息2950# vlan database 进入VLAN数据库〔前用〕2950(vlan)# vlan VLAN_# [name VLAN_name] 创建VLAN2950(config)# vlan VLAN_# 进入VLAN数据库〔后用〕2950(config-vlan)# name VLAN_name 创建VLAN2950(config-if)# switchport mode access 指定连接是接入链路连接2950(config-if)# switchport access vlan VLAN_# 指定VLAN是接入链路连接4000>(enable) set vlan VLAN_# name VLAN_name 配置VLAN4000>(enable) set vlan VLAN_# slot_#/port_#-port_# 为VLAN分配端口4000>(enable) set trunk slot_#/port_# [on|off|desirable|auto|nonegotiate] [VLAN_#][isl|dot1q|dot10|lane|negotiate] 配置中继4000>(enable) clear trunk slot_#/port_# VLAN_# 删除VLAN4000>(enable) show trunk slot_#/port_# 验证中继端口4000>(enable) set vtp v2 enable 配置VTPv24000>(enable) set vtp [domain name] [mode client|server|transparent] [passwd password] [pruning enable|disable] [v2 enable|disable] 设置VTP4000>(enable) show vtp domain 验证VTP域的信息4000>(enable) show vtp statistics 显示发出或收到的VTP通告信息的摘要内容4000>(enable) set vtp pruneeligible VLAN_# 设置VTP消减4000>(enable) clear vtp pruneeligible VLAN_# 清除不希望消减的VLANSTP 4000>(enable) set spantree enable|disable VLAN_# 启用/禁用STP〔默认启用〕2950(config)# [no] spanning-tree vlan VLAN_# 启用/禁用STP〔默认启用〕4000>(enable) show spantree [VLAN_#] 验证STP状态2950# show spanning-tree 验证STP状态4000>(enable) set spantree root [secondary] VLAN_# [dia network_diameter] [hello hello_time] 设置主根节点桥、备份节点桥、最大桥数量〔2-7〕、持续时间〔1-10,默认2〕4000>(enable) set spantree portcost slot_#/port_# cost_# 设置端口开销2950(config-if)# spanning-tree cost cost_# 设置端口开销4000>(enable) set spantree portpri slot_#/port_# priority_# 设置端口优先级4000>(enable) set spantree portvlanpri slot_#/port_# priority_# [VLAN_#] 改变VLAN的优先级设置2950(config-if)# spanning-tree vlan VLAN_# port-priority priority_# 设置端口优先级4000>(enable) set spantree fwddelay delay_# [VLAN_#] 设置从侦听状态到学习状态再到转发状态的时间间隔〔默认15秒,取值范围是4-30秒〕4000>(enable) set spantree hello interval_time [VLAN_#] 设置根节点交换机发送BPDU的时间间隔〔默认2秒,取值范围是1-10秒〕4000>(enable) set spantree maxage agingtime [VLAN_#] 设置交换机持有BPDU的时间〔默认20秒,取值范围是6-40秒〕2950(config)# spanning-tree vlan VLAN_# forward-time forward_time 设置从侦听状态到学习状态再到转发状态的时间间隔〔默认15秒,取值范围是4-30秒〕2950(config)# spanning-tree vlan VLAN_# hello-time hello_time 设置根节点交换机发送BPDU的时间间隔〔默认2秒,取值范围是1-10秒〕2950(config)# spanning-tree vlan VLAN_# max-age maxage 设置交换机持有BPDU的时间〔默认20秒,取值范围是6-40秒〕4000>(enable) set port channel slot_#/port_# on 建立以太通道集合4000>(enable) show port capabilities slot_#/port_# 查看端口的配置4000>(enable) show port channel 验证以太通道集合的配置2950(config-if)# channel-group group_number mode auto|desirable|on 建立以太通道集合2950# show etherchannel group_number|brief|detail|load-balance|port|port-channel|summary 验证以太通道集合的配置4000>(enable) set spantree portfast slot_#/port_# enable 配置PortFast2950(config-if)# spanning-tree portfast 配置PortFast4000>(enable) set spantree uplinkfast enable|disable [rate station_update_rate] [all-protocolsoff|on] 启用/禁用UplinkFast4000>(enable) show spantree uplinkfast 验证UplinkFast配置2950(config)# spanning-tree uplinkfast [max_update_rate] 启用/禁用UplinkFast2950# show spanning-tree uplinkfast 验证UplinkFast配置4000>(enable) set spantree backbonefast enable|disable 启用/禁用BackboneFast4000>(enable) show spantree backbonefast 验证BackboneFast配置2950(config)# spanning-tree backbonefast 启用BackboneFast虚拟网间路由2600(config)# interface type slot_#/port_#.subint_number 配置子接口2600(config-subif)# encapsulation dot1q|isl|sde|tr-isl VLAN_# 配置封装类型4000>(enable) show module 查看交换机的硬件配置4000>(enable) session module_# 访问L3SML3SM(config-if)# mac-address mac_address 分配MAC地址MLS 2600(config)# mls rp ip 启动MLS2600(config-if)# mls rp vtp-domain domain_name 分配路由器接口到VTP域中2600(config-if)# mls rp vlan-id VLAN_# 向接口分配VLAN2600(config-if)# mls rp management-interface 指定该接口为管理接口2600# show mls rp 提供全局MLS信息2600# show mls rp interface type slot_#/port_# 提供指定接口的MLS信息2600# show mls rp vtp-domain domain_name 提供VTP域的MLS信息6500>(enable) set mls enable 在MLS-SE上启动MLS6500>(enable) set mls include rp_ip_address 告诉交换机哪一个IP地址是正确的6500>(enable) show mls include 显示外部路由处理器的IP地址列表6500>(enable) set mls flow [destination|destination-source|full] 告诉MLS交换机要缓存候选数据包的哪些信息6500>(enable) show mls entry 显示第三层缓存表6500>(enable) set mls agingtime aging_time 改变缓存的衰老时间〔默认256秒,取值范围是8-2032秒中的8的倍数值〕6500>(enable) set mls agingtime fast fast_aging_time pkt_threshold 改变快速衰老周期和数据包门限值6500>(enable) show mls ip 验证MLS-SE的配置6500>(enable) clear mls entry [destination IP_address] [source IP_address] [flow protocol] [source_port] [destination_port] [all] 删除所有或指定MLS缓存记录3550(config)# ip routing 启动IP路由3550(config)# ip cef 启动CEF3550(config-if)# no switchport 将第二层接口转换为第三层接口3550(config-if)# ip route-cache cef 在接口上启动CEF3550# show ip cef 验证CEF组播3640(config)# ip multicast-routing 启动路由器上的组播服务3640(config-if)# ip pim dense-mode 将接口设置为PIM密集模式3640(config-if)# ip pim sparse-mode 将接口设置为PIM稀疏模式3640(config-if)# ip pim sparsed-dense-mode 将接口设置为PIM稀疏-密集模式3640(config)# ip pim rp-address IP_address group_ACL_# [override] 手工配置RP3640(config)# ip pim send-rp-announce type slot_#/port_# scope ttl_value group-list ACL_# 通告RP组的分配3640(config)# ip pim send-rp-discovery scope ttl_value 配置RP映射代理3640(config-if)# ip multicast ttl-threshold ttl_value 设置TTL门限值3640(config-if)# ip igmp join-group group_address 加入组播组3640# show ip mroute 查看组播信息3640# ping 验证RP之间或其他组播路由器之间的连接3640# mtrace source_IP_address [destination_IP_address] [group] 组播traceroute3640(config-if)# ip cgmp 配置CGMP路由器4000>(enable) set cgmp enable 启动CGMP4000>(enable) show cgmp statistics 查看CGMP统计信息4000>(enable) show multicast group cgmp 查看交换机了解到的组播组信息4000>(enable) set cgmp leave enable 检查由客户端产生的IGMPv2的离开信息4000>(enable) set igmp enable 启动IGMP4000>(enable) ip igmp snooping 启动IGMP探听4000>(enable) set igmp fastleave enable 启动快速离开过程4000>(enable) show igmp statistics 显示交换机上IGMP探听的状态信息QoS 2950(config)# wrr-queue cos-map queue_ID cos_value 建立队列2950(config)# wrr-queue bandwidth bandwidth_value 设置队列门限2950(config)# class-maps name 定义对信息传输分类时的匹配标准2950(config-cmap)# match access-group ACL_# 识别被分类的信息传输2950(config)# policy-map name 确定为接入信息传输所设置的分类标准2950(config-pmap)# class name2950(config-pmap-c)# set ip dscp number2950(config-if)# service-policy input name 对该接口应用策略3550(config)# mls qos 启动QoS3550(config-if)# auto qos voip 在接口上启动自动服务质量3550(config)# priority-list priority_queue_# protocol protocol high|medium|normal|low [list ACL_#] 为优先级队列定义信息流3550(config)# priority-list priority_queue_# queue-limit limit_# 定义特定优先级队列的最大队列空间3550(config-if)# priority-group priority_queue_# 向特定输出接口分配优先级队列3550(config)# queue-list queue_list_# interface type slot_#/port_# queue_number 为一个特定的定制队列定义信息流3550(config)# queue-list queue_list_# queue queue_number byte-count size_in_bytes [limit number_of_queue] 为特定的定制队列定义队列的最大空间3550(config-if)# custom-queue-list custom_queue_number 为特定的输出接口分配优先级队列4840(config)# ip slb serverfarm serverfarm_name 配置SLB冗余4840(config-slb-sfarm)# real IP_address [port_#] 指定虚拟IP地址4840(config-slb-sfarm)# inservice 启动服务器4840(config)# virtual IP_address [network_mask] tcp|udp [port_number|wsp|wsp-wtp|wsp-wtls|wsp-wtp-wtls] [service service_name] 建立虚拟服务器IP地址。
第15章Port Channel 配置15.1 Port Channel 介绍介绍在介绍Port Channel 之前,先介绍一下Port Group 的概念:Port Group 是配置层面上的一个物理端口组,配置到Port Group 里面的物理端口才可以参加链路汇聚,并成为Port Channel 里的某个成员端口。
在逻辑上,Port Group 并不是一个端口,而是一个端口序列。
加入Port Group 中的物理端口满足某种条件时进行端口汇聚,形成一个Port Channel,这个Port Channel 具备了逻辑端口的属性,才真正成为一个独立的逻辑端口。
端口汇聚是一种逻辑上的抽象过程,将一组具备相同属性的端口序列,抽象成一个逻辑端口。
Port Channel 是一组物理端口的集合体,在逻辑上被当作一个物理端口。
对用户来讲,完全可以将这个Port Channel 当作一个端口使用,因此不仅能增加网络的带宽,还能提供链路的备份功能。
端口汇聚功能通常在交换机连接路由器、主机或者其他交换机时使用。
图15-1 端口聚合示意图如上图中显示交换机S1 的1-4 号端口汇聚成一个Port Channel,该Port Channel 的带宽为4 个端口带宽的总和。
而S1 如果有流量要经过Port Channel 传输到S2,S1 的Port Channel 将根据流量的源MAC 地址及目的MAC 地址的最低位进行流量分配运算,根据运算结果决定由Port Channel 中的某一成员端口承担该流量。
当Port Channel 中的一个端口连接失败,原应该由该端口承担的流量将再次通过流量分配算法分配给其他连接正常的端口分担。
流量分配算法由交换机的硬件决定的。
神州数码交换机提供了两种配置端口汇聚的方法:手工生成Port Channel、LACP(Link Aggregation Control Protocol)动态生成Port Channel。
只有双工模式为全双工模式的端口才能进行端口汇聚。
为使Port Channel 正常工作,本交换机Port Channel 的成员端口必须具备以下相同的属性:端口均为全双工模式;端口速率相同;端口的类型必须一样,比如同为以太口或同为光纤口;端口同为Access 端口并且属于同一个VLAN 或同为Trunk 端口;如果端口为Trunk 端口,则其Allowed VLAN 和Native VLAN 属性也应该相同。
当交换机通过手工方式配置Port Channel 或LACP 方式动态生成Port Channel,系统将自动选举出Port Channel 中端口号最小的端口作为Port Channel 的主端口(Master Port)。
若交换机打开Spanning-tree 功能,Spanning-tree 视Port Channel 为一个逻辑端口,并且由主端口发送BPDU 帧。
另外,端口汇聚功能的实现与交换机所使用的硬件有密切关系,神州数码交换机支持任意两个交换机物理端口的汇聚,最大组数为6 个,组内最多的端口数为8 个。
汇聚端口一旦汇聚成功就可以把它当成一个普通的端口使用,在交换机中还建立了汇聚接口配置模式,与vlan 和物理接口配置模式一样,用户能在汇聚接口配置模式下对汇聚端口进行相关的配置。
15.2 Port Channel 配置15.2.1 Port Channel 配置任务序列1.全局模式下建立一个port group2.分别在端口模式下将这些端口加入指定的group3.进入port-channel配置模式15.2.2 Port Channel 配置命令15.2.2.1 port-group命令:port-group <port-group-number> [load-balance { src-mac|dst-mac|dst-src-mac | src-ip| dst-ip|dst-src-ip}]no port-group <port-group-number> [load-balance]功能:新建一个port group,并且设置该组的流量分担方式。
如果没有指定流量分担方式则为设置默认的流量分担方式。
该命令的no 操作为删除该group 或者恢复该组流量分担的默认值,敲入load-balance 表示恢复默认流量分担,否则为删除该组。
参数:<port-group-number> 为Port Channel 的组号,范围为1~16,如果已经存在该组号则会报错。
dst-mac 根据目的MAC 进行流量分担;src-mac 根据源MAC 地址进行流量分担;dst-src-mac 根据目的MAC 和源MAC 进行流量分担;dst-ip 根据目的IP 地址进行流量分担;src-ip 根据源IP 地址进行流量分担;dst-src-ip 根据目的IP 和源IP 进行流量分担。
如果是修改流量分担方式,并且该port-group 已经形成一个port-channel,则这次修改的流量分担方式只有在下次再次汇聚时才会生效。
缺省情况:缺省交换机端口不属于Port Channel,不启动LACP 协议命令模式:交换机全局配置模式举例:新建一个port group,并且采用默认的流量分担方式Switch(Config)#port-group 1删除一个port groupSwitch(Config)#no port-group 115.2.2.2 port-group mode命令:port-group <port-group-number> mode {active|passive|on}no port-group <port-group-number>功能:将物理端口加入Port Channel,该命令的no 操作为将端口从Port Channel 中去除参数:<port-group-number> 为Port Channel 的组号,范围为1~16;active(0)启动端口的LACP 协议,并设置为Active 模式;passive(1)启动端口的LACP 协议,并且设置为Passive 模式;on(2)强制端口加入Port Channel,不启动LACP 协议。
命令模式:交换机接口配置模式缺省情况:缺省交换机端口不属于Port Channel,不启动LACP 协议使用指南:如果不存在该组则会先建立该组,然后再将端口加到组中。
在一个port-group 中所有的端口加入的模式必须一样,以第一个加入该组的端口模式为准。
端口以on 模式加入一个组是强制性的,所谓强制性的表示本端交换机端口汇聚不依赖对端的信息,只要在组中有2 个以上的端口,并且这些端口的vlan 信息都一致则组中的端口就能汇聚成功。
端口以active 和passive 方式加入一个组是运行lacp 协议的,但两端必须有一个组中的端口是以active 方式加入的,如果两端都是passive,端口永远都无法汇聚起来。
举例:在Ethernet0/0/1 端口模式下,将本端口以active 模式加入port-group 1Switch(Config)int e 0/0/1Switch(Config-Ethernet0/0/1)#port-group 1 mode active15.2.2.3 interface port-channel命令:interface port-channel <port-channel-number>功能:进入汇聚接口配置模式命令模式:全局配置模式缺省情况:使用指南:进入汇聚端口模式下配置时,如果是对gvrp,spanningtree 模块做配置则对汇聚端口生效,如果汇聚端口不存在,也就是说在端口没有汇聚起来时先提示错误信息,记录该用户配置操作,当端口真正汇聚起来以后恢复用户刚才对未形成汇聚端口的配置动作,注意只能恢复一次,如果因为某种原因汇聚组被拆散然后又汇聚起来,用户一开始的配置不能被恢复。
如果是对其他模块做配置,比如做shutdown 配置,则是对该port-channel 对应的port-group 中的所有成员端口生效,起到一个群配的作用。
举例:进入port-channel1 配置模式Switch(Config)#interface port-channel 1Switch(Config-If-Port-Channel1)#15.3 Port Channel 举例案例1:以LACP 方式配置Port Channel。
图15-2 以LACP 方式配置Port Channel在下面说明中都用Switch 来表示神州数码交换机。
如图所示,交换机Switch1 上的1,2,3 端口都是access 口,并且都属于vlan 1,将这三个端口以active 方式加入group 1,Switch2 上6,8,9 端口为trunk 口,并且是allow all,将这三个端口以passive 方式加入group 2,将以上对应端口分别用网线相连。
配置步骤如下:Switch1#configSwitch1 (Config)#interface eth 0/0/1-3Switch1 (Config-Port-Range)#port-group 1 mode activeSwitch1 (Config-Port-Range)#exitSwitch1 (Config)#interface port-channel 1Switch1 (Config-If-Port-Channel1)#Switch2#configSwitch2 (Config)#port-group 2Switch2 (Config)#interface eth 0/0/6Switch2 (Config-Ethernet0/0/6)#port-group 2 mode passiveSwitch2 (Config-Ethernet0/0/6)#exitSwitch2 (Config)# interface eth 0/0/8-9Switch2 (Config-Port-Range)#port-group 2 mode passiveSwitch2 (Config-Port-Range)#exitSwitch2 (Config)#interface port-channel 2Switch2 (Config-If-Port-Channel2)#配置结果:过一段时间后,shell 提示端口汇聚成功,此时Switch1 的端口1,2,3 汇聚成一个汇聚端口,汇聚端口名为Port-Channel1,Switch2 的端口6,8,9 汇聚成一个汇聚端口,汇聚端口名为Port-Channel2,并且都可以进入汇聚接口配置模式进行配置。