Tài liệu Chapter9 Managing a Cisco Internetwork docx

9 682 0
Tài liệu Chapter9 Managing a Cisco Internetwork docx

Đang tải... (xem toàn văn)

Thông tin tài liệu

Chapter9 Managing a Cisco Internetwork The Internal Components of a Cisco Router Cisco Router 的一些组件: bootstrap:存储在 ROM 中的微码(microcode)中,用来在初始化的时候启动 router,然后加载 IOS POST:存储在 ROM 中的微码中,用来检查硬件基本配置是否正常,然后决定哪些接口可用 ROM monitor:存储在 ROM 中的微码中,作用是测试和排疑等 Mini-IOS:Cisco 叫它 RXBOOT 或 bootloader,它是存储在 ROM 中的,IOS 的简化版本,用来把 IOS 加载到闪存中 RAM(random-access memory):用来保存数据包缓存,ARP 缓存,路由表,和 running-config 配置 文件.某些 router 上,IOS 可以从 RAM 中运行 ROM(read-only memory):用来启动和维持 router 正常化 Flash memory(闪存):用来存放 IOS,当 router 重新启动的时候闪存是不会被擦除的,由 Intel 创 造的 EEPROM NVRAM(nonvolatile RAM):存储 startup-config 配置文件,当 router 重新启动的后,这些文件是 不会被擦除的 configuration register:用来控制 router 如何启动,这个值可以使用 show version 来查看,一般为 0x2102(16 进制),含义是告诉 router 从闪存里加载 IOS 和从 NVRAM 里加载配置文件 The Router Boot Sequence 启动序列用来测试硬件和加载所必需的软件,包括以下几个步骤: 1.先进行 POST,测试硬件 2.bootstrap 查找和加载 IOS 3.IOS 在 NVRAM 中查找有效的 startup-comfig 配置文件 4.如果在 NVRAM 里查找到了这个配置文件,router 就可操作;如果文件不存在,router 进到 setup 模式 Managing Configuration Registers Cisco 的router 有 1 个存储在 NVRAM 中的,16 位长的 configuration register.默认这个值 0x2102 设置成从闪存中加载 IOS 和从 NVRAM 中查找启动配置文件 Understanding the Configuration Register Bits 一些常见的位的含义: 1.第 0 到 3 位:启动字段 2.第 6 位:忽略 NVRAM 内容 3.第 8 位:禁用 BREAK 启动字段(00 到 03): 1.设置成 00:ROM monitor 模式,进入到这个模式,configuration register 的值设置成 2100.然后 要启动 router 的话需要手动在命令行提示符 rommon>下输入 b(感觉有点类似 Solaris 的 OpenBoot 哈哈) 2.设置成 01:从 ROM 中的镜象启动,把 configuration register 的值设置成 2101,提示符为 router(boot)> 3.设置成 02 到 0F:定义默认启动文件名,在 NVRAM 中查找 Checking the Current Configuration Register Value 使用 show version 命令可以查看当前 configuration register 的值,在输出的最下部分.这个命令 将会显示硬件的配置信息,软件版本,配置文件信息,启动镜象等 Changing the Configuration Register 可以通过修改 configuration register 的值来决定 router 的启动和运行方式.在全局配置模式下 使用 config-register 的命令.修改值为 0x101,注意输出内容,如下: Router(config)#config-register 0x101 Router(config)#^Z Router#sh ver (略) Configuration register is 0x2102 (will be 0x0101 at next reload) 注意修改后的值和当前值,修改后的值只在重新启动后生效 Recovering Passwords 如果你把密码忘记了怎么办?之前提到过,位6 可以忽略掉NVRAM 里的储存的启动配置文件 的内容,默认是 0x2102,所以我们把值修改成 0x2142, 就可以达到忽略 NVRAM 这个效果.下面 是密码恢复的主要几个步骤: 1.在启动 router 的时候使用 BREAK 中断启动 2.把 configuration register 的值设置成 0x2142 3.重新启动 4.进入特权模式 5.把 startup-config 文件复制到 running-config 文件中 6.修改密码 7.把 configuration register 的值还原为 0x2102 8.保存配置 9.重新启动 具体的修改,2500 系列和 2600 系列有一点不一样,我们先来看 2600 系列的修改实例,使用 Ctrl+BREAK 中断启动.注意提示 monitor: command “boot” aborted due to user interrupt. 如下: System Bootstrap, Version 11.3(2)XA4, RELEASE SOFTWARE (fc1) (略) PC = 0xfff0a530, Vector = 0x500, SP = 0x80004374 monitor: command “boot” aborted due to user interrupt rommon 1 >confreg 0x2142 You must reset or power cycle for new config to take effect 提示重新启动,如下: rommon 1>reset 重新启动后,进入特权模式,把 startup-config 复制到 running-config 中,并修改密码.如下: Router#copy start run Router#conf t Router(config)#enable secret noko 把 configuration register 的值还原,并保存,如下: Router(config)#config-register 0x2102 Router(config)#^Z Router#copy run start 2500 系列下的修改,在启动时输入 o 中断启动,再用 o/r 修改 configuration register 的值,如下: System Bootstrap, Version 11.0(10c), SOFTWARE (略) Abort at 0x1098FEC (PC) >o (略) >0x2142 重新启动,输入 I,如下: >I 接下来的步骤和 2600 系列一样,如下: Router#copy start run Router#conf t Router(config)#enable secret noko 把 configuration register 的值还原,并保存,如下: Router(config)#config-register 0x2102 Router(config)#^Z Router#copy run start Backing Up and Restoring the Cisco IOS 把 IOS 备份到 TFTP 服务器前的准备工作: 1.确认你可以访问 TFTP 服务器 2.确认 TFTP 服务器是否有足够空间来保存 IOS 文件 3.确定名称和路径 Verifying Flash Memory 验证闪存信息,使用 show flash 命令,如下: Router#sh flash System flash directory: File Length Name/status 1 8121000 c2500-js-l.112-18.bin Backing Up the Cisco IOS 把 IOS 备份到 TFTP 服务器上,特权模式下使用 copy flash tftp 命令,记住备份之前最好对服务 器 ping 下看是否是通的 Restoring or Upgrading the Cisco Router IOS 从 TFTP 恢复或者升级 IOS,特权模式下使用 copy tftp flash 命令 Backing Up and Restore the Cisco Configuration 把配置文件备份到 TFTP 服务器,和把 IOS 备份到 TFTP 服务器的命令类似;恢复也是如此: 1.startup-config 文件的备份:copy startup-config tftp 2.startup-config 文件的恢复:copy tftp startup-config 3.running-config 文件的备份:copy running-config tftp 4.running-config 文件的恢复:copy tftp running-config 验证命令为 show running-config 和 show startup-config Erasing the Configuration 擦除启动配置文件startup-config 文件,在特权模式下使用erase startup-config命令,擦除了以后, 立即重新启动的话,router 将进到 setup 模式 Using Cisco Discovery Protocol(CDP) Cisco 发现协议(CDP)是 Cisco 私有,帮助用来管理员收集本地相连和远程设备的信息. Getting CDP Timers and Holdtime Information 之前提到过 CDP 的一些介绍,show cdp 命令提供 2 个信息给你: 1.CDP timer:CDP 包传给每个活跃接口的时间间隔,默认是 60 秒 2.CDP holdtime:某设备从相邻设备收到的包的保持时间,默认是 180 秒 如下: Router#sh cdp Global CDP information: Sending CDP packets every 60 seconds Sending a holdtime value of 180 seconds Router# 可以修改默认的时间,分别在全局配置模式下使用 cdp timer 和 cdp holdtime 命令,如下: Router#conf t Router(config)#cdp timer 90 Router(config)#cdp holdtime 240 在所有接口上关闭 CDP,在全局配置模式下使用 no cdp run 命令;关闭某个接口的 CDP 使用 no cdp enable 命令.再次打开分别使用 cdp run 和 ccdp enable 命令.如下: Router(config)#no cdp run Router(config)#int fa0/1 Router(config-if)#no cdp enable Gathering Neighbor Information 使用 show cdp neighbour 可以显示直接相连的设备的信息,如下: Router#sh cdp nei Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge, S – Switch, H – Host, I – IGMP, r – Repeater Device ID Local Intrfce Holdtime Capability Platform Port ID 1900Switch Eth 0 238 T S 1900 2 2500B Ser 0 138 R 2500 Ser 0 Router# 一些选项的解释如下: 1.Device ID:直接相连的设备的主机名 2.Local Interface:接收 CDP 包的接口 3.Holdtime:某设备从相邻设备收到的包的保持时间,如果过了这个时间仍然没收到新的 CDP 包,就将被丢弃 4.Capability:见输出最顶部信息 5.Platform:Cisco 设备的类型 6.Port ID:相连设备的接受 CDP 包信息的接口 要查看更为详细的 CDP 信息可以使用 show cdp neighbor detail 或 show cdp entry *命令 Gathering Interface Traffic Information 使用 show cdp traffic 命令显示接口 CDP 包流量信息,如下: Router#sh cdp traffic CDP counters: Packets output: 13, Input: 8 Hdr syntax: 0, Chksum error: 0, Encaps failed: 0 No memory: 0, Invalid packet: 0, Fragmented: 0 Router# Gathering Port and Interface Information 使用 show cdp interface 命令显示接口的 CDP 状态信息 Using Telnet 在特权模式下使用 telnet [IP 地址]的命令进行 telnet,如下: Router#telnet 172.16.10.2 Trying 172.16.10.2 … Open Password required, but none set [Connection to 172.16.10.2 closed by foreign host] Router# 由上面提示可以看出,VTY 没有密码配置的话是不允许你 telnet 的(除非你使用了 no login 命 令,但是安全性几乎为 0).所以在 telnet 前,记得先给目标设备的 VTY 线路配置密码 Telnetting into Multiple Devices Simultaneously 当你 telnet 到远程设备的时候,可以在任何情况下使用 exit 命令来终止连接.但是假如你想保 持这个连接,同时又对另外 1 个设备进行 telnet 的时候,使用 Ctrl+Shift+6,再按下 X 键,就可以 回到本地 console,再对另外 1 设备进行 telnet.如下: 2500#telnet 172.16.10.2 Trying 172.16.10.2 … Open User Access Verification Password: 2600>[Ctrl+Shift+6,X] 2500#telnet 192.168.0.32 (略) Checking Telnet Connections 查看从本地到远程的连接会话,使用 show sessions 命令,如下: 2500#sh sessions Conn Host Address Byte Idle Conn Name 1 172.16.10.2 172.16.10.2 0 0 172.16.10.2 *2 192.168.0.32 192.168.0.32 0 0 192.168.0.32 2500# 注意*所在的会话代表你的最后 1 个会话,可以直接敲 2 下 Enter 键回到*号会话,也可以输入 前面的数字,再敲 2 下 Enter 键回到相应会话 Checking Telnet Users 使用 show users 命令列举本地所有活动 console 和 VTY 端口,如下: 2500#sh users Line User Host(s) Idle Location * 0 con 0 172.16.10.2 00:07:52 192.168.0.32 00:07:18 注意上面输出的 con 代表本地 console,这个例子可以看到从本地 console 连接了远程的 2 个 设备.接下来在我们远程设备上使用这个命令,如下: 2600>sh users Line User Host(s) Idle Location 0 con 0 idle 9 *2 vty 0 这个输出内容可以看出 console 是活动的,而且 VTY 端口 2 被使用 Closing Telnet Sessions 之前说过,要终止 telnet 会话,在远程(被 telnet)设备上使用 exit 命令.但是要从本地设备终止会 话的话,就需要在本地使用 disconnect 命令,如下: 2500#disconnect ? <1-2> The number of an active network connection WORD The name of an active network connection <cr> 2500#disconnect 1 Closing connection to 172.16.10.2 [confirm] 2500# 验证如下: 2600#sh users Line User Host(s) Idle Location *0 con 0 idle 0 1 aux 0 idle 0 2 vty 0 idle 172.16.10.1 清除连接,使用 clear line 命令,并验证,如下: 2600#clear line 2 [confirm] [OK] 2600#sh users Line User Host(s) Idle Location *0 con 0 idle 0 1 aux 0 idle 1 2600# Resolving Hostnames 2 种解析主机名到 IP 地址的办法: 1.在每个 router 上建立主机表(host table) 2.建立 DNS 服务器(Domain Name System server),这个类似动态主机表 Building a Host Table 主机表只提供包含其中的解析,建立主机表的命令是 ip host [主机名] [TCP 端口号] [IP 地址], 默认 TCP 端口号为 23.1 个主机可以对应最多 8 个 IP 地址.如下: 2500(config)#ip host 2501B 172.16.10.2 2500(config)#ip host 1900S 192.168.0.32 2500(config)#^Z 使用 show hosts 命令验证新建的主机表,如下: 2500#sh hosts Default domain is not set Name/address lookup uses domain service Name servers are 255.255.255.255 Host Flags Age Type Address(es) 2501B (perm, OK) 0 IP 172.16.10.2 1900S (perm, OK) 0 IP 192.168.0.32 2500# 注意 Flags 选项的 perm,代表是手动输入的,如果这项是 temp 的话,表明是由 DNS 解析的 Using DNS to Resolve Names 假如你在 CLI 下输入了 1 个 Cisco 设备不能识别的命令,它会默认通过 DNS 来进行解析(它认 为是主机名).这个不好的地方是要花费额外的时间等待 DNS 解析完.可以在全局配置模式下 使用 no ip domain-lookup 命令关闭它 假如你在你的网络里有 DNS 服务器,可以使用 1 些命令使 DNS 解析开始工作: 1.第一条命令是:ip domain-lookup,这个命令默认是打开了的.如果你之前使用了 no ip domain-lookup 的话,就要用这条命令打开它 2.第二条命令是:ip name-server.设置 DNS 服务器的 IP 地址,可以使 1 个 IP 地址对应多达 6 个 服务器 3.最后条命令是:ip domain-name.虽然这个命令是可选的,但是最好还是设置 1 下 实例如下: 2500(config)#ip domain-lookup 2500(config)#ip name-server 192.168.0.23 2500(config)#ip domain-name noko.com 2500(config)#^Z 2500# 可以使用 ping 命令来严正下,如下 : 2500#ping 1900S Translating “1900S”…domain server (192.168.0.23) [OK] (略) 使用 show hosts 命令验证下,如下: 2500#sh hosts Default domain is noko.com Name/address lookup uses domain service Name servers are 192.168.023 Host Flags Age Type Address(es) 2501B (perm, OK) 0 IP 172.16.10.2 1900S.noko.com (temp, OK) 0 IP 192.168.0.32 2500# Checking Network Connectivity ping 和 traceroute 命令是检查网络连接是否完好的有利工具 . Chapter9 Managing a Cisco Internetwork The Internal Components of a Cisco Router Cisco Router 的一些组件: bootstrap:存储在 ROM 中的微码(microcode)中,用来在初始化的时候启动. 8 Hdr syntax: 0, Chksum error: 0, Encaps failed: 0 No memory: 0, Invalid packet: 0, Fragmented: 0 Router# Gathering Port and Interface Information 使用 show

Ngày đăng: 10/12/2013, 16:15

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan