【内容摘要】 cisco路由配置语句汇总启动接口,分配ip地址:router>router>enablerouter#router#configureterminalrouter(config)#router(config)#interfacetypeportrouter(config-if)#noshutdownrouter(config-if)#ipaddressip-addresssubnet-maskrouter(config-if)#^z配置rip路由协议:30秒更新一次router(config)#routerriprouter(config-if)#……
----------------------------------------------------------------------------- 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)# isdnth-typeth-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 路由器 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 其它命令: 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 本贴来自天极网群乐社区--http://q.yesky.com/group/review-17615723.html |
|