1、教你如何调试CISCO路由器一、根本设置方式一般来说,可以用5种方式来设置路由器:1.Console口接终端或运行终端仿真软件的微机;2.AUX口接MODEM,通过 线与远方的终端或运行终端仿真软件的微机相连;3.通过Ethernet上的TFTP效劳器;4.通过Ethernet上的TELNET程序;5.通过Ethernet上的SNMP网管工作站。但路由器的第一次设置必须通过第一种方式进行,一般用超级终端通过com口进行控制。此时终端的硬件设置如下:波特率:9600数据位:8停止位:1奇偶校验: 无二、命令操作CISCO路由器所用的操作系统是IOS.共有以下几种状态:1、router在route
2、r提示符下,路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容。此时输入?并回车,可以查看到在此状态下可以用的命令。IOS允许你在任何时候用这种方式查看在某种状态下可以用的命令。在敲入enable并回车后,按照系统提示输入密码,在新的路由器第一次进行调试的时候不需要输入密码,直接回车即可进入#提示符,就可以对路由器进行各种操作了。2、router#路由器进入特权命令状态router#后,不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。此时就可以对路由器的名字、密码等进行设置。3、router(config)#在router
3、#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。4、router(config-if)#; router(config-line)#; router(config-router)#;路由器处于局部设置状态,这时可以设置路由器某个局部的参数。5、路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。在此状态下,可以进行口令恢复。三、常用命令 1.帮助在IOS操作中,无论任何状态和位置,都可以键入“?得到系统的帮
4、助。系统会显示此时可以使用的命令。2.改变命令状态任务命令进入特权命令状态enable退出特权命令状态disable进入设置对话状态Setup进入全局设置状态config terminal退出全局设置状态End进入端口设置状态interface type slot/number进入子端口设置状态interface type number.subinterface point-to-point | multipoint进入线路设置状态line type slot/number进入路由设置状态router protocol退出局部设置状态Exit3.显示命令任务命令查看版本及引导信息show ve
5、rsion查看运行设置show running-config查看开机设置show startup-config显示端口信息show interface type slot/number显示路由信息show ip router4.拷贝命令用于IOS及CONFIG的备份和升级5.网络命令任务命令登录远程主机telnet hostname|IP address网络侦测ping hostname|IP address路由跟踪Trace hostname|IP address6.根本设置命令任务命令全局设置config terminal设置访问用户及密码username username passwor
6、d password设置特权密码enable secret password设置路由器名hostname name设置静态路由ip route destination subnet-mask next-hop启动IP路由ip routing启动IPX路由Ipx routing端口设置interface type slot/number设置IP地址ip address address subnet-mask设置IPX网络Ipx network network激活端口no shutdown物理线路设置line type number启动登录进程login local|tacacs server设置
7、登录密码password password四、总体设置 在router#特权命令状态下,可以用setup对路由器进行总体设计,利用这个设计过程可以省略手工设置的烦琐。但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。进入设置对话过程后,路由器首先会显示一些提示信息:- System Configuration Dialog -At any point you may enter a question mark ? for help.Use ctrl-c to abort configuration dialog at any prompt.Default settings
8、 are in square brackets .这是告诉你在设置对话过程中的任何地方都可以键入“?得到系统的帮助,按ctrl-c可以退出设置过程,缺省设置将显示在中。然后路由器会问是否进入设置对话:Would you like to enter the initial configuration dialog? yes:如果按y或回车,路由器就会进入设置对话过程。首先你可以看到各端口当前的状况:First, would you like to see the current interface summary? yes:Any interface listed with OK? value
9、NO does not have a valid configurationInterfaceIP-AddressOK?MethodStatusProtocolEthernet0unassignedNOunsetupupSerial0unassignedNOunsetupup然后,路由器就开始全局参数的设置:Configuring global parameters:1设置路由器名:Enter host name Router:2设置进入特权状态的密文(secret),此密文在设置以后不会以明文方式显示:The enable secret is a one-way cryptographic
10、secret usedinstead of the enable password when it exists.Enter enable secret: cisco3设置进入特权状态的密码(password),此密码只在没有密文时起作用,并且在设置以后会以明文方式显示:The enable password is used when there is no enable secretand when using older software and some boot images.Enter enable password: pass4设置虚拟终端访问时的密码:Enter virtual
11、terminal password: cisco5询问是否要设置路由器支持的各种网络协议:Configure SNMP Network Management? yes: Configure DECnet? no:Configure AppleTalk? no:Configure IPX? no:Configure IP? yes:Configure IGRP routing? yes:Configure RIP routing? no:6如果配置的是拨号访问效劳器,系统还会设置异步口的参数:Configure Async lines? yes:1)设置线路的最高速度:Async line sp
12、eed 9600:2)是否使用硬件流控:Configure for HW flow control? yes:3)是否设置modem:Configure for modems? yes/no: yes4)是否使用默认的modem命令:Configure for default chat script? yes:5)是否设置异步口的PPP参数:Configure for Dial-in IP SLIP/PPP access? no: yes6)是否使用动态IP地址:Configure for Dynamic IP addresses? yes:7)是否使用缺省IP地址:Configure Def
13、ault IP addresses? no: yes是否使用TCP头压缩:Configure for TCP Header Compression? yes:9)是否在异步口上使用路由表更新:Configure for routing updates on async links? no: y10)是否设置异步口上的其它协议。接下来,系统会对每个接口进行参数的设置。1Configuring interface Ethernet0:1)是否使用此接口:Is this interface in use? yes:2)是否设置此接口的IP参数:Configure IP on this interfa
14、ce? yes:3)设置接口的IP地址:IP address for this interface: 192.168.162.24)设置接口的IP子网掩码:Number of bits in subnet field 0:Class C network is 192.168.162.0, 0 subnet bits; mask is /24在设置完所有接口的参数后,系统会把整个设置对话过程的结果显示出来:The following configuration command script was created:hostname Routerenable secret 5 $1$W5Oh$p6
15、J7tIgRMBOIKVXVG53Uh1enable password pass请注意在enable secret后面显示的是乱码,而enable password后面显示的是设置的内容。就是说,secret密码的优先级比拟高,在两个密码都设了的情况下,secret密码起作用。显示结束后,系统会问是否使用这个设置:Use this configuration? yes/no: yes如果答复yes,系统就会把设置的结果存入路由器的NVRAM中,然后结束设置对话过程,使路由器开始正常的工作。广域网协议设置PPPPPP(Point-to-Point Protocol)是SLIP(Serial Li
16、ne IP protocol)的继承者,它提供了跨过同步和异步电路实现路由器到路由器(router-to-router)和主机到网络(host-to-network)的连接。CHAP(Challenge Handshake Authentication Protocol)和PAP(Password Authentication Protocol) (PAP)通常被用于在PPP封装的串行线路上提供平安性认证。使用CHAP和PAP认证,每个路由器通过名字来识别,可以防止XX的访问。任务命令设置PPP封装encapsulation ppp1设置认证方法ppp authentication chap
17、| chap pap | pap chap | pap if-needed list-name | default callin 指定口令username name password secret设置DCE端线路速度clockrate speed举例路由器Router1和Router2的S0口均封装PPP协议,采用CHAP做认证,在Router1中应建立一个用户,以对端路由器主机名作为用户名,即用户名应为router2。同时在Router2中应建立一个用户,以对端路由器主机名作为用户名,即用户名应为router1。所建的这两用户的password必须相同。设置如下:Router1:hostna
18、me router1username router2 password xxxinterface Serial0ip address 192.200.10.1 255.255.255.0clockrate 1000000ppp authentication chap!Router2:hostname router2username router1 password xxxinterface Serial0ip address 192.200.10.2 255.255.255.0ppp authentication chap!ISDN1.综合数字业务网ISDN综合数字业务网ISDN由数字 和数据
19、传输效劳两局部组成,一般由 局提供这种效劳。ISDN的根本速率接口BRI效劳提供2个B信道和1个D信道2B+D。BRI的B信道速率为64Kbps,用于传输用户数据。D信道的速率为16Kbps,主要传输控制信号。在北美和日本,ISDN的主速率接口PRI提供23个B信道和1个D信道,总速率可达1.544Mbps,其中D信道速率为64Kbps。而在欧洲、澳大利亚等国家,ISDN的PRI提供30个B信道和1个64Kbps D信道,总速率可达2.048Mbps。我国 局所提供ISDN PRI为30B+D。2.根本命令任务命令设置ISDN交换类型isdn switch-type switch-type1接
20、口设置interface bri 0设置PPP封装encapsulation ppp设置协议地址与 号码的映射dialer map protocol next-hop-address name hostname broadcast dial-string启动PPP多连接ppp multilink设置启动另一个B通道的阈值dialer load-threshold load显示ISDN有关信息show isdn active | history | memory | services | status dsl | interface-type number | timers注:1.交换机类型如下
21、表,国内交换机一般为basic-net3。按区域分关键字交换机类型Australiabasic-ts013 Australian TS013 switchesEuropebasic-1tr6 German 1TR6 ISDN switches basic-nwnet3 Norway NET3 switches (phase 1) basic-net3 NET3 ISDN switches (UK, Denmark, and other nations); covers the Euro-ISDN E-DSS1 signalling system primary-net5 NET5 switch
22、es (UK and Europe) vn2 French VN2 ISDN switches vn3 French VN3 ISDN switchesJapanntt Japanese NTT ISDN switches primary-ntt Japanese ISDN PRI switchesNorth Americabasic-5ess AT&T basic rate switches basic-dms100 NT DMS-100 basic rate switches basic-ni1 National ISDN-1 switches primary-4ess AT&T 4ESS
23、 switch type for the U.S. (ISDN PRI only) primary-5ess AT&T 5ESS switch type for the U.S. (ISDN PRI only) primary-dms100 NT DMS-100 switch type for the U.S. (ISDN PRI only)New Zealandbasic-nznet3 New Zealand Net3 switches3.ISDN实现DDRdial-on-demand routing实例:设置如下:Router1:hostname router1user router2 p
24、assword cisco!isdn switch-type basic-net3!interface bri 0ip address 192.200.10.1 255.255.255.0encapsulation pppdialer map ip 192.200.10.2 name router2 572dialer load-threshold 80ppp multilinkdialer-group 1ppp authentication chap!dialer-list 1 protocol ip permit!Router2:hostname router2user router1 p
25、assword cisco!isdn switch-type basic-net3!interface bri 0ip address 192.200.10.2 255.255.255.0encapsulation pppdialer map ip 192.200.10.1 name router1 571dialer load-threshold 80ppp multilinkdialer-group 1ppp authentication chap!dialer-list 1 protocol ip permit!Cisco路由器同时支持回拨功能,我们将路由器Router1作为Callba
26、ck Server,Router2作为Callback Client。与回拨相关命令:任务命令映射协议地址和 号码,并在接口上使用在全局模式下定义的PPP回拨的映射类别。dialer map protocol address name hostname class classname dial-string设置接口支持PPP回拨ppp callback accept在全局模式下为PPP回拨设置映射类别map-class dialer classname通过查找注册在dialer map里的主机名来决定回拨. dialer callback-server username设置接口要求PPP回拨p
27、pp callback request设置如下:Router1:hostname router1user router2 password cisco!isdn switch-type basic-net3!interface bri 0ip address 192.200.10.1 255.255.255.0encapsulation pppdialer map ip 192.200.10.2 name router2 class s3 572dialer load-threshold 80ppp callback acceptppp multilinkdialer-group 1ppp a
28、uthentication chap!map-class dialer s3dialer callback-server usernamedialer-list 1 protocol ip permit!Router2:hostname router2user router1 password cisco!isdn switch-type basic-net3!interface bri 0ip address 192.200.10.2 255.255.255.0encapsulation pppdialer map ip 192.200.10.1 name router1 571dialer
29、 load-threshold 80ppp callback requestppp multilinkdialer-group 1ppp authentication chap!dialer-list 1 protocol ip permit!相关调试命令:debug dialerdebug isdn eventdebug isdn q921debug isdn q931debug ppp authenticationdebug ppp errordebug ppp negotiationdebug ppp packetshow dialershow isdn status举例:执行debug dialer命令观察router
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1