1、cisco网络技术大赛决赛笔记一、密码恢复和IOS 的恢复:密码恢复:1、 在路由器上配置密码:/故意设置一个自己也记不住的密码,以供密码恢复使用。2、 路由器密码恢复,关闭路由器电源 并重新开机,当控制台出现启动过程时,赶快按住Ctrl+Break键中端路由器启动过程,进入rommon模式。3、rommon 1confreg 0x2142/改变配置寄存器的值为0x2142, 这会使得路由器开机不读取NVRAM 中配置文件rommon 2reset/重启路由器。路由器重启后会直接进入到setup 配置模式, 使用【Ctrl+C】键或者回答” n”退出setup 模式RouterenableRo
2、uter#copy startup -config running-configDestination filenamerunning -config?661 bytes copied in 0.625 secs/把配置文件 从NVRAM 中复制到RAM 中, 在此基础上修改密码R2#configure teminalR2(config)enable password cisco/以上把密码改自己的密码, 如果还配置别的密码请把它们一一修改了R2(config)#config -register 0x2102/以上把寄存器的值恢复为正常值0x2102R2(config)#exitR2#copy
3、 running -config startup -configDestination filenamestartup -config?Building configuration. OKR2#reload/以上是保存配置, 重启路由器, 检查路由器是否正常【提示】在保存配置前, 还需要把路由器的各个接口一一打开。IOS恢复:故意删除FLASH 中的IOS, 我们要恢复IOSR2#show flash;R2#delete flash ; c2800nm-adventerprisek9 -mz.124-11.T1.bin恢复IOS请确认IOS 已经放在c;TFTP-Root 目录下。路由器丢失了
4、IOS 后,开机将自动进入rommon 模式rommon 2IP_ADDRESS=172.16.0.2rommon 3IP_SUBNET_MASK=255.255.0.0rommon 4DEFAULT_GATEWAY=172.16.0.100rommon 5TFTP_SERVER=172.16.0.100rommon 6TFTP_FILE=c2800nm-adventerprisek9 -mz.124-11.T1.binrommon 7tftpdnld二、RIPv2 认证和触发更新(1)步骤1:配置路由器R1 R1(config)#key chain test /配置钥匙链 R1(config
5、-keychain)#key 1 /配置KEY ID R1(config-keychain-key)#key-string cisco /配置 KEY ID 的密匙 R1(config)#interface s0/0/0 R1(config-if)#ip rip authentication mode text /启用认证,认证模式为明文,默认认证模式就是明文,所以也可以不用指定 R1(config-if)#ip rip authentication key-chain test /在接口上调用钥匙链 R1(config-if)#ip rip triggered /在接口上启用触发更新 (2)
6、步骤2:配置路由器R2 R2(config)#key chain test R2(config-keychain)#key 1 R2(config-keychain-key)#key-string cisco R2(config)#interface s0/0/0 R2(config-if)#ip rip triggered R2(config-if)#ip rip authentication key-chain test R2(config)#interface s0/0/1 R2(config-if)#ip rip authentication key-chain test R2(con
7、fig-if)#ip rip triggered (3)步骤3:配置路由器R3 R3(config)#key chain test R3(config-keychain)#key 1 R3(config-keychain-key)#key-string cisco R3(config)#interface s0/0/0 R3(config-if)#ip rip authentication key-chain test R3(config-if)#ip rip triggered R3(config)#interface s0/0/1 R3(config-if)#ip rip authenti
8、cation key-chain test R3(config-if)#ip rip triggered (4)步骤4:配置路由器R4 R4(config)#key chain test R4(config-keychain)#key 1 R4(config-keychain-key)#key-string cisco R4(config)#interface s0/0/0 R4(config-if)#ip rip authentication key-chain test R4(config-if)#ip rip triggered 三、ccna安全设置ntp:ntp server 192.
9、168.1.5 /设置ntp服务器ntp update-calendar /该全局命令使N T P周期性地更新Cisco 7XXX 系列路由器的日历service timestamps log datetime msec /配置系统日志记录时间格式设置Syslog Server:logging 192.168.1.6配置ssh:ip domain-name username SSHadmin privilege 15 secret ciscosshpa55line vty 0 15login localtransport input sshcrypto key generate rsaip s
10、sh version 2ip ssh authentication-retries 2ip ssh time-out 90配置本地AAA认证for console access on R1:username Admin1 password admin1pa55 /配置本地用户名aaa new-model /启用AAA认证aaa authentication login default local /使用本地数据库R1(config-line)#login authentication default /configure AAA authentication for console login
11、 to use the default method list.Configure Local AAA Authentication for VTY Lines on R1R1(config)#aaa authentication login TELNET-LOGIN local /Configure a named list calledTELNET-LOGINto authenticate logins using local AAA.R1(config-line)#login authentication TELNET-LOGIN /Configure the VTY lines to
12、use the named AAA methodAAATACACS+认证:Username Admin password adminpa55tacacs-server host 192.168.2.2tacacs-server key tacacspa55aaa new-modelR2(config)# aaa authentication login default group tacacs+ local /configure all logins to authenticate using the AAA TACACS+ server and if not available, then
13、use the local database.R2(config-line)#login authentication defaultAAARADIUS认证:Username Admin password adminpa55radius-server host 192.168.3.2 radius-server key radiuspa55R3(config)#aaa new-modelR3(config)#aaa authentication login default group radius localR2(config-line)#login authentication defaul
14、t基本上可以通用的复制粘贴命令:根据以下说明对 BRANCH、HQ 和 ISP 路由器进行基本配置: 1. 配置路由器主机名。 2. 禁用 DNS 查找。 3. 配置执行模式口令。 4. 配置当日消息标语。 5. 配置控制台连接的口令。 6. 配置 VTY 连接的口令。 7. 将自动提供的消息和调试输出与所请求的输出以及控制台和虚拟终端线路的提示符相同步。 8. 将执行超时配置为 15 分钟。enconf tip domain-lookupena pass ciscoena sec classban motd “”line con 0pass ciscologinline vty 0 15pa
15、ss ciscologin四、OSPF 认证基于区域的 OSPF简单口令认证:配置路由器R1 R1(config)#router ospf 1 R1(config-router)#router-id 1.1.1.1 R1(config-router)#network 192.168.12.0 255.255.255.0 area 0 R1(config-router)#network 1.1.1.1 255.255.255.0 area 0 R1(config-router)#area 0 authentication /区域0启用简单口令认证 R1(config)#interface s0/
16、0/0 R1(config-if)#ip ospf authentication-key cisco /配置认证密码 配置路由器R2 R2(config)#router ospf 1 R2(config-router)#router-id 2.2.2.2 R2(config-router)#network 2.2.2.2 255.255.255.0 area 0 R2(config-router)#network 192.168.12.0 255.255.255.0 area 0 R2(config-router)#area 0 authentication R2(config)#interf
17、ace s0/0/0 R2(config-if)#ip ospf authentication-key cisco基于区域的 OSPF MD5 认证配置路由器R1 R1(config)#router ospf 1 R1(config-router)#router-id 1.1.1.1 R1(config-router)#network 192.168.12.0 255.255.255.0 area 0 R1(config-router)#network 1.1.1.1 255.255.255.0 area 0 R1(config-router)#area 0 authentication me
18、ssage-digest /区域 0启用 MD5认证 R1(config)#interface s0/0/0 R1(config-if)#ip ospf message-digest-key 1 md5 cisco /配置认证key ID 及密匙 配置路由器R2 R2(config)#router ospf 1 R2(config-router)#router-id 2.2.2.2 R2(config-router)#network 2.2.2.2 255.255.255.0 area 0 R2(config-router)#network 192.168.12.0 255.255.255.0
19、 area 0 R2(config-router)# area 0 authentication message-digest R2(config)#interface s0/0/0 R2(config-if)# ip ospf message-digest-key 1 md5 cisco基于链路的 OSPF简单口令认证配置路由器R1 R1(config)#router ospf 1 R1(config-router)#router-id 1.1.1.1 R1(config-router)#network 192.168.12.0 255.255.255.0 area 0 R1(config-
20、router)#network 1.1.1.1 255.255.255.0 area 0 R1(config)#interface s0/0/0 R1(config-if)#ip ospf authentication /链路启用简单口令认证 R1(config-if)#ip ospf authentication-key cisco /配置认证密码 配置路由器R2 R2(config)#router ospf 1 R2(config-router)#router-id 2.2.2.2 R2(config-router)#network 2.2.2.2 255.255.255.0 area 0
21、 R2(config-router)#network 192.168.12.0 255.255.255.0 area 0 R2(config)#interface s0/0/0 R2(config-if)# ip ospf authentication R2(config-if)# ip ospf authentication-key cisco基于链路的 OSPF MD5 认证配置路由器R1 R1(config)#router ospf 1 R1(config-router)#router-id 1.1.1.1 R1(config-router)#network 192.168.12.0 2
22、55.255.255.0 area 0 R1(config-router)#network 1.1.1.1 255.255.255.0 area 0 R1(config)#interface s0/0/0 R1(config-if)#ip ospf authentication message-digest /接口 s0/0/0启用MD5 认证 R1(config-if)#ip ospf message-digest-key 1 md5 cisco /配置认证key ID 及密匙 配置路由器R2 R2(config)#router ospf 1 R2(config-router)#router
23、-id 2.2.2.2 R2(config-router)#network 2.2.2.2 255.255.255.0 area 0 R2(config-router)#network 192.168.12.0 255.255.255.0 area 0 R2(config)#interface s0/0/0 R2(config-if)# ip ospf authentication message-digest R2(config-if)# ip ospf message-digest-key 1 md5 cisco五、ospf高级配置1、stub区域:会产生区域间路由和区域内路由,不会产生区
24、域外部路由,但默认产生一条默认路由。 完全stub区域:只会有区域内路由和一条默认路由。2、 nssa区域:只会有区域内路由和区域间路由。不会自动产生默认路由,需注入默认路由才能通往区域外部。完全nssa区域:会有区域内路由和一条默认路由,能够通往去区域外部。R1的配置enconf tint lo 0ip add 1.1.1.1 255.255.255.0int s0/0/0ip add 192.168.12.1 255.255.255.0cl ra 64000no sh ro os 1rou 1.1.1.1net 1.1.1.0 0.0.0.255 ar 1net 192.168.12.0
25、0.0.0.255 ar 1ar 1 nssaR2enconf tint lo 0ip add 2.2.2.2 255.255.255.0int s0/0/0ip add 192.168.12.2 255.255.255.0no sh int s0/0/1ip add 192.168.23.2 255.255.255.0cl ra 64000no shro os 1rou 2.2.2.2net 192.168.23.0 0.0.0.255 ar 0net 192.168.12.0 0.0.0.255 ar 1net 2.2.2.0 0.0.0.255 ar 0ar 1 nssaR3enconf
26、 tint lo 0ip add 3.3.3.3 255.255.255.0int s0/0/0ip add 192.168.34.3 255.255.255.0cl ra 64000no sh int s0/0/1ip add 192.168.23.3 255.255.255.0no shro os 1net 3.3.3.0 0.0.0.255 ar 0net 192.168.23.0 0.0.0.255 ar 0re ri suro river 2no au net 192.168.34.0R4enconf tint lo 0ip add 4.4.4.4 255.255.255.0int
27、s0/0/0ip add 192.168.34.4 255.255.255.0no sh ro river 2no au net 192.168.34.0net 4.0.0.0R1enconf tint lo 0ip add 1.1.1.1 255.255.255.0int s0/0/0ip add 192.168.12.1 255.255.255.0cl ra 64000no sh ro os 1rou 1.1.1.1net 1.1.1.0 0.0.0.255 ar 0net 192.168.12.0 0.0.0.255 ar 0R2enconf tint lo 0ip add 2.2.2.
28、2 255.255.255.0int s0/0/0ip add 192.168.12.2 255.255.255.0no sh int s0/0/1ip add 192.168.23.2 255.255.255.0cl ra 64000no shro os 1rou 2.2.2.2net 192.168.23.0 0.0.0.255 ar 1net 192.168.12.0 0.0.0.255 ar 0net 2.2.2.0 0.0.0.255 ar 0ar 1 vir 3.3.3.3R3enconf tint lo 0ip add 3.3.3.3 255.255.255.0int s0/0/
29、0ip add 192.168.34.3 255.255.255.0cl ra 64000no sh int s0/0/1ip add 192.168.23.3 255.255.255.0no shro os 1net 3.3.3.0 0.0.0.255 ar 0net 192.168.23.0 0.0.0.255 ar 1net 192.168.34.0 0.0.0.255 ar 0ar 1 vir 2.2.2.2R4enconf tint lo 0ip add 4.4.4.4 255.255.255.0int s0/0/0ip add 192.168.34.4 255.255.255.0n
30、o sh ro os 1rou 4.4.4.4net 192.168.34.0 0.0.0.255 ar 0net 4.4.4.0 0.0.0.255 ar 0六、路由重分布R1(config)#router rip R1(config-router)#version 2 R1(config-router)#no auto-summary R1(config-router)#network 192.168.12.0 R1(config-router)#redistribute static metric 3 /重分布静态路由 R1(config)#ip router 0.0.0.0 0.0.0.0 Serial0/0/1R2(config)#router eigrp 1 R2(config-router)#no auto-summary R2(config-router)#network 192.168.23.0 R2(config-router)#redistribute rip metric 1000 100 255 1 1500 /将RIP 重分布到EIGRP 中R2(config)#router rip
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1