cisco网络技术大赛决赛笔记.docx
《cisco网络技术大赛决赛笔记.docx》由会员分享,可在线阅读,更多相关《cisco网络技术大赛决赛笔记.docx(19页珍藏版)》请在冰豆网上搜索。
![cisco网络技术大赛决赛笔记.docx](https://file1.bdocx.com/fileroot1/2023-2/22/bbd922a3-ca27-4c8f-9aff-8111a8ddca5c/bbd922a3-ca27-4c8f-9aff-8111a8ddca5c1.gif)
cisco网络技术大赛决赛笔记
一、密码恢复和IOS的恢复:
密码恢复:
1、在路由器上配置密码:
//故意设置一个自己也记不住的密码,以供密码恢复使用。
2、路由器密码恢复,关闭路由器电源并重新开机,当控制台出现启动过程时,赶快按住Ctrl+Break键中端路由器启动过程,进入rommon模式。
3、rommon1>confreg0x2142
//改变配置寄存器的值为0x2142,这会使得路由器开机不读取NVRAM中配置文件
rommon2>reset
//重启路由器。
路由器重启后会直接进入到setup配置模式,使用【Ctrl+C】键或者回答”n”
退出setup模式
Router>enable
Router#copystartup-configrunning-config
Destinationfilename[running-config]?
661bytescopiedin0.625secs
//把配置文件从NVRAM中复制到RAM中,在此基础上修改密码
R2#configureteminal
R2(config)enablepasswordcisco
//以上把密码改自己的密码,如果还配置别的密码请把它们一一修改了
R2(config)#config-register0x2102
//以上把寄存器的值恢复为正常值0x2102
R2(config)#exit
R2#copyrunning-configstartup-config
Destinationfilename[startup-config]?
Buildingconfiguration...
[OK]
R2#reload
//以上是保存配置,重启路由器,检查路由器是否正常
【提示】
在保存配置前,还需要把路由器的各个接口一一打开。
IOS恢复:
故意删除FLASH中的IOS,我们要恢复IOS
R2#showflash;
R2#deleteflash;c2800nm-adventerprisek9-mz.124-11.T1.bin
恢复IOS
请确认IOS已经放在c;\TFTP-Root目录下。
路由器丢失了IOS后,开机将自动进入rommon模式
rommon2>IP_ADDRESS=172.16.0.2
rommon3>IP_SUBNET_MASK=255.255.0.0
rommon4>DEFAULT_GATEWAY=172.16.0.100
rommon5>TFTP_SERVER=172.16.0.100
rommon6>TFTP_FILE=c2800nm-adventerprisek9-mz.124-11.T1.bin
rommon7>tftpdnld
二、RIPv2认证和触发更新
(1)步骤1:
配置路由器R1
R1(config)#keychaintest//配置钥匙链
R1(config-keychain)#key1//配置KEYID
R1(config-keychain-key)#key-stringcisco//配置KEYID的密匙
R1(config)#interfaces0/0/0
R1(config-if)#ipripauthenticationmodetext
//启用认证,认证模式为明文,默认认证模式就是明文,所以也可以不用指定
R1(config-if)#ipripauthenticationkey-chaintest//在接口上调用钥匙链
R1(config-if)#ipriptriggered//在接口上启用触发更新
(2)步骤2:
配置路由器R2
R2(config)#keychaintest
R2(config-keychain)#key1
R2(config-keychain-key)#key-stringcisco
R2(config)#interfaces0/0/0
R2(config-if)#ipriptriggered
R2(config-if)#ipripauthenticationkey-chaintest
R2(config)#interfaces0/0/1
R2(config-if)#ipripauthenticationkey-chaintest
R2(config-if)#ipriptriggered
(3)步骤3:
配置路由器R3
R3(config)#keychaintest
R3(config-keychain)#key1
R3(config-keychain-key)#key-stringcisco
R3(config)#interfaces0/0/0
R3(config-if)#ipripauthenticationkey-chaintest
R3(config-if)#ipriptriggered
R3(config)#interfaces0/0/1
R3(config-if)#ipripauthenticationkey-chaintest
R3(config-if)#ipriptriggered
(4)步骤4:
配置路由器R4
R4(config)#keychaintest
R4(config-keychain)#key1
R4(config-keychain-key)#key-stringcisco
R4(config)#interfaces0/0/0
R4(config-if)#ipripauthenticationkey-chaintest
R4(config-if)#ipriptriggered
三、ccna安全
设置ntp:
ntpserver192.168.1.5//设置ntp服务器
ntpupdate-calendar//该全局命令使NTP周期性地更新Cisco7XXX系列路由器的日历
servicetimestampslogdatetimemsec//配置系统日志记录时间格式
设置SyslogServer:
logging192.168.1.6
配置ssh:
ipdomain-name
usernameSSHadminprivilege15secretciscosshpa55
linevty015
loginlocal
transportinputssh
cryptokeygeneratersa
ipsshversion2
ipsshauthentication-retries2
ipsshtime-out90
配置本地AAA认证
forconsoleaccessonR1:
usernameAdmin1passwordadmin1pa55//配置本地用户名
aaanew-model//启用AAA认证
aaaauthenticationlogindefaultlocal//使用本地数据库
R1(config-line)#loginauthenticationdefault//configureAAAauthenticationforconsolelogintousethedefaultmethodlist.
ConfigureLocalAAAAuthenticationforVTYLinesonR1
R1(config)#aaaauthenticationloginTELNET-LOGINlocal//Configureanamedlistcalled TELNET-LOGIN toauthenticateloginsusinglocalAAA.
R1(config-line)#loginauthenticationTELNET-LOGIN//ConfiguretheVTYlinestousethenamedAAAmethod
AAATACACS+认证:
UsernameAdminpasswordadminpa55
tacacs-serverhost192.168.2.2
tacacs-serverkeytacacspa55
aaanew-model
R2(config)#aaaauthenticationlogindefaultgrouptacacs+local//configureallloginstoauthenticateusingtheAAATACACS+serverandifnotavailable,thenusethelocaldatabase.
R2(config-line)#loginauthenticationdefault
AAARADIUS认证:
UsernameAdminpasswordadminpa55
radius-serverhost192.168.3.2
radius-serverkeyradiuspa55
R3(config)#aaanew-model
R3(config)#aaaauthenticationlogindefaultgroupradiuslocal
R2(config-line)#loginauthenticationdefault
基本上可以通用的复制粘贴命令:
根据以下说明对BRANCH、HQ和ISP路由器进行基本配置:
1.配置路由器主机名。
2.禁用DNS查找。
3.配置执行模式口令。
4.配置当日消息标语。
5.配置控制台连接的口令。
6.配置VTY连接的口令。
7.将自动提供的消息和调试输出与所请求的输出以及控制台和虚拟终端线路的提示符相同步。
8.将执行超时配置为15分钟。
en
conft
ipdomain-lookup
enapasscisco
enasecclass
banmotd“”
linecon0
passcisco
login
linevty015
passcisco
login
四、OSPF认证
基于区域的OSPF简单口令认证:
配置路由器R1
R1(config)#routerospf1
R1(config-router)#router-id1.1.1.1
R1(config-router)#network192.168.12.0255.255.255.0area0
R1(config-router)#network1.1.1.1255.255.255.0area0
R1(config-router)#area0authentication//区域0启用简单口令认证
R1(config)#interfaces0/0/0
R1(config-if)#ipospfauthentication-keycisco//配置认证密码
配置路由器R2
R2(config)#routerospf1
R2(config-router)#router-id2.2.2.2
R2(config-router)#network2.2.2.2255.255.255.0area0
R2(config-router)#network192.168.12.0255.255.255.0area0
R2(config-router)#area0authentication
R2(config)#interfaces0/0/0
R2(config-if)#ipospfauthentication-keycisco
基于区域的OSPFMD5认证
配置路由器R1
R1(config)#routerospf1
R1(config-router)#router-id1.1.1.1
R1(config-router)#network192.168.12.0255.255.255.0area0
R1(config-router)#network1.1.1.1255.255.255.0area0
R1(config-router)#area0authenticationmessage-digest//区域0启用MD5认证
R1(config)#interfaces0/0/0
R1(config-if)#ipospfmessage-digest-key1md5cisco//配置认证keyID及密匙
配置路由器R2
R2(config)#routerospf1
R2(config-router)#router-id2.2.2.2
R2(config-router)#network2.2.2.2255.255.255.0area0
R2(config-router)#network192.168.12.0255.255.255.0area0
R2(config-router)#area0authenticationmessage-digest
R2(config)#interfaces0/0/0
R2(config-if)#ipospfmessage-digest-key1md5cisco
基于链路的OSPF简单口令认证
配置路由器R1
R1(config)#routerospf1
R1(config-router)#router-id1.1.1.1
R1(config-router)#network192.168.12.0255.255.255.0area0
R1(config-router)#network1.1.1.1255.255.255.0area0
R1(config)#interfaces0/0/0
R1(config-if)#ipospfauthentication//链路启用简单口令认证
R1(config-if)#ipospfauthentication-keycisco//配置认证密码
配置路由器R2
R2(config)#routerospf1
R2(config-router)#router-id2.2.2.2
R2(config-router)#network2.2.2.2255.255.255.0area0
R2(config-router)#network192.168.12.0255.255.255.0area0
R2(config)#interfaces0/0/0
R2(config-if)#ipospfauthentication
R2(config-if)#ipospfauthentication-keycisco
基于链路的OSPFMD5认证
配置路由器R1
R1(config)#routerospf1
R1(config-router)#router-id1.1.1.1
R1(config-router)#network192.168.12.0255.255.255.0area0
R1(config-router)#network1.1.1.1255.255.255.0area0
R1(config)#interfaces0/0/0
R1(config-if)#ipospfauthenticationmessage-digest//接口s0/0/0启用MD5认证
R1(config-if)#ipospfmessage-digest-key1md5cisco//配置认证keyID及密匙
配置路由器R2
R2(config)#routerospf1
R2(config-router)#router-id2.2.2.2
R2(config-router)#network2.2.2.2255.255.255.0area0
R2(config-router)#network192.168.12.0255.255.255.0area0
R2(config)#interfaces0/0/0
R2(config-if)#ipospfauthenticationmessage-digest
R2(config-if)#ipospfmessage-digest-key1md5cisco
五、ospf高级配置
1、stub区域:
会产生区域间路由和区域内路由,不会产生区域外部路由,但默认产生一条默认路由。
完全stub区域:
只会有区域内路由和一条默认路由。
2、nssa区域:
只会有区域内路由和区域间路由。
不会自动产生默认路由,需注入默认路由才能通往区域外部。
完全nssa区域:
会有区域内路由和一条默认路由,能够通往去区域外部。
R1的配置
en
conft
intlo0
ipadd1.1.1.1255.255.255.0
ints0/0/0
ipadd192.168.12.1255.255.255.0
clra64000
nosh
roos1
rou1.1.1.1
net1.1.1.00.0.0.255ar1
net192.168.12.00.0.0.255ar1
ar1nssa
R2
en
conft
intlo0
ipadd2.2.2.2255.255.255.0
ints0/0/0
ipadd192.168.12.2255.255.255.0
nosh
ints0/0/1
ipadd192.168.23.2255.255.255.0
clra64000
nosh
roos1
rou2.2.2.2
net192.168.23.00.0.0.255ar0
net192.168.12.00.0.0.255ar1
net2.2.2.00.0.0.255ar0
ar1nssa
R3
en
conft
intlo0
ipadd3.3.3.3255.255.255.0
ints0/0/0
ipadd192.168.34.3255.255.255.0
clra64000
nosh
ints0/0/1
ipadd192.168.23.3255.255.255.0
nosh
roos1
net3.3.3.00.0.0.255ar0
net192.168.23.00.0.0.255ar0
rerisu
rori
ver2
noau
net192.168.34.0
R4
en
conft
intlo0
ipadd4.4.4.4255.255.255.0
ints0/0/0
ipadd192.168.34.4255.255.255.0
nosh
rori
ver2
noau
net192.168.34.0
net4.0.0.0
R1
en
conft
intlo0
ipadd1.1.1.1255.255.255.0
ints0/0/0
ipadd192.168.12.1255.255.255.0
clra64000
nosh
roos1
rou1.1.1.1
net1.1.1.00.0.0.255ar0
net192.168.12.00.0.0.255ar0
R2
en
conft
intlo0
ipadd2.2.2.2255.255.255.0
ints0/0/0
ipadd192.168.12.2255.255.255.0
nosh
ints0/0/1
ipadd192.168.23.2255.255.255.0
clra64000
nosh
roos1
rou2.2.2.2
net192.168.23.00.0.0.255ar1
net192.168.12.00.0.0.255ar0
net2.2.2.00.0.0.255ar0
ar1vir3.3.3.3
R3
en
conft
intlo0
ipadd3.3.3.3255.255.255.0
ints0/0/0
ipadd192.168.34.3255.255.255.0
clra64000
nosh
ints0/0/1
ipadd192.168.23.3255.255.255.0
nosh
roos1
net3.3.3.00.0.0.255ar0
net192.168.23.00.0.0.255ar1
net192.168.34.00.0.0.255ar0
ar1vir2.2.2.2
R4
en
conft
intlo0
ipadd4.4.4.4255.255.255.0
ints0/0/0
ipadd192.168.34.4255.255.255.0
nosh
roos1
rou4.4.4.4
net192.168.34.00.0.0.255ar0
net4.4.4.00.0.0.255ar0
六、路由重分布
R1(config)#routerrip
R1(config-router)#version2
R1(config-router)#noauto-summary
R1(config-router)#network192.168.12.0
R1(config-router)#redistributestaticmetric3//重分布静态路由
R1(config)#iprouter0.0.0.00.0.0.0Serial0/0/1
R2(config)#routereigrp1
R2(config-router)#noauto-summary
R2(config-router)#network192.168.23.0
R2(config-router)#redistributeripmetric100010025511500//将RIP重分布到EIGRP中
R2(config)#routerrip