CCNA最实用的复习知识点(3)

第四章

Cisco的互联 络操作系统(IOS)

1、 Cisco的IOS是一个可提供路由、交换、 络互连以有远程通信功能的专有内核。它负责完成一些重要的工作,包括:加载 络协议和功能、在设备间连接高速流量、在控制访问中添加安全性,防止未授权的 络使用、为简化 络的增长和冗余备份提供可靠缩放性、为连接到 络中的资源提供 络的可靠性。

2、 路由器启动时的工作过程:第一次启动一台Cisco路由器时,它将运行一个加电自检测试(POST),如果通过,它将查找Cisco IOS,如果闪存(Flash)中保存有IOS文件,它将从中加载。接着,IOS将处理装载和在NVRAM中查找一个有效的配置,即被称做启动配置的文件。如果在NVRAM中没有文件存在,则路由器将进入设置模式。

3、 路由器模式概述:

普通用户模式(user EXEC)

特权用户模式(privileged EXEC)

全局配置模式(global configuration)

接口配置模式(interface configuration)

路由配置模式(router configuration)

4、 常用管理命令

获取基本的路由信息:

router>enable

router#show version

设主机名:

router>enable

router#config terminal

router(config)#hostname Along

Along(config)#

标志区:

router>enable

router#config terminal

router(config)#banner motd | exec | incoming | login

启用口令:

router>enable

router#config terminal

router(config)#enable password | secret (其中secret的等级比password高)

辅助口令:

router#config terminal

router(config)#line aux 0 //进入辅助端口0

router(config-line)#password XXXXXX //设置登录密码

router(config-line)#login //激活登录口令验证

(说明:Cisco不允许你在某条线路上口令被设置之前,设置对它的“登录”命令,因为如果你在某条线路之下设置登录命令,而随后没有为它设置一个口令,则这条线路将不会被投入使用。并且它将会提示一个不存在的口令。)

控制台口令:

router#config terminal

router(config)#line console 0

router(config-line)#exec-timeout 0 0 //设置控制台超时值为零,即决不超时,默认是10分钟

router(config-line)#logging synchronous //阻止由于不稳定而产生的恼人的控制台信息

router(config-line)#password XXXXXX

router(config-line)#login

Telnet口令:

Router(config)#line vty 0 4 //没有运行Cisco IOS企业版的路由器默认时有5条VTY线路(0~4)

Router(config-line)#password XXXXXX

Router(config-line)#login //可以使用no login 命令告诉路由器,允许建立无口令验证的Telnet连接

设置安全外壳SSH

(通常用secureCRT软件代替windows自带的telenet,windows自带的telnet不支持SSH)以下是设置SSH的步骤:

设置用户名:

router(config)#hostname Along

设置域名:(在生成加密密码时需要用到用户名和域名)

Along(config)#ip domain-name Lammle.com

为加密会话产生加密密钥:

Along(config)#crypto key generate rsa general-keys moduls 1024

//用rsa加密算法生成一个1024bits长的密码

为SSH会话设置最大空闲定时器:

Along(config)#ip ssh time-out 60 //60秒

为SSH连接设计最大失败尝试值:

Along(config)#ip ssh authentication-retries 2 //2次

连接到路由器的VTY线路上:

Alongconfig)#line vty 0 1180

最后配置SSH并将Telnet作为访问协议:

Along(config)#transport input ssh telnet

加密口令

(让所有的口令都以密文显示,默认时只有enable secret口令是密文)

router(config)#service password-encryption

描述

(对管理员来说,在接口上设置描述非常有意义,同主机名一样,这也是个在本地有意义的设置。)

Todd#config t

Todd(config)#int s0/0/0 //s表示serial 口,三个数字分别表示,路由器本身,0槽,0端口

Todd(config-if)#descripton XXXXXXXXXXXXX

使用DO命令

(从IOS的12.3版本开始,Cisco终于在IOS中加入了一个可以从配置模式中查看配置文件和统计数据的命令。目前该命令可以在任何一个配置提示符下运行!)

router(config)#do show run

激活接口

router#config terminal

router(config)#interface fastethernet0/1

router(config-if)#no shutdown //shutdown用来关闭一个接口

在接口上配置IP地址

router(config)#int f0/1

router(config-if)#ip address 176.12.10.2 255.255.255.0

router(config-if)#no shutdown

使用管道符

(是一个输出选择器,能帮助你在路由器的整个配置文件中快速找出所要内容的工具。)

router#show run | begin interface //显示配置文件从接口开

(说明:每一个Cisco路由器的默认串行链路带宽为T1<1.544Mb/s>,但这不影响数据通过链路传送过程,这个值通常用某些路由协议来计算路由开销。)

查看、保存、擦除配置

(当前运行配置文件running-config保存在DRAM<Dynamic Random Access Memory>中,而启动配置文件保存在NVRAM<Non-Volatile Random Access Memory>中。)

router#copy running-config startup-config //将配置文件手工保存到非易失性随机访问存储器NVRAM中。

router#show running-config //查看当前运行配置文件。

router#erase startup-config //删除启动配置文件。

router#reload //重新加载路由器

5、常用的验证命令

Router#show interface fastethernet0/0 //显示F0/0口的硬件地址、逻辑地址、封装方式及发生冲突的统计。

Router#show ip interface //提供有关路由器接口的第3层配置的信息包含了接口状态、IP地址、子 掩码、是否设置访问列表等。

Router#show ip interface brief //提供了包含有逻辑地址、状态等的路由器接口快速汇总。

Router#show protocols //特别用于要即时查看每个接口上第1、2层的状态及使用的IP地址的情况下。

Router#show controllers serial0/0 //显示物理接口serial0/0自身特性的信息。

6、关于Cisco的安全设备管理器SDM(Security Device Manage)

在使用SDM时你需要一台提供ISR(Integration Service Router综合服务路由器)。SDM在Cisco的830系列到7301的路由器标准组件上均可使用,并且在所有新出品的850、870、1800、2800、3800系列路由器上均进行了预安装。使用时用交叉电缆将计算机直接连到路由器的一个LAN接口:如f0/0口

Router>enable

Router#config terminal

Router(config)#interface fastethernet0/0

Router(config-if)#ip address 1.1.1.1 255.255.255.0 //此时计算机的 关要设成1.1.1.1

Router(config-if)#no shutdown

接下来只需在计算机上打开浏览器,输入http://1.1.1.1即可连接进入SDM。如需要使用HTTPS则要进行更多的设置,另外如果你的路由器没有运行在增强服务的IOS上,它将不能支持HTTPS:

Router(config)#ip http server

Router(config)#ip http secure-server

Router(config)#ip http authentication local

<然后,使用特权级别15(最高级别)创建用户账 ,选0表示对指定密码显示时不加密的,选7表示对指定密码隐藏的>

Router(config)#username cisco privilege 15 password 0 cisco

<最后,配置控制台、SSH、和Telnet,以提供在特权级别访问的本地登录认证>

Router(config)#line console 0

Router(config-line)#login local

Router(config-line)#exit

Router(config)#line vty 0 1180

Router(config-line)#privilege level 15

Router(config-line)#login local

Router(config-line)#transport input telnet

Router(config-line)#transport input telnet ssh

Router(config-line)#^Z

完成以上工作后用https//1.1.1.1进行连接,按提示输入创建的用户名和口令。

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2019年11月24日
下一篇 2019年11月24日

相关推荐