########################################################################################## 1900 基本配置: Switch(config)# hostname 1900 Switch(config)# enable password level 1-15 密码 (用户EXEC级别为1至特权EXEC级别15) Switch(config)# enable secret quansheng Switch(config)# line console 0 Switch(config-line)# password quansheng Switch(config)# line vty 0 15 (为telnet设置密码) Switch(config-line)# password quansheng Switch(config-line)# login 1900 IP寻址: (与2950区别:1900进入接口模式 2950进入VLAN) Switch(config)# interface e0/1 Switch(config-if)# ip address 192.168.0.10 255.255.255.0 Switch(config-if)# no shutdown Switch(config-if)# exit Switch(config)# ip default-gateway 192.168.0.1 1900 vlan vtp配置: 1900(config)# vtp domain 域名 (必须有) 1900(config)# vtp server|client|transparent (设置交换机为服务器|客户端|透明,默认启用server) 1900(config)# vtp password 密码 (设置密码,发送VTP信息与其它交换机匹配) 1900(config)# vtp pruning enable|disable (默认启用修剪) 1900(config)# vtp trap enable|disalbe (默认启用陷阱) 1900 中继配置: 1900(config)# interface f0/1 1900(config-if)# trunk on | off | desirable | auto (记住1900只支持ISL中继, show trunk A|B,接口A指f0/26,B指f0/27) 1900 VLAN配置: 1900(config)# vlan [2-64] name VLAN名称 1900(config)# ineterface f0/1 1900(config-if)# vlan-membership static 2 (为接口分配所属VLAN号) 1900# show vlan (查看VLAN配置信息) 1900# show vlan-membership 1900# show spantree 1 (查看DTP信息) ############################################################################################ 2950 vlan vtp配置: 2950# vlan database (与1900不同之处,必须进入特权EXEC模式) 2950(vlan)# vtp domain 域名 (必须有) 2950(vlan)# vtp server|client|transparent (设置交换机为服务器|客户端|透明,默认启用server) 2950(vlan)# vtp password 密码 (设置密码,发送VTP信息与其它交换机匹配) 2950(vlan)# vtp pruning (默认禁用) 2950(vlan)# abort (默认禁用) 或 2950(vlan)# exit 2950# configure terminal 2950(config)# snmp-server enable traps vtp 2950# show vtp stutus (查看VTP状态信息) 2950# show vtp counters (显示VTP消息发送与接收统计信息) 2950(config)# switchport trunk pruning vlan remove 2-4,6,8(用逗号分隔不连续的VLAN ID,其间不要有空格,用短线表明一个ID范围 。比如去除VLAN2、3、4、6和8) 2950 中继配置: (2950所有端口都支持中继) 2950(config)# interface type 0/1 2950(config-if)# switchport mode trunk | dynamic desirable | dynamic auto | nonegotiate 2950(config-if)# switchport trunk [native vlan vlan_#] 2950# show interface f0/1 switchport | trunk (查看中继配置) 2950# show interfaces trunk 2950 VLAN配置: 2950# vlan database 2950(config)# vlan 2 name [vlan名称] 2950(config)# interface f0/1 (为接口分配所属VLAN号) 2950(config-if)# switchport mode access 2950(config-if)# switchport access vlan 2 2950 IP寻址: Switch(config)# interface vlan 1 Switch(config-vlan)# ip address 192.168.0.10 255.255.255.0 Switch(config-vlan)# exit Switch(config)# ip default-gateway 192.168.0.1 ############################################################################################ 2600 路由器基本配置: Router(config)# line console 0 Router(config-line)# password quansheng Router(config)# line aux 0 Router(config-line)# password quansheng Router(config)# line vty 0 4 Router(config-line)# login Router(config-line)# password quansheng Router(config)# banner motd $ 内容 $ Router(config)# banner motd ' 内容 ' Router(config)# line console 0 Router(config-line)# exec-timeout 0 0 (禁用终端超时功能,默认10分钟) Router(config-if)# description 描述内容 Router(config)# interface f0/1 Router(config-if)# media-type 类型 (aui,10baset,100baset和mii) Router(config-if)# speed 10|100|auto Router(config-if)# no half-duplex Router# show controller serial 0/1 (查看serial端口类型CE,DTE,以DCE传输速率为标准) Router(config)# interface s0/1 Router(config-if)# clock rate 64000 (1200,2400,4800,9600,19200,38400,56000,64000,72000,125000,148000,500000,800000,1000000,1300000,2000000,4000000) Router(config-if)# bandwidth 56 (默认1554kbit/s) Router(config)# interface f0/0 Router(config-if)# [no] ip directed-broadcast (启用定向广播) Router(config)# ip host [name_of_host] [tcp-port] [ip1_address] [ip2_address] Router(config)# ip name-server [ip1_address_DNS_server] [ip1_address_DNS_server] Router(config)# no ip domain-lookup (禁用DNS查询) CDP配置: Router(config)# interface f0/1 Router(config-if)# [no] cdp enable Router# show cdp Router# show cdp interface Router# show cdp neighbors Router# show cdp neighbors detail (查看详细清单) Router# show cdp entry [neighbors-name] Router# show cdp traffic (查看CDP流量) 一.密码恢复 1.在配置模式中改动寄存器 Router(config)#config-register 0x2142 (修改寄存器值) 2.在ROM Monitor模式中改动寄存器并恢复密码 a. 重新启动路由器,按CTRL-BREAK进入ROMMON模式 b. rommon 5 > confreg 0x2142 或 > o/r 0x2142 (2500路由器不支持confreg),(使其跳过NVRAM配置信息) c. Router# config memory (恢复NVRAM) d. Router(config)# enable secret sisco (重置密码) e. Router(config)# config-register 0x2102 (恢复寄存器值) f. Router# copy running-config startup-config (保存配置) 二,灾难恢复 1. rommon 1 > tftpdnld 2. rommon 2 > IP_ADDRESS 192.168.18.10 (为本地路由器设置IP地址) 3. rommon 3 > IP_SUBNET_MASK = 255.255.255.0 DEFAULT_GATEWAY =192.168.18.1 4. rommon 4 > TFTP_SERVER =192.168.18.11 (指定TFTP IP地址) 5. rommon 5 > TFTP_FILE = c2600-is-mz.121-26.bin (指定下载的IOS系统镜像名) 6. rommon 6 > TFTPdnld (正式下载)
|