友情提示:如果本网页打开太慢或显示不完整,请尝试鼠标右键“刷新”本网页!阅读过程发现任何错误请告诉我们,谢谢!! 报告错误
一世书城 返回本书目录 我的书架 我的书签 TXT全本下载 进入书吧 加入书签

路由器基本知识及应用实例(DOC格式)-第3章

按键盘上方向键 ← 或 → 可快速上下翻页,按键盘上的 Enter 键可回到本书目录页,按键盘上方向键 ↑ 可回到本页顶部!
————未阅读完?加入书签已便下次继续阅读!




打开DNS查询功能,使用下面的命令:  
! Enable DNS lookups
ip domain…lookup

使用 show hosts 命令察看本地已知的主机名和IP地址对应表:
Router》show hosts
Default domain is your…domain。
Name/address lookup uses domain service
Name servers are 10。10。9。1 10。10。9。1

Host                     Flags      Age Type   Address(es)
Foxtrot                  (temp; OK)  18   IP    10。10。1。3
sphinx                   (temp; OK)  18   IP    10。10。1。2

2。2。1。1。8 设置路由器的时间
使用clock set命令设定系统时钟: 
Router#clock set 13:00:00 20 jun 1999

使用clock timezone 命令配置路由器的时区: 
Router(config)#clock timezone EST …5

…5 是EST与UTC的时间差
2。2。1。1。9 日历时间和系统时钟
Cisco高端路由器有一个内部日历,该日历是持续运行的,既是系统关闭,也不会影响该日历的运行。使用calendar命令可以设置这个日历,使用clock read…calendar命令,可以让系统时钟从日历中获取时间。 
Router#calendar set 12:10:00 5 September 1999
Router#clock read…calendar

2。2。1。1。10 配置 NTP
Network Time Protocol (NTP) 可以同步网络上设备的时钟,使用下面的命令配置NTP: 
clock timezone EST …5
ntp server 10。10。1。5

2。2。1。1。11 激活SNMP功能
默认情况下,SNMP 功能是关闭的。打开SNMP; 使用下面的命令: 
snmp…server munity name mode access…list

参数的含义:
name :访问SNMP的口令。 
mode :RO(read…only )或RW (read…write)。RO是只读权限,RW是读写权限。 
access…list:为了增加访问SNMP的安全性,可以使用access…list来限定访问SNMP的主机地址。 
下面是一个SNMP配置的例子:
! Set up public access with a munity string of 〃not…public〃
snmp…server munity not…public RO

! Set up privileged access with a munity string of 〃not…secure〃 
snmp…server munity not…secure RW

! Enable public access and apply access…list number 1
snmp…server munity not…public RO 1

! Enable privileged access and apply access…list number 2
snmp…server munity highly…secure RW 2

! Access…lists (See chapter 7 for syntax and usage)
access…list 1 permit 10。10。1。0 0。0。0。255
access…list 2 permit 10。10。1。35

! Specify what SNMP management station will receive our traps
! Our munity string is 〃little…secure〃
snmp…server host 10。10。1。2 little…secure traps

2。2。1。1。12 Cisco Discovery Protocol
通过Cisco Discovery Protocol (CDP) 协议,可以发现相邻设备的类型和地址。 
激活CDP协议:cdp run
关闭CDP协议::no cdp run
也可以关闭某个端口的CDP,具体方法是在相应的端口使用no cdp enable。
显示CDP信息: 
Router》show cdp neighbors
Capability Codes: R Router; T Trans Bridge; B Source Route Bridge
                  S Switch; H Host; I IGMP

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
switch1             Eth 0          162         T S        1900      AUI
router2             Eth 0          176          R         4000      Eth 0

2。2。1。1。13 系统banner
banner是系统给用户的提示词,它可以起到说明、提示的。Banner有四种:motd、login、exec或ining。下面是banner的例子:
This is the message of the day banner。   (motd banner)
This is the login banner。                 (login banner)
User access verification
    
Password:       (not echoed) 
This is the exec banner。     (exec banner)
Router》         (user mode prompt)


创建 Banners
使用banner命令创建四种形式的banner: 
Router(config)#banner motd # message #
Router(config)#banner login # message #
Router(config)#banner exec # message #
Router(config)#banner ining # message #

删除Banners
使用no banner命令删除banner:
Router(config)#no banner ining

使用no exec…banner 和 no motd…banner 命令可以分别去除某线的banner。
Router(config)#line 5
Router(config…line)#no exec…banner
Router(config…line)#no motd…banner


2。2。1。2 GSR配置
2。2。1。2。1 Cisco IOS映像文件
默认情况下,GSR的IOS映像文件存储在位于0号PCMCIA槽位的Flash 内存或Flash 硬盘中。路由器的初始状态,也是使用这个映像文件启动系统,可以通过配置,使路由器从1号槽位或TFTP中的映像文件启动系统。 
 
2。2。1。2。2 确认有效的IOS映像文件
如果路由器没有找到适当的系统映像文件,则系统会进入到只读存储器(ROM)监视模式,系统将显示Rommon》提示符。在这个模式下,可以使用下列命令确认IOS映像文件的位置。 
命令 
作用 
Rommon 1》 dir bootflash: 
显示SIMM(single inline memory module)中的内容;这里存储的是最小软件映像文件,该映像文件仅可以用来做基本配置。 
Rommon 2》 dir slot0:
or
Rommon 2》 dir slot1: 
显示Flash内存(位于PCMCIA 0号槽位或1号槽位)中的内容。
Rommon 3》 dir disk0:
or
Rommon 3》 dir disk1: 
显示Flash硬盘(位于PCMCIA 0号槽位或1号槽位)中的内容。 
下面是命令运行结果示例: 
Rommon 1》 dir bootflash: 
Directory of bootflash:/ 
1 …rw5043356 Jan 01 2000 00:01:15 gsr…boot…mz。120…8。S 
Rommon 2》 dir slot0: 
Directory of slot0:/ 
1 …rw13778192 Jan 14 2002 18:24:26 gsr…p…mz。120…19。S。bin 
12 …rw3973 Sep 03 2002 23:09:47 ozRun 
20578304 bytes total (6762344 bytes free) 
2。2。1。2。3 手工从IOS映像文件启动系统
可以通过手工指定系统软件映像文件的方式启动系统。所涉及的命令如下: 
mand 
Purpose 
Rommon 3》 boot 
(没有参数) 从默认的映像文件(位于SIMM或bootflash)启动系统。在出厂时,SIMM中装有系统映像文件。 
Rommon 3》 boot flash 
(没有指定PCMCIA 的槽位号) 系统将尝试从RP的0号槽位flash内存的映像文件启动系统。
Rommon 3》 boot slot0: filename 
指定从RP的0号槽位flash内存的映像文件启动系统。
Rommon 3》 boot disk0: filename 
指定从RP的0号槽位flash硬盘的映像文件启动系统。
Rommon 3》 boot slot1: filename 
指定从RP的1号槽位flash内存的映像文件启动系统
Rommon 3》 boot disk1: filename 
指定从RP的1号槽位flash硬盘的映像文件启动系统。
Rommon 3》 boot bootflash: filename 
指定使用RP上SIMM中的映像文件启动系统(文件名为filename)。 
Rommon 3》 boot tftp: filename 'host' 
指定TFTP主机上的指定文件启动系统。 

2。2。1。2。4 为网管配置IP地址
可以使用GRP面板上的RJ…45 和 MII 接口(PRP面板上的RJ…45接口),作为网管接口;两个接口可以随便使用一个,但不能同时使用。 
下面是为该接口配置IP地址的步骤:
1.进入端口配置
Router(config)# interface ethernet 0
2.为端口配置IP地址和子网掩码
Router(config…if)# ip address 10。10。1。1 255。255。0。0

2。2。1。2。5 配置 POS 线卡
1.进入在第3槽位的线卡的0号POS端口 
Router(config)# interface pos 3/0
2.为端口配置IP地址和子网掩码
Router(config…if)# ip address 2。1。1。1 255。0。0。0
3.激活该端口
Router(config…if)# no shutdown

2。2。1。2。6 配置 ATM 线卡
1.进入在第1槽位的线卡的0号ATM端口 
Router(config)# interface pos 1/0
2.为端口配置IP地址和子网掩码
Router(config…if)# ip address 2。0。0。1 255。0。0。0
3.激活该端口
Router(config…if)# no shutdown

2。2。1。2。7 PCMCIA Flash Memory 配置
 格式化Flash Memory或 Flash Disk
在使用一个新的Flash Memory或 Flash Disk之前,必须对其格式化。 


注意:这个步骤会清除Flash Memory或 Flash Disk上的所有数据

1.格式化位于RP 0号槽位的一个新的Flash Memory或 Flash Disk。
  Router# format slot0: 
或 
Router# format disk0:

2.确认格式化操作
All sectors will be erased; proceed? 'confirm' y
3.指定卷号 :本例中是MyNewCard。 
Enter volume id (up to 30 characters): MyNewCard 
Formatting sector n 
Format device slot0 pleted

 从Flash Memory启动系统
To enable booting from a Cisco IOS software image file located on a PCMCIA Flash memory card or Flash disk; follow these steps: 

命令 
目的 
 1  
Router# configure terminal 

进入全局配置模式 
 2  
Router(config)# boot system flash slot0:filename 
指明在系统在启动时装入的软件名称,filename是软件名。 本例中指明软件在falsh memory上,所在位置为slot0。 根据实际情况,也可以是slot1: slot1的Flash memory ;或 disk0: 位于slot 0的Flash disk; 或disk1: f位于slot 1的Flash disk。 
 3  
Router(config)# config…register 0x0102 
屏蔽掉Break功能并且运行boot system flash 命令。 
 4  
Router(config)# Ctrl…z 
退出全局配置模式。 
 5  
Router# copy running…config startup…config 
或 
Router# write memory 
将软件配置存入NVRAM。 
 6  
Router# reload 
使用PCMCIA 0号槽位的flash内存重启系统。 


Note   默认情况下,路由器从位于0号槽位的flash内存或硬盘启动系统。                  

升级和备份CISCO IOS软件映像文件和配置文件
 从TFTP服务器升级flash内存中的CISCO IOS 软件映像文件
GSR出厂时,在0号槽位的Flash内存或硬盘中装有默认的CISCO IOS映像文件。当将来有新版本的IOS软件发布的时候,可以从Cisco。下载,并更新路由器软件系统。 


注意:  为了在更新失败的时候,可以恢复到以前的IOS系统,请保留旧的系统映像文件备份。如果在Flash内存卡中没有足够的空间做这项工作,请先将旧的系统映像文件拷贝到另一个Flash内存或硬盘中,也可以备份到TFTP服务器上。具体操作步骤请见“在Flash内存或硬盘间拷贝IOS软件映像文件” 一节
返回目录 上一页 下一页 回到顶部 0 1
未阅读完?加入书签已便下次继续阅读!
温馨提示: 温看小说的同时发表评论,说出自己的看法和其它小伙伴们分享也不错哦!发表书评还可以获得积分和经验奖励,认真写原创书评 被采纳为精评可以获得大量金币、积分和经验奖励哦!