雏鹰部落

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1486|回复: 1

Cisco 路由配置语句汇总

[复制链接]
发表于 2003-12-15 17:33:58 | 显示全部楼层 |阅读模式
Cisco 路由配置语句汇总<br><br>启动接口,分配IP地址: <br><br>router&gt; <br><br>router&gt; enable <br><br>router# <br><br>router# configure terminal <br><br>router(config)# <br><br>router(config)# interface Type Port <br><br>router(config-if)# no shutdown <br><br>router(config-if)# ip address IP-Address Subnet-Mask <br><br>router(config-if)# ^z <br><br><br>配置RIP路由协议:30秒更新一次 <br><br>router(config)# router rip <br><br>router(config-if)# network Network-Number &lt;--通告标准A,B,C类网--&gt; <br><br>router(config-if)# ^z <br><br><br>配置IGRP路由协议:90秒更新一次 <br><br>router(config)# router igrp AS-Number &lt;-- AS-Number范围1~65535--&gt; <br><br>router(config-if)# network Network-Number &lt;--通告标准A,B,C类网--&gt; <br><br>router(config-if)# ^z <br><br><br>配置Novell IPX路由协议:Novell RIP 60秒更新一次 <br><br>router(config)# ipx routing [node address] <br><br>router(config)# ipx maximum-paths Paths &lt;--设置负载平衡,范围1~512--&gt; <br><br>router(config)# interface Type Port <br><br>router(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] &lt;--通告标准A,B,C类网--&gt; <br><br>router(config-if)# ^z <br><br><br>配置DDR: <br><br>router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number] <br><br>router(config)# interface bri 0 <br><br>router(config-if)# dialer-group Group-Number <br><br>router(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number <br><br>router(config-if)# ^z <br><br><br>配置ISDN: <br><br>router(config)# isdn swith-type Swith-Type &lt;--配置ISDN交换机类型,中国使用basic-net3--&gt; <br><br>router(config-if)# ^z <br><br><br><br><br><br>配置Frame Relay: <br><br>router(config-if)# encapsulation frame-relay [cisco | ietf ] <br><br>router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ] <br><br>router(config-if)# bandwidth kilobits <br><br>router(config-if)# frame-relay invers-arp [ Protocol ] [dlci ] <br><br>&lt;--配置静态Invers ARP表: <br><br>router(config)# frame-relay Protocol Protocol-Address DLCI [ Broadcast ] [ ietf | cisco ] [ payload-compress | packet-by-packet ] <br><br>--&gt; <br><br>&lt;--设置Keepalive间隔: <br><br>router(config-if)# keepalive Number <br><br>--&gt; <br><br>&lt;--为本地接口指定DLCI: <br><br>router(config-if)# frame-lelay local-dlci Number <br><br>--&gt; <br><br>&lt;--子接口配置: <br><br>router(config-if)# interface Type Port.Subininterface-Number [ multipoint | point-to-point ] <br><br>router(config-subif)# ip unnumbered Interface <br><br>router(config-subif)# frame-lelay local-dlci Number <br><br>--&gt; <br><br>router(config-if)# ^z <br><br><br>配置标准ACL: <br><br>router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ] &lt;-- Access-List-Number 范围:1~99标准ACL;100~199扩展ACL;800~899标准IPX ACL;900~999扩展IPX ACL;1000~1099 IPX SAP ACL;600~699Apple Talk ACL--&gt; <br><br>router(config)# interface Type Port <br><br>router(config-if)# ip access-group Access-List-Number [ in | out ] <br><br>router(config-if)# ^z <br><br><br>配置扩展ACL: <br><br>router(config)# access-list Access-List-Number [ permit | deny ] [ Protocol | Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ] <br><br>router(config)# interface Type Port <br><br>router(config-if)# ip access-group Access-List-Number [ in | out ] <br><br>router(config-if)# ^z <br><br><br>配置命名ACL: <br><br>router(config)# ip access-list [ standard | extended ] ACL-Name <br><br>router(config [ std- | ext- ] nacl)# [ permit | deny ] [ IP-Access-List-Test-Conditions ] <br><br>router(config [ std- | ext- ] nacl)# no [ permit | deny ] [ IP-Access-List-Test-Conditions ] <br><br>router(config [ std- | ext- ] nacl)# ^z <br><br>router(config)# interface Type Port <br><br>router(config-if)# ip access-group [ACL-Name | 1~199 ] [ in | out ] <br><br>router(config-if)# ^z <br><br><br>配置DCE时钟: <br><br>router# show controllers Type Port &lt;--确定DCE接口--&gt; <br><br>router(confin-if)# clock rate 64000 &lt;--进入DCE接口设置时钟速率--&gt; <br><br>router(config-if)# ^z <br><br><br>配置PPP协议: <br><br>router(config)# username Name password Set-Password-Here &lt;--验证方建立数据库--&gt; <br><br>router(config)# interface Type Port <br><br>router(config-if)# encapsulation ppp &lt;--启动PPP协议--&gt; <br><br>router(config-if)# ppp outhentication [ chap | chap pap | pap chap | pap ] &lt;--选择PPP认证--&gt; <br><br>router(config-if)# ppp pap sent-username Name password Password &lt;--发送验证信息--&gt; <br><br>router(config-if)# ^z <br><br><br>PAP单向认证配置实例: <br><br>验证方: <br><br>router-server(config)# username Client password 12345 &lt;--验证方建立数据库--&gt; <br><br>router-server(config)# interface serial 0 <br><br>router-server(config-if)# encapsulation ppp <br><br>router-server(config-if)# ppp authentication pap &lt;--选择使用PAP实现PPP认证--&gt; <br><br>router-server(config-if)# ^z <br><br>被验证方: <br><br>router-client(config-if)# encapsulation ppp <br><br>router-client(config-if)# ppp pap sent-username Client password 12345 &lt;--发送验证信息--&gt; <br><br>router-client(config-if)# ^z <br><br><br>PAP双向认证配置实例: <br><br>路由器 A: <br><br>routerA(config)# username B password 12345 <br><br>routerA(config)# interface serial 0 <br><br>routerA(config-if)# encapsulation ppp <br><br>routerA(config-if)# ppp authentication pap <br><br>routerA(config-if)# ppp pap sent-username A password 54321 <br><br>routerA(config-if)# ^z <br><br>路由器 B: <br><br>routerB(config)# username A password 54321 <br><br>routerB(config)# interface serial 1 <br><br>routerB(config-if)# encapsulation ppp <br><br>routerB(config-if)# ppp authentication pap <br><br>routerB(config-if)# ppp pap sent-username B password 12345 <br><br>routerB(config-if)# ^z <br><br><br><br><br>CHAP单向认证配置实例: <br><br>验证方: <br><br>router-server(config)# username router-client password 12345 <br><br>router-server(config)# interface serial 0 <br><br>router-server(config-if)# encapsulation ppp <br><br>router-server(config-if)# ppp authentication chap <br><br>router-server(config-if)# ^z <br><br>被验证方: <br><br>router-client(config-if)# encapsulation ppp <br><br>router-client(config-if)# ppp authentication chap <br><br>router-client(config-if)# ppp chap hostname router-client <br><br>router-client(config-if)# ppp chap password 12345 <br><br>router-client(config-if)# ^z <br><br><br>CHAP双向认证配置实例: <br><br>路由器 A: <br><br>routerA(config)# username routerB password 12345 <br><br>routerA(config)# interface serial 0 <br><br>routerA(config-if)# encapsulation ppp <br><br>routerA(config-if)# ppp authentication chap <br><br>routerA(config-if)# ppp chap hostname routerA <br><br>routerA(config-if)# ppp chap password 54321 <br><br>routerA(config-if)# ^z <br><br>路由器 B: <br><br>routerB(config)# username routerA password 54321 <br><br>routerB(config)# interface serial 1 <br><br>routerB(config-if)# encapsulation ppp <br><br>routerB(config-if)# ppp authentication chap <br><br>routerB(config-if)# ppp chap hostname routerB <br><br>routerB(config-if)# ppp chap password 12345 <br><br>routerB(config-if)# ^z <br><br><br>Telnet使用: <br><br>routerA# terminal monitor &lt;--可以传回在远端主机执行Debug命令的结果--&gt; <br><br>routerA# telnet IP-Address [ Router-Name ] &lt;--Telnet到指定的地址或名字的主机--&gt; <br><br>routerB# [ exit | logout ] &lt;--退出Telnet--&gt; <br><br>routerB# ++&lt;6&gt;再按 &lt;--挂起Telnet--&gt; <br><br>routerA# show sessions &lt;--显示当前所有Telnet的信息,包括Connect-Number --&gt; <br><br>routerA# Connect-Number &lt;--返回指定的Telnet连接--&gt; <br><br>routerA# disconnect IP-Address [ Router-Name ] &lt;--断开指定地址或名字的主机的连接--&gt; <br><br>routerA# show user &lt;--显示Telnet到本机的连接信息--&gt; <br><br>routerA# clear line [ 0 | 1 | 2 | 3 | 4 ] &lt;--断开指定Telnet到本机的连接--&gt; <br><br><br><br>禁止任何Telnet到本机: <br><br>router(config)# line vty 0 4 <br><br>router(config-line)# access-class ACL-Number <br><br>router(config)# ^z <br><br><br>设置主机名: <br><br>router(config)# hostname Set-Hostname <br><br>router(config)# ^z <br><br>router(config)# ^z <br><br><br>设置用户模式密码: <br><br>router(config)# line console 0 <br><br>router(config-line)# login <br><br>router(config-line)# password Set-Password <br><br>router(config-line)# ^z <br><br>设置Telnet密码: <br><br>router(config)# line vty 0 4 <br><br>router(config-line)# login <br><br>router(config-line)# password Set-Password <br><br>router(config-line)# ^z <br><br><br>设置特权模式密码: <br><br>router(config)# enable password Set-Password &lt;--不加密的密码,明码--&gt; <br><br>router(config)# enable secret Set-Password &lt;--经过加密的密码--&gt; <br><br>router(config)# ^z <br><br><br>给所有密码加密: <br><br>router(config)# service password-ancryption Set-Password-Here <br><br>router(config)# no service password-ancryption &lt;--取消加密--&gt; <br><br>router(config)# ^z <br><br><br>设置登录Banner: <br><br>router(config)# banner motd 分隔符 Set-Banner-InFORMation-Here 分隔符 &lt;--前后分隔符一定要一致--&gt; <br><br><br>设置接口的描述信息: <br><br>router(config-if)# description Set-Port-InFORMation-Here <br><br>router(config)# ^z <br><br><br>CDP的控制: <br><br>router(config-if)# cdp enable &lt;--在指定端口启用CDP,缺省--&gt; <br><br>router(config-if)# no cdp enable &lt;--在指定端口关闭CDP--&gt; <br><br>router(config)# cdp run &lt;--使所有端口启用CDP--&gt; <br><br>router(config)# no cdp run &lt;--使所有端口关闭CDP--&gt; <br><br><br>Ping的使用: <br><br>router# ping IP-Address <br><br>router# ping &lt;--扩展Ping命令--&gt; <br><br>Protocol [ip]:[ Protocol-Type ] &lt;--选择协议类型--&gt; <br><br>Target IP address:IP-Address &lt;--输入测试地址--&gt; <br><br>Repeat count [5]: &lt;--选择发送的ICMP包数量--&gt; <br><br>Datagram size [100]: &lt;--选择每个包的大小--&gt; <br><br>Timeout in seconds [2]: &lt;--设置每个包的超时时间--&gt; <br><br>Extended commands [n]:y &lt;--使用扩展Ping命令--&gt; <br><br>Sweep range of sizes [n]: <br><br><br>Tracke的使用: <br><br>router# trace IP-Address [ Host-Name ] <br><br><br>为Cisco 4000路由器指定媒体类型: <br><br>router(config-if)# media-type 10baset &lt;--使AUI(默认)失效,改为使用RJ-45--&gt; <br><br>router(config-if)# ^z <br><br><br>更改路由器启动顺序: <br><br>router(config)# boot system flash IOS-FileName <br><br>router(config)# boot system tftp IOS-FileName TFTP-IP-Address <br><br>router(config)# boot system rom <br><br>router(config)# ^z <br><br><br>修改寄存器数值: <br><br>router(config)# config-register value &lt;--Cisco出厂默认value=0x2102,value范围:0x2100(进入ROM监视器),0x2101(使系统从ROM启动),0x2102~0x210F(使系统从NVRAM启动)。0x1=0x2101,从最小位开始改变--&gt; <br><br><br>在ROM监视器中更改寄存器数值: <br><br>&gt; o/r value <br><br><br>路由器密码的恢复: <br><br>冷关机,然后再开机并在60秒内按&lt; Ctrl&gt;+进入ROM监视器模式 <br><br>&gt; o/r 0x2142 &lt;--25xx型路由器--&gt; 或 &gt; confreg 0x2142 &lt;--16xx型路由器--&gt; <br><br>router&gt; I <br><br>router&gt; n <br><br>router&gt; enable <br><br>router# copy startup-config running-config <br><br>router# configure terminal <br><br>router(config)# enable secret New-Password <br><br>router(config)# config-register 0x2102 <br><br>router(config)# ^z <br><br>router# copy running-config startup-config <br><br>router# reload <br><br><br>配置名称-主机入口: <br><br>router(config)# ip host Set-Name [ TCP-Port-Number ] IP-Address [ IP-Address 2 ]... <br><br>router(config)# ^z <br><br><br>定义DNS主机: <br><br>router(config)# ip name-server Server-Address [ Server-Address 2 ]... <br><br>router(config)# ^z <br><br><br>禁用DNS: <br><br>router(config)# no ip domain-lookup <br><br>router(config)# ^z <br><br><br>配置水平分割: <br><br>router(config-if)# ip split-horizon <br><br>router(config-if)# no ip split-horizon <br><br>router(config-if)# ^z <br><br><br>配置静态路由: <br><br>router(config)# ip route IP-Address Subnet-Mask [ Next-Hop-Address | Local-Out-Port ] [Distace ] <br><br>&lt;--Distance范围:1~255,相当于优先权,越小越好。RIP=120;DSPF=110;IGRP=100;EIGRP=90--&gt; <br><br>router(config)# ^z <br><br><br>配置缺省路由: <br><br>router(config)# ip defoult-network IP-Address &lt;--动态缺省路由--&gt; <br><br>router(config)# ip route 0.0.0.0 0.0.0.0 [ Next-Hop-Address | Local-Out-Port ] [Distace ] &lt;--静态缺省路由--&gt; <br><br>router(config)# ^z <br><br><br>其它命令: <br><br>router# show version <br><br>router# show running-config <br><br>router# show startup-config <br><br>router# show flash <br><br>router# show interface [ Type Port ] <br><br>router# show buffers <br><br>router# show protocol <br><br>router# show mem <br><br>router# show stacks <br><br>router# show processes <br><br>router# show cdp entry [ Device-Name ] &lt;--显示指定邻居三层信息--&gt; <br><br>router# show cdp neighbors <br><br>router# show cdp neighbors detail &lt;---显示所有邻居三层信息-&gt; <br><br>router# show ip router <br><br>router# show ipx router <br><br>router# show host <br><br>router# show ip protocol <br><br>router# show ip interface Type Port <br><br>router# show ipx interface Type Port <br><br>router# show ipx servers <br><br>router# show ipx traffic <br><br>router# show access-lists [ ACL-Number ] <br><br>router# show isdn status <br><br>router# show dialer &lt;--查看ISDN拨号信息--&gt; <br><br>router# show isdn active <br><br>router# show frame-relay pvc <br><br>router# show frame-relay map <br><br>router# show frame-relay lmi <br><br>router# erase startup-config <br><br>router# reload <br><br>router# setup <br><br>router# copy running-config startup-config <br><br>router# copy startup-config running-config <br><br>router# copy tftp running-config <br><br>router# copy running-config tftp <br><br>router# debug ipx routing activity <br><br>router# debug ipx sap <br><br>router# debug isdn q921 <br><br>router# debug isdn q931 <br><br>router# debug dialer <br><br>router# debug ip rip <br><br>router# clear interface bri [ 0 | 1 | 2 ]<br>
发表于 2003-12-16 08:31:31 | 显示全部楼层
原来PAP的被验证方需要这样配置,胡大和cmsc快来看看,难怪我们一直挂掉~
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )

GMT+8, 2024-6-14 21:47 , Processed in 0.078316 second(s), 18 queries , Gzip On.

快速回复 返回顶部 返回列表