这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 综合技术 » 如何调试思科路由器

共5条 1/1 1 跳转至

如何调试思科路由器

菜鸟
2006-12-20 06:48:29     打赏
一、基本设置方式 一般来说,可以用5种方式来设置Cisco思科路由器: 1.Console口接终端或运行终端仿真软件的微机; 2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连; 3.通过Ethernet上的TFTP服务器; 4.通过Ethernet上的TELNET程序; 5.通过Ethernet上的SNMP网管工作站。 但Cisco思科路由器的第一次设置必须通过第一种方式进行,一般用超级终端通过com口进行控制。此时终端的硬件设置如下: 波特率 :9600 数据位 :8 停止位 :1 奇偶校验: 无 二、命令操作 Cisco思科路由器所用的操作系统是IOS.共有以下几种状态: 1、router> 在router>提示符下,Cisco思科路由器处于用户命令状态,这时用户可以看Cisco思科路由器的连接状态,访问其它网络和主机,但不能看到和更改Cisco思科路由器的设置内容。此时输入?并回车,可以查看到在此状态下可以用的命令。(IOS允许你在任何时候用这种方式查看在某种状态下可以用的命令)。在敲入enable并回车后,按照系统提示输入密码,(在新的Cisco思科路由器第一次进行调试的时候不需要输入密码,直接回车即可)进入#提示符,就可以对Cisco思科路由器进行各种操作了。 2、router# Cisco思科路由器进入特权命令状态router#后,不但可以执行所有的用户命令,还可以看到和更改Cisco思科路由器的设置内容。此时就可以对Cisco思科路由器的名字、密码等进行设置。 3、router(config)# 在router#提示符下键入configure terminal,出现提示符router(config)#,此时Cisco思科路由器处于全局设置状态,这时可以设置Cisco思科路由器的全局参数。 4、router(config-if)#; router(config-line)#; router(config-router)#;… Cisco思科路由器处于局部设置状态,这时可以设置Cisco思科路由器某个局部的参数。 5、Cisco思科路由器处于RXBOOT状态,在开机后60秒内按ctrl-break可进入此状态,这时Cisco思科路由器不能完成正常的功能,只能进行软件升级和手工引导。在此状态下,可以进行口令恢复。 三、常用命令 1.帮助 在IOS操作中,无论任何状态和位置,都可以键入“?”得到系统的帮助。系统会显示此时可以使用的命令。 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 退出局部设置状态Exit 3.显示命令 任务命令 查看版本及引导信息show version 查看运行设置show running-config 查看开机设置show startup-config 显示端口信息show interface type slot/number 显示路由信息show ip router 4.拷贝命令 用于IOS及CONFIG的备份和升级 5.网络命令 任务命令 登录远程主机telnet hostname|IP address 网络侦测ping hostname|IP address 路由跟踪Trace hostname|IP address 6.基本设置命令 任务命令 全局设置config terminal 设置访问用户及密码username username password password 设置特权密码enable secret password 设置Cisco思科路由器名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] 设置登录密码password password



关键词: 如何     调试     思科     路由器     设置     Cisco     命令         

菜鸟
2006-12-20 06:49:00     打赏
2楼
四、总体设置 在router#特权命令状态下,可以用setup对Cisco思科路由器进行总体设计,利用这个设计过程可以省略手工设置的烦琐。但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。 进入设置对话过程后,Cisco思科路由器首先会显示一些提示信息: --- 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 are in square brackets '[]'. 这是告诉你在设置对话过程中的任何地方都可以键入“?”得到系统的帮助,按ctrl-c可以退出设置过程,缺省设置将显示在‘[]’中。然后Cisco思科路由器会问是否进入设置对话: Would you like to enter the initial configuration dialog? [yes]: 如果按y或回车,Cisco思科路由器就会进入设置对话过程。首先你可以看到各端口当前的状况: First, would you like to see the current interface summary? [yes]: Any interface listed with OK? value "NO" does not have a valid configuration InterfaceIP-AddressOK?MethodStatusProtocol Ethernet0unassignedNOunsetupup Serial0unassignedNOunsetupup …………………………… 然后,Cisco思科路由器就开始全局参数的设置: Configuring global parameters: 1.设置Cisco思科路由器名: Enter host name [Router]: 2.设置进入特权状态的密文(secret),此密文在设置以后不会以明文方式显示: The enable secret is a one-way cryptographic secret used instead of the enable password when it exists. Enter enable secret: cisco 3.设置进入特权状态的密码(password),此密码只在没有密文时起作用,并且在设置以后会以明文方式显示: The enable password is used when there is no enable secret and when using older software and some boot images. Enter enable password: pass 4.设置虚拟终端访问时的密码: Enter virtual terminal password: cisco 5.询问是否要设置Cisco思科路由器支持的各种网络协议: 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 speed [9600]: 2)是否使用硬件流控: Configure for HW flow control? [yes]: 3)是否设置modem: Configure for modems? [yes/no]: yes 4)是否使用默认的modem命令: Configure for default chat script? [yes]: 5)是否设置异步口的PPP参数: Configure for Dial-in IP SLIP/PPP access? [no]: yes 6)是否使用动态IP地址: Configure for Dynamic IP addresses? [yes]: 7)是否使用缺省IP地址: Configure Default IP addresses? [no]: yes 是否使用TCP头压缩: Configure for TCP Header Compression? [yes]: 9)是否在异步口上使用路由表更新: Configure for routing updates on async links? [no]: y 10)是否设置异步口上的其它协议。接下来,系统会对每个接口进行参数的设置。 1.Configuring interface Ethernet0: 1)是否使用此接口: Is this interface in use? [yes]: 2)是否设置此接口的IP参数: Configure IP on this interface? [yes]: 3)设置接口的IP地址: IP address for this interface: 192.168.162.2 4)设置接口的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 Router enable secret 5 $1$W5Oh$p6J7tIgRMBOIKVXVG53Uh1 enable password pass ………… 请注意在enable secret后面显示的是乱码,而enable password后面显示的是设置的内容。就是说,secret密码的优先级比较高,在两个密码都设了的情况下,secret密码起作用。 显示结束后,系统会问是否使用这个设置: Use this configuration? [yes/no]: yes 如果回答yes,系统就会把设置的结果存入Cisco思科路由器的NVRAM中,然后结束设置对话过程,使Cisco思科路由器开始正常的工作。 广域网协议设置 PPP PPP(Point-to-Point Protocol)是SLIP(Serial Line IP protocol)的继承者,它提供了跨过同步和异步电路实现Cisco思科路由器到Cisco思科路由器(router-to-router)和主机到网络(host-to-network)的连接。 CHAP(Challenge Handshake Authentication Protocol)和PAP(Password Authentication Protocol) (PAP)通常被用于在PPP封装的串行线路上提供安全性认证。使用CHAP和PAP认证,每个Cisco思科路由器通过名字来识别,可以防止未经授权的访问。 任务命令 设置PPP封装encapsulation ppp1 设置认证方法ppp authentication {chap | chap pap | pap chap | pap} [if-needed] [list-name | default] [callin] 指定口令username name password secret 设置DCE端线路速度clockrate speed 举例 Cisco思科路由器Router1和Router2的S0口均封装PPP协议,采用CHAP做认证,在Router1中应建立一个用户,以对端Cisco思科路由器主机名作为用户名,即用户名应为router2。同时在Router2中应建立一个用户,以对端Cisco思科路由器主机名作为用户名,即用户名应为router1。所建的这两用户的password必须相同。 设置如下: Router1: hostname router1 username router2 password xxx interface Serial0 ip address 192.200.10.1 255.255.255.0 clockrate 1000000 ppp authentication chap ! Router2: hostname router2 username router1 password xxx interface Serial0 ip address 192.200.10.2 255.255.255.0 ppp authentication chap !

菜鸟
2006-12-20 06:50:00     打赏
3楼
ISDN 1.综合数字业务网(ISDN) 综合数字业务网(ISDN)由数字电话和数据传输服务两部分组成,一般由电话局提供这种服务。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 接口设置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.交换机类型如下表,国内交换机一般为basic-net3。 按区域分关键字 交换机类型 Australia basic-ts013 Australian TS013 switches Europe basic-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 switches (UK and Europe) vn2 French VN2 ISDN switches vn3 French VN3 ISDN switches Japan ntt Japanese NTT ISDN switches primary-ntt Japanese ISDN PRI switches North America basic-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 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 Zealand basic-nznet3 New Zealand Net3 switches 3.ISDN实现DDR(dial-on-demand routing)实例: 设置如下: Router1: hostname router1 user router2 password cisco ! isdn switch-type basic-net3 ! interface bri 0 ip address 192.200.10.1 255.255.255.0 encapsulation ppp dialer map ip 192.200.10.2 name router2 572 dialer load-threshold 80 ppp multilink dialer-group 1 ppp authentication chap ! dialer-list 1 protocol ip permit ! Router2: hostname router2 user router1 password cisco ! isdn switch-type basic-net3 ! interface bri 0 ip address 192.200.10.2 255.255.255.0 encapsulation ppp dialer map ip 192.200.10.1 name router1 571 dialer load-threshold 80 ppp multilink dialer-group 1 ppp authentication chap ! dialer-list 1 protocol ip permit ! CiscoCisco思科路由器同时支持回拨功能,我们将Cisco思科路由器Router1作为Callback 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回拨ppp callback request 设置如下: Router1: hostname router1 user router2 password cisco ! isdn switch-type basic-net3 ! interface bri 0 ip address 192.200.10.1 255.255.255.0 encapsulation ppp dialer map ip 192.200.10.2 name router2 class s3 572 dialer load-threshold 80 ppp callback accept ppp multilink dialer-group 1 ppp authentication chap ! map-class dialer s3 dialer callback-server username dialer-list 1 protocol ip permit ! Router2: hostname router2 user router1 password cisco ! isdn switch-type basic-net3 ! interface bri 0 ip address 192.200.10.2 255.255.255.0 encapsulation ppp dialer map ip 192.200.10.1 name router1 571 dialer load-threshold 80 ppp callback request ppp multilink dialer-group 1 ppp authentication chap ! dialer-list 1 protocol ip permit !

菜鸟
2006-12-20 06:50:00     打赏
4楼
相关调试命令: debug dialer debug isdn event debug isdn q921 debug isdn q931 debug ppp authentication debug ppp error debug ppp negotiation debug ppp packet show dialer show isdn status 举例: 执行debug dialer命令观察router2呼叫router1,router1回拨router2的过程. router1#debug dialer router2#ping 192.200.10.1 router1# 00:03:50: %LINK-3-UPDOWN: Interface BRI0:1, changed state to up 00:03:50: BRI0:1PP callback Callback server starting to router2 572 00:03:50: BRI0:1: disconnecting call 00:03:50: %LINK-3-UPDOWN: Interface BRI0:1, changed state to down 00:03:50: BRI0:1: disconnecting call 00:03:50: BRI0:1: disconnecting call 00:03:51: %LINK-3-UPDOWN: Interface BRI0:2, changed state to up 00:03:52: callback to router2 already started 00:03:52: BRI0:2: disconnecting call 00:03:52: %LINK-3-UPDOWN: Interface BRI0:2, changed state to down 00:03:52: BRI0:2: disconnecting call 00:03:52: BRI0:2: disconnecting call 00:04:05: : Callback timer expired 00:04:05: BRI0:beginning callback to router2 572 00:04:05: BRI0: Attempting to dial 572 00:04:05: Freeing callback to router2 572 00:04:05: %LINK-3-UPDOWN: Interface BRI0:1, changed state to up 00:04:05: BRI0:1: No callback negotiated 00:04:05: %LINK-3-UPDOWN: Interface Virtual-Access1, changed state to up 00:04:05: dialer Protocol up for Vi1 00:04:06: %LINEPROTO-5-UPDOWN: Line protocol on Interface BRI0:1, changed state to up 00:04:06: %LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access1, chang ed state to up 00:04:11: %ISDN-6-CONNECT: Interface BRI0:1 is now connected to 572 #router1 4.ISDN访问首都在线263网实例: 本地局部网地址为10.0.0.0/24,属于保留地址,通过NAT地址翻译功能,局域网用户可以通过ISDN上263网访问Internet。263的ISDN电话号码为2633,用户为263,口令为263,所涉及的命令如下表: 任务命令 指定接口通过PPP/IPCP地址协商获得IP地址ip address negotiated 指定内部和外部端口ip nat {inside | outside} 使用ppp/pap作认证ppp authentication pap callin 指定接口属于拨号组1dialer-group 1 定义拨号组1允许所有IP协议dialer-list 1 protocol ip permit 设定拨号,号码为2633dialer string 2633 设定登录263的用户名和口令ppp pap sent-username 263 password 263 设定默认路由ip route 0.0.0.0 0.0.0.0 bri 0 设定符合访问列表2的所有源地址被翻译为bri 0所拥有的地址ip nat inside source list 2 interface bri 0 overload 设定访问列表2,允许所有协议access-list 2 permit any 具体配置如下: hostname Cisco2503 ! isdn switch-type basic-net3 ! ip subnet-zero no ip domain-lookup ip routing ! interface Ethernet 0 ip address 10.0.0.1 255.255.255.0 ip nat inside no shutdown ! interface Serial 0 shutdown no description no ip address ! interface Serial 1 shutdown no description no ip address ! interface bri 0 ip address negotiated ip nat outside encapsulation ppp ppp authentication pap callin ppp multilink dialer-group 1 dialer hold-queue 10 dialer string 2633 dialer idle-timeout 120 ppp pap sent-username 263 password 263 no cdp enable no ip split-horizon no shutdown ! ip classless ! ! Static Routes ! ip route 0.0.0.0 0.0.0.0 bri 0 ! ! Access Control List 2 ! access-list 2 permit any ! dialer-list 1 protocol ip permit ! ! Dynamic NAT ! ip nat inside source list 2 interface bri 0 overload snmp-server community public ro ! line console 0 exec-timeout 0 0 ! line vty 0 4 ! end

菜鸟
2006-12-20 06:52:00     打赏
5楼
路由协议配置 RIP协议 RIP(Routing information Protocol)是应用较早、使用较普遍的内部网关协议(Interior Gateway Protocol,简称IGP),适用于小型同类网络,是典型的距离向量(distance-vector)协议。文档见RFC1058、RFC1723。 RIP通过广播UDP报文来交换路由信息,每30秒发送一次路由信息更新。RIP提供跳跃计数(hop count)作为尺度来衡量路由距离,跳跃计数是一个包到达目标所必须经过的Cisco思科路由器的数目。如果到相同目标有二个不等速或不同带宽的Cisco思科路由器,但跳跃计数相同,则RIP认为两个路由是等距离的。RIP最多支持的跳数为15,即在源和目的网间所要经过的最多Cisco思科路由器的数目为15,跳数16表示不可达。 1.有关命令 任务命令 指定使用RIP协议router rip 指定RIP版本version {1|2}1 指定与该Cisco思科路由器相连的网络network network 注:1.Cisco的RIP版本2支持验证、密钥管理、路由汇总、无类域间路由(CIDR)和变长子网掩码(VLSMs)

共5条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]