时间: 2021-07-31 作者:daque
Cisco路由配置语句汇总 启用接口,调配ip地方: router> router> enable router# router# configure terminal router(config)# router(config)# interface type port router(config-if)# no shutdown router(config-if)# ip address ip-address subnet-mask router(config-if)# ^z 摆设rip路由和议:30秒革新一次 router(config)# router rip router(config-if)# network network-number <--公布规范a,b,c类网--> router(config-if)# ^z 摆设igrp路由和议:90秒革新一次 router(config)# router igrp as-number <-- as-number范畴1~65535--> router(config-if)# network network-number <--公布规范a,b,c类网--> router(config-if)# ^z 摆设novell ipx路由和议:novell rip 60秒革新一次 router(config)# ipx routing [node address] router(config)# ipx maximum-paths paths <--树立负载平稳,范畴1~512--> router(config)# interface type port router(config-if)# ipx network network-number [encapsulation encapsulation-type] [secondary] <--公布规范a,b,c类网--> router(config-if)# ^z 摆设ddr: router(config)# dialer-list group-number protocol protocol-type permit [list acl-number] router(config)# interface bri 0 router(config-if)# dialer-group group-number router(config-if)# dialer map protocol-type next-hop-address name hostname telphone-number router(config-if)# ^z 摆设isdn: router(config)# isdn swith-type swith-type <--摆设isdn调换机典型,华夏运用basic-net3--> router(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 kilobits router(config-if)# frame-relay invers-arp [ protocol ] [dlci ] <--摆设静态invers arp表: router(config)# frame-relay protocol protocol-address dlci [ broadcast ] [ ietf | cisco ] [ payload-compress | packet-by-packet ] --> <--树立keepalive间隙: router(config-if)# keepalive number --> <--为当地接口指定dlci: router(config-if)# frame-lelay local-dlci number --> <--子接口摆设: router(config-if)# interface type port.subininterface-number [ multipoint | point-to-point ] router(config-subif)# ip unnumbered interface router(config-subif)# frame-lelay local-dlci number --> router(config-if)# ^z 摆设规范acl: router(config)# access-list access-list-number [ permit | deny ] source [ source-mask ] <-- 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--> router(config)# interface type port router(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 port router(config-if)# ip access-group access-list-number [ in | out ] router(config-if)# ^z 摆设定名acl: router(config)# ip access-list [ standard | extended ] acl-name router(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)# ^z router(config)# interface type port router(config-if)# ip access-group [acl-name | 1~199 ] [ in | out ] router(config-if)# ^z 摆设dce时钟: router# show controllers type port <--决定dce接口--> router(confin-if)# clock rate 64000 <--加入dce接口树立时钟速度--> router(config-if)# ^z 摆设ppp和议: router(config)# username name password set-password-here <--考证方创造数据库--> router(config)# interface type port router(config-if)# encapsulation ppp <--启用ppp和议--> router(config-if)# ppp outhentication [ chap | chap pap | pap chap | pap ] <--采用ppp认证--> router(config-if)# ppp pap sent-username name password password <--发送考证消息--> router(config-if)# ^z pap单向认证摆设范例: 考证方: router-server(config)# username client password 12345 <--考证方创造数据库--> router-server(config)# interface serial 0 router-server(config-if)# encapsulation ppp router-server(config-if)# ppp authentication pap <--采用运用pap实行ppp认证--> router-server(config-if)# ^z 被考证方: router-client(config-if)# encapsulation ppp router-client(config-if)# ppp pap sent-username client password 12345 <--发送考证消息--> router-client(config-if)# ^z pap双向认证摆设范例: 路由器 a: routera(config)# username b password 12345 routera(config)# interface serial 0 routera(config-if)# encapsulation ppp routera(config-if)# ppp authentication pap routera(config-if)# ppp pap sent-username a password 54321 routera(config-if)# ^z 路由器 b: routerb(config)# username a password 54321 routerb(config)# interface serial 1 routerb(config-if)# encapsulation ppp routerb(config-if)# ppp authentication pap routerb(config-if)# ppp pap sent-username b password 12345 routerb(config-if)# ^z chap单向认证摆设范例: 考证方: router-server(config)# username router-client password 12345 router-server(config)# interface serial 0 router-server(config-if)# encapsulation ppp router-server(config-if)# ppp authentication chap router-server(config-if)# ^z 被考证方: router-client(config-if)# encapsulation ppp router-client(config-if)# ppp authentication chap router-client(config-if)# ppp chap hostname router-client router-client(config-if)# ppp chap password 12345 router-client(config-if)# ^z chap双向认证摆设范例: 路由器 a: routera(config)# username routerb password 12345 routera(config)# interface serial 0 routera(config-if)# encapsulation ppp routera(config-if)# ppp authentication chap routera(config-if)# ppp chap hostname routera routera(config-if)# ppp chap password 54321 routera(config-if)# ^z [page_break]路由器 b: routerb(config)# username routera password 54321 routerb(config)# interface serial 1 routerb(config-if)# encapsulation ppp routerb(config-if)# ppp authentication chap routerb(config-if)# ppp chap hostname routerb routerb(config-if)# ppp chap password 12345 routerb(config-if)# ^z telnet运用: routera# terminal monitor <--不妨传回在远端长机实行debug吩咐的截止--> routera# telnet ip-address [ router-name ] <--telnet到指定的地方或名字的长机--> routerb# [ exit | logout ] <--退出telnet--> routerb# ++<6>再按 <--挂起telnet--> routera# show sessions <--表露暂时一切telnet的消息,囊括connect-number --> routera# connect-number <--归来指定的telnet贯穿--> routera# disconnect ip-address [ router-name ] <--割断指定地方或名字的长机的贯穿--> routera# show user <--表露telnet到本机的贯穿消息--> routera# clear line [ 0 | 1 | 2 | 3 | 4 ] <--割断指定telnet到本机的贯穿--> 遏止任何telnet到本机: router(config)# line vty 0 4 router(config-line)# access-class acl-number router(config)# ^z 树立长机名: router(config)# hostname set-hostname router(config)# ^z router(config)# ^z 树立用户形式暗号: router(config)# line console 0 router(config-line)# login router(config-line)# password set-password router(config-line)# ^z 树立telnet暗号: router(config)# line vty 0 4 router(config-line)# login router(config-line)# password set-password router(config-line)# ^z 树立特权形式暗号: router(config)# enable password set-password <--不加密的暗号,明码--> router(config)# enable secret set-password <--过程加密的暗号--> router(config)# ^z 给一切暗号加密: router(config)# service password-ancryption set-password-here router(config)# no service password-ancryption <--废除加密--> router(config)# ^z 树立登录banner: router(config)# banner motd 分割符 set-banner-information-here 分割符 <--前后分割符确定要普遍--> 树立接口的刻画消息: router(config-if)# description set-port-information-here router(config)# ^z cdp的遏制: router(config-if)# cdp enable <--在指定端口起用cdp,缺省--> router(config-if)# no cdp enable <--在指定端口封闭cdp--> router(config)# cdp run <--使一切端口起用cdp--> router(config)# no cdp run <--使一切端口封闭cdp--> ping的运用: router# ping ip-address router# ping <--扩充ping吩咐--> protocol [ip]:[ protocol-type ] <--采用和议典型--> target ip address:ip-address <--输出尝试地方--> repeat count [5]: <--采用发送的icmp包数目--> datagram size [100]: <--采用每个包的巨细--> timeout in seconds [2]: <--树立每个包的超时功夫--> extended commands [n]:y <--运用扩充ping吩咐--> sweep range of sizes [n]: tracke的运用: router# trace ip-address [ host-name ] 为cisco 4000路由器指定媒介典型: router(config-if)# media-type 10baset <--使aui(默许)作废,改为运用rj-45--> router(config-if)# ^z 变动路由器启用程序: router(config)# boot system flash ios-filename router(config)# boot system tftp ios-filename tftp-ip-address router(config)# boot system rom router(config)# ^z 窜改存放器数值: router(config)# config-register value <--cisco出厂默许value=0x2102,value范畴:0x2100(加入rom监督器),0x2101(使体例从rom启用),0x2102~0x210f(使体例从nvram启用)。0x1=0x2101,从最小位发端变换--> 在rom监督器中变动存放器数值: > o/r value 路由器暗号的回复: 冷关灯,而后再开机并在60秒内按< ctrl>+加入rom监督器形式 > o/r 0x2142 <--25xx型路由器--> 或 > confreg 0x2142 <--16xx型路由器--> router> i router> n router> enable router# copy startup-config running-config router# configure terminal router(config)# enable secret new-password router(config)# config-register 0x2102 router(config)# ^z router# copy running-config startup-config router# reload 摆设称呼-长机进口: router(config)# ip host set-name [ tcp-port-number ] ip-address [ ip-address 2 ]... router(config)# ^z 设置dns长机: router(config)# ip name-server server-address [ server-address 2 ]... router(config)# ^z 禁止使用dns: router(config)# no ip domain-lookup router(config)# ^z 摆设水等分割: router(config-if)# ip split-horizon router(config-if)# no ip split-horizon router(config-if)# ^z 摆设静态路由: router(config)# ip route ip-address subnet-mask [ next-hop-address | local-out-port ] [distace ] <--distance范畴:1~255,十分于优先权,越小越好。rip=120;dspf=110;igrp=100;eigrp=90--> router(config)# ^z 摆设缺省路由: router(config)# ip defoult-network ip-address <--动静缺省路由--> router(config)# ip route 0.0.0.0 0.0.0.0 [ next-hop-address | local-out-port ] [distace ] <--静态缺省路由--> router(config)# ^z [page_break]其它吩咐: router# show version router# show running-config router# show startup-config router# show flash router# show interface [ type port ] router# show buffers router# show protocol router# show mem router# show stacks router# show processes router# show cdp entry [ device-name ] <--表露指定街坊三层消息--> router# show cdp neighbors router# show cdp neighbors detail <---表露一切街坊三层消息-> router# show ip router router# show ipx router router# show host router# show ip protocol router# show ip interface type port router# show ipx interface type port router# show ipx servers router# show ipx traffic router# show access-lists [ acl-number ] router# show isdn status router# show dialer <--察看isdn拨号消息--> router# show isdn active router# show frame-relay pvc router# show frame-relay map router# show frame-relay lmi router# erase startup-config router# reload router# setup router# copy running-config startup-config router# copy startup-config running-config router# copy tftp running-config router# copy running-config tftp router# debug ipx routing activity router# debug ipx sap router# debug isdn q921 router# debug isdn q931 router# debug dialer router# debug ip rip router# clear interface bri