CISCO交换机常用维护手册.docx
CISCO交换机常用维护手册 CISCO 4507R 系列路由器维护手册 基本信息配置 1. 用en进全局模式下,再用conf t,进入配置模式,进行以下的配置: 管理方面的配置: enable secret 0 xxxxx line vty 0 4 exec-timeout 30 0 password 0 xxxx login service password-encryption 2. 时间设置与查看命令: Switch# clock set 11:11:11 14 feb 2022 Switch# show clock 3. 主机名设置: Switch(config)# hostname RRR 4. 主机信息查看: Switch#show version /用来查看启动时间,硬件配置,IOS版本,上次启动方式,存储器使用状态等信息。 5. 配置信息: Switch#show running-config /查看内存RAM配置信息,当前工作状态时的配置信息。 Switch#show startup-config /查看NVRAM配置信息,启动时加载的配置信息。 6. 每日登录标语配置: Banner motd # Forbidden Area # 7. CDP配置: Show cdp interface /显示CDP邻居接口运行情况 Show cdp neighbors /显示cdp邻居信息 Show cdp neighbor detail /显示详细邻居信息 Switch(config-if)# no cdp enable /在端口上关闭cdp功能 Switch(config)# no cdp run / 关闭cdp功能 Switch#clear cdp table /删除cdp 表 8. 交换机模式转换命令: Switch> 用户模式/默认登录 Switch# 特权模式/enable Switch(config)#全局模式/configure terminal Switch(config-if)# 接口模式/interface f0/0 Rommon> 交换机启动时给中断信号后进入的应急模式或高级操作模式9. 启用三层交换功能 Switch(config)#ip routing 10 设置vlan n Switch(config)#vlan 2 Switch(config-vlan)#name vlan 2 Switch(config)#exit Switch(config-if)# switch mode access Switch(config-if)# switch mode access vlan 2 11 配置etherchannel Switch(config)int port-channel 1 /建立捆绑口 Switch(config)int range fa0/1-2 / Switch(config-if)channel-group 1 mode on / 将端口归属到捆绑口上Switch(config-if)switchport mode trunk enc dot1q / 定义TRUNK封装Switch(config-if)switchport mode trunk / Switch(config)port-channel load-balance dst-ip /定义负载方式 检验命令:show etherchannel summary 常用端口配置 1配置接口速率和双工 Switch(config-if)#speed 10 | 100 | auto(速度) Switch(config-if)# duplex auto | full | half(双工) Switch(config-if)#des 描述字 Switch(config-if)#shutdown 关闭接口 Switch(config-if)#no sh 开启接口 2 配置三层接口 Switch(config-if)# ip add ip mask 3 配置trunk接口 Switch(config)# interface fastethernet x/y (以fastethernet为例,gigabitethernet一样)Switch(config-if)# shutdown Switch(config-if)# switchport Switch(config-if)# switchport mode dynamic desirable|trunk|auto Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# switchport trunk allowed vlan 2-3 Switch(config-if)# no shutdown Switch(config-if)# end Switch# exit 4端口划分vlan Switch(config-if)# switch mode access Switch(config-if)# switch mode access vlan 2 5常用端口查看命令 Switch# show int fa0/0 Switch# show controllers s0/0 Switch# show ip interface fa0/0 Switch# show ip int brief Switch# show vlan all /查看vlan信息 Switch#show int trunk /查看trunk 端口 6.修改NATIVE VLAN Switch(config-if)# switchport trunk native vlan 10 7交换机端口安全 Switch(config-if)# switch port-securitiy Switch(config-if)# switch port-securitiy maximum 1 /设置端口绑定mac地址数量 Switch(config-if)# switch port-securitiy violation shutdown|protect|restrict /设置违规保护方式 第3 页共7 页 常用高级配置 1. 配置HSRP 在其中一台4507上按下面模版进行配置 interface Vlan x /可选 ip address 本机端口ip mask standby 1 虚拟ip standby 1 preempt standby 1 priority 100 可选standby 1 authentication 字符串 Standby 1 时间参数1 时间参数2 / hello时间间隔1 失效时间间隔2 Standby 1 track portnumber/没有实际意义 在另一台4507上按下面模版进行配置 interface Vlan x /可选 ip address 本机端口ip mask standby 1 虚拟ip standby 1 preempt standby 1 priority 100 可选standby 1 authentication 字符串 Standby 1 时间参数1 时间参数2 / hello时间间隔1 失效时间间隔2 Standby 1 track portnumber/没有实际意义 2. 基于策略的限速(QOS)配置 1. Switch(config)# mls qos 2. Access-list 12 permit 1.1.1.2 0.0.0.255 /用访问控制列表定义流量 3. Switch(config)# class-map name Switch(config-cmap)# access-group 12 4. Switch(config)# policy-map name Switch(config-pmap)#class name Switch(config-pmap)#trust dscp Switch(config-pmap)#police exceed-action drop 5. Switch(config-if)#service-policy input name 日常维护及故障处理 1. 常用系统检查命令: sh proc cpu / 检查cpu使用情况 sh flash: /检查flash 内容 sh mem /检查ram使用情况 sh buffer /查看动态缓存利用状况 sh env all /检查风扇,温度,电源状态 sh module /检查机器板卡模块 sh redundancy status / 检查冗余备引擎状态 sh redundancy history /检查冗余主备引擎之间的状态 sh redundancy switchover /检查系统状态 sh log /检查系统日志 sh run sh startup-config 2. 系统配置备份命令: wr /配置保存命令 copy run startup /同wr copy flash: ios tftp: /备份ios copy run tftp / 备份running-config 3. 全面系统信息查看命令 Show tech-support /全部系统状态信息的批处理显示建议利用secure-crt软件将其定期拷贝出来。 4. 排障命令汇总 Ping /traceroute/telnet /故障查询 sh ip arp /在线地址 sh mac-add /接口下硬件地址学习汇总 sh proc cpu /检查cpu 利用率 sh log /检查系统信息状态 sh int /检查端口各数据包状态 sh vlan b / 检查vlan信息状态 故障分析步骤采用自顶向下,由应用层向物理层排错的顺序。 第5 页共7 页 路由器安全加固配置 1.利用访问控制列表限制telnet和不必要的访问: Switch(Config)# no access-list 101 Switch(Config)# access-list 101 permit ip 192.168.0.0 0.0.0.255 any Switch(Config)# access-list 101 deny ip any any log Switch(Config)# interface eth 0/1 Switch(Config-if)# description "internet Ethernet" Switch(Config-if)# ip address 192.168.0.254 255.255.255.0 Switch(Config-if)# ip access-group 101 in 2.全部密码采用加密机制: Switch(Config)#service password-encryption 3.禁止不常用服务如cdp ,finger, http, tcp/udp-small等 Switch(Config)#no cdp run Switch(Config-if)# no cdp enable Switch(Config)# no service tcp-small-servers Switch(Config)# no service udp-samll-servers Switch(Config)# no ip finger Switch(Config)# no service finger Switch(Config)# no ip http server Switch(Config)# no ip domain-lookup 4.建议禁止SNMP协议服务。在禁止时必须删除一些SNMP服务的默认配置。或者需要访问列表来 过滤。如: Switch(Config)# no snmp-server community public Ro Switch(Config)# no snmp-server community admin RW Switch(Config)# no access-list 70 Switch(Config)# access-list 70 deny any Switch(Config)# snmp-server community MoreHardPublic Ro 70 Switch(Config)# no snmp-server enable traps Switch(Config)# no snmp-server system-shutdown Switch(Config)# no snmp-server trap-anth Switch(Config)# no snmp-server Switch(Config)# end 5.建议采用权限分级策略。如: Switch(Config)#username BluShin privilege 10 G00dPa55w0rd Switch(Config)#privilege EXEC level 10 telnet Switch(Config)#privilege EXEC level 10 show ip access-list 第7 页共7 页