2022年思科交换机配置常用命令

上传人:s9****2 文档编号:567432755 上传时间:2024-07-20 格式:PDF 页数:6 大小:75.68KB
返回 下载 相关 举报
2022年思科交换机配置常用命令_第1页
第1页 / 共6页
2022年思科交换机配置常用命令_第2页
第2页 / 共6页
2022年思科交换机配置常用命令_第3页
第3页 / 共6页
2022年思科交换机配置常用命令_第4页
第4页 / 共6页
2022年思科交换机配置常用命令_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《2022年思科交换机配置常用命令》由会员分享,可在线阅读,更多相关《2022年思科交换机配置常用命令(6页珍藏版)》请在金锄头文库上搜索。

1、Cisco 三层交换机配置命令及解释(2011-07-11 08:54:50)标签:cisco杂谈分类:IT 资讯基本配置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 接上一条

2、命令,设置控制台口令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 sh

3、utdown 关闭或启用该接口默认启用S(config)# ip address IP_address sunbet_mask 指定 IP 地址S(config)# ip default-gateway routers_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

4、系列上可用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 表中创建

5、静态条目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_port list_of_allowed_interface 设置静态端口安全措施1900(config-if)# port secure 启用粘性学习1900(config-if)# port secure max-mac-count v

6、alue 设置粘性学习特性能够学到的地址数量默认 132,取值范围是1-1321900(config)# address-violation suspend|ignore|disable 改变安全选项精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 1 页,共 6 页1900 show mac-address-table security 验证端口安全措施2950(config)# switchport mode access 定义接口为主机端口而不是中继端口2950(config)# switchport port-security 启用端口安全措

7、施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 stic

8、ky 启用粘性学习特性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 服务器上恢复配置到 NVRA

9、M 1900# 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

10、_# 启用 /禁用接口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)

11、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 口令190

12、0(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

13、VTP_password 配置 VTP 口令精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 2 页,共 6 页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 指定中

14、继类型1900# show trunk A|B 验证接口中继A 是 fa0/26,B 是 fa0/272950(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# s

15、how interfaces type 0/port_# switchport|trunk 验证接口中继1900(config)# vlan VLAN_# name VLAN_name 创建 VLAN 1900(config-if)# vlan-membership static VLAN_# 将该接口静态地分配给一个VLAN 1900# show vlan 验证 VLAN 1900# show vlan-membership 查看 VLAN 成员关系1900# show spantree VLAN_# 查看 VLAN 的 STP 信息2950# vlan database 进入 VLAN 数

16、据库前用2950(vlan)# vlan VLAN_# name VLAN_name 创建 VLAN 2950(config)# vlan VLAN_# 进入 VLAN 数据库后用2950(config-vlan)# name VLAN_name 创建 VLAN 2950(config-if)# switchport mode access 指定连接是接入链路连接2950(config-if)# switchport access vlan VLAN_# 指定 VLAN是接入链路连接4000(enable) set vlan VLAN_# name VLAN_name 配置 VLAN 4000

17、(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_# 删除 VLAN 4000(enable) show trunk slot_#/port_# 验证中继端口4000(enable) set vtp v2 enable 配

18、置 VTPv2 4000(enable) set vtp domain name mode client|server|transparent passwd password pruning enable|disable v2 enable|disable 设置 VTP 4000(enable) show vtp domain 验证 VTP 域的信息4000(enable) show vtp statistics 显示发出或收到的VTP 通告信息的摘要内容4000(enable) set vtp pruneeligible VLAN_# 设置 VTP 消减4000(enable) clear

19、vtp pruneeligible VLAN_# 清除不希望消减的VLAN STP 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_di

20、ameter hello hello_time 设置主根节点桥、备份节点桥、最大桥数量2-7、持续时间1-10,默认 24000(enable) set spantree portcost slot_#/port_# cost_# 设置端口开销2950(config-if)# spanning-tree cost cost_# 设置端口开销精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 3 页,共 6 页4000(enable) set spantree portpri slot_#/port_# priority_# 设置端口优先级4000(en

21、able) 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_# 设置根节

22、点交换机发送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

23、 的时间间隔默认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 gro

24、up_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 配置 PortFast 2950(config-if)# spanning-tree portfast 配置 PortFast 4000(enable) set spantree uplinkfast en

25、able|disable rate station_update_rate all-protocols off|on 启用 /禁用 UplinkFast 4000(enable) show spantree uplinkfast 验证 UplinkFast 配置2950(config)# spanning-tree uplinkfast max_update_rate 启用 /禁用 UplinkFast 2950# show spanning-tree uplinkfast 验证 UplinkFast 配置4000(enable) set spantree backbonefast enabl

26、e|disable 启用 /禁用 BackboneFast 4000(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 m

27、odule 查看交换机的硬件配置4000(enable) session module_# 访问 L3SM L3SM(config-if)# mac-address mac_address 分配 MAC 地址MLS 2600(config)# mls rp ip 启动 MLS 2600(config-if)# mls rp vtp-domain domain_name 分配路由器接口到VTP 域中2600(config-if)# mls rp vlan-id VLAN_# 向接口分配VLAN 2600(config-if)# mls rp management-interface 指定该接口为

28、管理接口2600# show mls rp 提供全局MLS 信息2600# show mls rp interface type slot_#/port_# 提供指定接口的MLS 信息精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 4 页,共 6 页2600# show mls rp vtp-domain domain_name 提供 VTP 域的 MLS 信息6500(enable) set mls enable 在 MLS-SE 上启动 MLS 6500(enable) set mls include rp_ip_address 告诉交换机哪一

29、个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_

30、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 启动 CEF 3550(config-if)# no switchpor

31、t 将第二层接口转换为第三层接口3550(config-if)# ip route-cache cef 在接口上启动CEF 3550# 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(

32、config)# ip pim rp-address IP_address group_ACL_# override 手工配置RP 3640(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(

33、config-if)# ip igmp join-group group_address 加入组播组3640# show ip mroute 查看组播信息3640# ping 验证 RP 之间或其他组播路由器之间的连接3640# mtrace source_IP_address destination_IP_address group 组播 traceroute 3640(config-if)# ip cgmp 配置 CGMP 路由器4000(enable) set cgmp enable 启动 CGMP 4000(enable) show cgmp statistics 查看 CGMP 统计

34、信息4000(enable) show multicast group cgmp 查看交换机了解到的组播组信息4000(enable) set cgmp leave enable 检查由客户端产生的IGMPv2 的离开信息4000(enable) set igmp enable 启动 IGMP 4000(enable) ip igmp snooping 启动 IGMP 探听4000(enable) set igmp fastleave enable 启动快速离开过程4000(enable) show igmp statistics 显示交换机上IGMP 探听的状态信息QoS 2950(conf

35、ig)# wrr-queue cos-map queue_ID cos_value 建立队列2950(config)# wrr-queue bandwidth bandwidth_value 设置队列门限精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 5 页,共 6 页2950(config)# class-maps name 定义对信息传输分类时的匹配标准2950(config-cmap)# match access-group ACL_# 识别被分类的信息传输2950(config)# policy-map name 确定为接入信息传输所设置的

36、分类标准2950(config-pmap)# class name 2950(config-pmap-c)# set ip dscp number 2950(config-if)# service-policy input name 对该接口应用策略3550(config)# mls qos 启动 QoS 3550(config-if)# auto qos voip 在接口上启动自动服务质量3550(config)# priority-list priority_queue_# protocol protocol high|medium|normal|low list ACL_# 为优先级队列

37、定义信息流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

38、 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 地址精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 6 页,共 6 页

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号