思科路由器基本配置与常用配置命令(simple for CCNA)启动接口,分配IP地址:router>router> enablerouter#router# configure terminalrouter(config)#router(config)# interface Type Portrouter(config-if)# no shutdownrouter(config-if)# ip address IP-Address Subnet-Maskrouter(config-if)# ^z配置RIP路由协议:30秒更新一次router(config)# router riprouter(config-if)# network Network-Numberrouter(config-if)# ^z配置IGRP路由协议:90秒更新一次router(config)# router igrp AS-Numberrouter(config-if)# network Network-Numberrouter(config-if)# ^z配置Novell IPX路由协议:Novell RIP 60秒更新一次router(config)# ipx routing [node address]router(config)# ipx maximum-paths Pathsrouter(config)# interface Type Portrouter(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] router(config-if)# ^z配置DDR:router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number]router(config)# interface bri 0router(config-if)# dialer-group Group-Numberrouter(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number router(config-if)# ^z配置ISDN:router(config)# isdn swith-type Swith-Typerouter(config-if)# ^z配置Frame Relay:router(config-if)# encapsulation frame-relay [cisco | ietf ]router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ]router(config-if)# bandwidth kilobitsrouter(config-if)# frame-relay invers-arp [ Protocol ] [dlci ]router(config-if)# ^z配置标准ACL:router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ]router(config)# interface Type Portrouter(config-if)# ip access-group Access-List-Number [ in | out ]router(config-if)# ^z配置扩展ACL:router(config)# access-list Access-List-Number [ permit | deny ] [ Protocol | Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ]router(config)# interface Type Portrouter(config-if)# ip access-group Access-List-Number [ in | out ]router(config-if)# ^z配置命名ACL:router(config)# ip access-list [ standard | extended ] ACL-Namerouter(config [ std- | ext- ] nacl)# [ permit | deny ] [ IP-Access-List-Test-Conditions ] router(config [ std- | ext- ] nacl)# no [ permit | deny ] [ IP-Access-List-Test-Conditions ] router(config [ std- | ext- ] nacl)# ^zrouter(config)# interface Type Portrouter(config-if)# ip access-group [ACL-Name | 1~199 ] [ in | out ]router(config-if)# ^z配置DCE时钟:router# show controllers Type Portrouter(confin-if)# clock rate 64000router(config-if)# ^z配置PPP协议:router(config)# username Name password Set-Password-Hererouter(config)# interface Type Portrouter(config-if)# encapsulation ppprouter(config-if)# ppp outhentication [ chap | chap pap | pap chap | pap ]router(config-if)# ppp pap sent-username Name password Passwordrouter(config-if)# ^zPAP单向认证配置实例:验证方:router-server(config)# username Client password 12345router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication paprouter-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp pap sent-username Client password 12345router-client(config-if)# ^zPAP双向认证配置实例:路由器A:routerA(config)# username B password 12345routerA(config)# interface serial 0routerA(config-if)# encapsulation ppprouterA(config-if)# ppp authentication paprouterA(config-if)# ppp pap sent-username A password 54321routerA(config-if)# ^z路由器B:routerB(config)# username A password 54321routerB(config)# interface serial 1routerB(config-if)# encapsulation ppprouterB(config-if)# ppp authentication paprouterB(config-if)# ppp pap sent-username B password 12345routerB(config-if)# ^zCHAP单向认证配置实例:验证方:router-server(config)# username router-client password 12345router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication chaprouter-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp authentication chaprouter-client(config-if)# ppp chap hostname router-clientrouter-client(config-if)# ppp chap password 12345router-client(config-if)# ^zCHAP双向认证配置实例:路由器A:routerA(config)# username routerB password 12345routerA(config)# interface serial 0routerA(config-if)# encapsulation ppprouterA(config-if)# ppp authentication chaprouterA(config-if)# ppp chap hostname routerArouterA(config-if)# ppp chap password 54321 routerA(config-if)# ^z路由器B:routerB(config)# username routerA password 54321routerB(config)# interface serial 1routerB(config-if)# encapsulation ppprouterB(config-if)# ppp authentication chaprouterB(config-if)# ppp chap hostname routerBrouterB(config-if)# ppp chap password 12345routerB(config-if)# ^zTelnet使用:routerA# terminal monitorrouterA# telnet IP-Address [ Router-Name ]routerB# [ exit | logout ]routerB# ++再按routerA# show sessionsrouterA# Connect-NumberrouterA# disconnect IP-Address [ Router-Name ]routerA# show userrouterA# clear line [ 0 | 1 | 2 | 3 | 4 ]禁止任何Telnet到本机:router(config)# line vty 0 4router(config-line)# access-class ACL-Numberrouter(config)# ^z设置主机名:router(config)# hostname Set-Hostnamerouter(config)# ^zrouter(config)# ^z设置用户模式密码:。