CCNA命令配置大全.doc

上传人:仙人指路1688 文档编号:2387986 上传时间:2023-02-17 格式:DOC 页数:11 大小:48KB
返回 下载 相关 举报
CCNA命令配置大全.doc_第1页
第1页 / 共11页
CCNA命令配置大全.doc_第2页
第2页 / 共11页
CCNA命令配置大全.doc_第3页
第3页 / 共11页
CCNA命令配置大全.doc_第4页
第4页 / 共11页
CCNA命令配置大全.doc_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《CCNA命令配置大全.doc》由会员分享,可在线阅读,更多相关《CCNA命令配置大全.doc(11页珍藏版)》请在三一办公上搜索。

1、RAM/DRAM保存路由表,各种cache以及运行配置文件;其中共享RAM用于数据包的缓冲;掉电后内容丢失。NVRAM保存配置文件;掉电后内容不丢失。Flash可擦洗、可编程ROM;保存IOS,升级方便;掉电后内容不丢失;多个IOS的拷贝可保存于其中。ROM保存开机自检、引导程序;及一个IOS。可通过换芯片方法升级。Interfaces数据包进出路由器的接口。Interfaces在母板上或在独立的接口模块上。1、 进入SETUP模式Router#setup2、 时间设置router#clock set hh:mm:ss date moth year3、 routershow historyRo

2、uterterminal history size lines4、 router#show version5、 router#show running-config6、 router#show starup-config7、 router(config)#hostname name主机命名8、 router(config)#banner motd # message #开机时的固定显示信息9、 router(config)#enable password password 特权模式明文密码10、 router(config)#no enable password11、 router(confi

3、g)#enable secret password 特权模式加密密码12、 router(config)#no enable secret13、 router(config)#service password-encryption特权模式把明文密码加密密码,但没enable secret安全可以反解14、 router(config)#line console控制台密码15、 router(config-line)#login16、 router(config-line)#password password17、 router(config-line)#exec-timeout mm ss 禁

4、止控制台会话自动退出18、 router(config-line)#logging synchronous重显被打乱的控制台输入router(config)#no ip domain-lookup 禁止域名解析19、 router(config)#line vty 0 4虚拟终端密码20、 router(config-line)#login21、 router(config-line)#password password22、 router(config)#interface type number(slot/port)端口设置23、 router(config-if)#ip address

5、ip summast24、 router(config-if)#clock rate 64000(时钟频率单位为bps,只在DCE端设置)25、 router(config-if)#bandwith 64(带宽设置,单位为KB)26、 router(config-if)#no shutdown(shutdown)27、 router(config-if )#media-type type(10base) 为以太网端口选择适当的介质类型28、 router(config-if )#ctrl+z保存退出到特权模式29、 router#30、 router用户模式enable进入router#特权模

6、式config terminal进入router(config)#全局配置模式31、Interface Router(config-if)#端口设置Subinterface Router(config-subif)# 子端口设置Controller Router(config-controller)# 控制口设置Line Router(config-line)# 虚拟口设置Router Router(config-router)# 路由设置IPX router Router(config-ipx-router)#IPX路由设置32、 router#show interface33、 route

7、r#show interface Ethernet 034、 router#show interface serial 035、 router#show running-config36、 router#show starup-config37、 router#show flash38、 router#show controller39、 router#show controller interface type40、 router#show running-configrouter#copy running-config starup-configrouter#copy running-co

8、nfig tftprouter#copy starup-config tftprouter#copy flash tftprouter#copy tftp star-configrouter#copy tftp flash端口状态Serial1 is up, line protocol is up正常工作Serial1 is up, line protocol is down连接问题Serial1 is down, line protocol is down端口问题Serial1 is administratively down, line protocol is down人为关闭配置寄存器的

9、值1、 关闭路由器的电源重新启动按住ctrl+break键入进2、 3、 o/r 0x2142(跳过nvarm启动恢复密码)4、 I5、 当系统提示是否进入setup模式时,按N6、 router7、 routerenable8、 router#9、进入修改后(包括密码、寄存器的值:0x2100为rom monitor启动、0x2101为setup模式启动、0x2102为10、 router#copy running-config starup-config11、 router#reload12、 也可以在router#setup进入setup模式静态路由协议设置router(config)#

10、ip route network submask(要到达的网络号掩码)ip address(下一跳或出口ip地址)router(config)#ip route 0.0.0.0 s0(出口端口或下一跳IP地址)rip设置router(config)#router riprouter(config-router)#network network-numberrouter#show ip protocol查看RIP信息router#show ip route 查看路由表router#debug ip rip查看RIP更新信息router(config-router)#passive-interfa

11、ce e0(阻止发出作息)router(config-router)#ip rip receive version 1 2接收1、2RIP版本信息igrp设置router(config)#router igrp as numberrouter(config-router)#network network numberrouter#show ip route查看路由表router#debug ip igrp events查看IGRP路由更新大概信息router#debug ip igrp transaction查看IGRP路由更新详细信息Router(config-router)#varianc

12、e multiplier 控制 IGRP load balancingRouter(config-router)#traffic-share balanced | min控制load-balanced traffic 的分布eigrp设置router(config)#router eigrp as numberrouter(config-router)#network network numberrouter(config)#no auto-summry 关闭自动汇总router(config)# auto-summry 打开自动汇总(默认是打开的)router#show ip route e

13、igrp 显示当前的路由表里的EIGRP条目router#show ip protocol 显示活动的路由协议进程的参数和当前的状态router#show ip eigrp neighbors 显示被EIGRP发现的邻居router#show ip eigrp traffic 显示发出和收到的IP EIGRP 包的数量router#show ip eigrp topology 显示IP EIGRP的拓扑表 Router#debug ip eigrpospf设置1. Router(config)#router ospf process-idRouter(config-router)#networ

14、k address(可以是网络号也可以是Ip地址 mask(通配掩码 )area area-idRouter(config-if)# ip ospf priority numbe 配置OSPF的优先级Router#show ip protocols 验证OSPF的配置Router#show ip route 显示路由器学到的所有路由Router#show ip ospf interface type number 显示 area-ID 和邻接信息Router#show ip ospf neighbor 基于每接口显示OSPF邻居信息Router#debug ip ospf eventsRout

15、er#debug ip ospf packet2. Router(config)# interface loopback number(lookback回路配置)Router(config-if)# ip address ip-address subnet-maskRouter(config-if)# ip ospf cost cost-numbe 修改OSPF 的Cost数值Router(config-if)# ip ospf authentication-key key 配置明文口令Router(config-if)# ip ospf messge-digest-key keyid md5

16、 key 配置MD5口令(keyid和key必须配对一致,两邻居才可以通信)Router(config-route)# area area-id authentication message-digestmessage-digest为可选 项,使用后路由器只传送口令消息的摘要(或散列) 配置OSPF区域的验证:3. Router(config-if)# ip ospf hello-interval seconds 配置hello间隔:Router(config-if)# ip ospf dead-interval seconds配置down机判断间隔访问列表1. 标准访问列表(standard

17、 access lists):只使用源IP地址来做过滤决定Router(config)#access-list 10 deny 172.16.40.0 0.0.0.255Router(config)#access-list 10 permit anyRouter(config)#int e1Router(config-if)#ip access-group 10 out使用IP标准ACL来控制VTY线路的访问.Router(config)#access-list 50 permit 172.16.10.3Router(config)#line vty 0 4Router(config-line

18、)#access-class 50 in删除IP标准ACLRouter(config-line)#no ip access-class 50 inRouter(config)#no access-list 502. 扩展访问列表(extended access lists):它比较源IP地址和目标IP地址,层3的协议字段,层4端口号 来做过滤决定Router(config)#access-list 110 deny tcp any host 172.16.30.5 eq 21Router(config)#access-list 110 deny tcp any host 172.16.30.5

19、 eq 23Router(config)#access-list 110 permit ip any anyRouter(config)#int e1Router(config-if)#ip access-group 110 out3. 虚拟通道访问router(config)#access-list 12 permit 192.89.55.0 0.0.0.255router(config)#line vty 0 4outer(config-line)#access-class 12 in3.show ip interface:只显示IP访问列表信息4.show ip interface:显示

20、所有接口的信息和配置的ACL信息5.show ip interface 接口号:显示具体某个接口的信息和配置的ACL信息6.show running-config:显示DRAM信息和ACL信息,以及接口对ACL的应用信息.交换机配置交换机上设置登陆口令Switch(config)# enable password level level passwordSwitch(config)# no enable password level level passwordhostname1900/2900(config)#hostname hostnameIP Address1900(config)#i

21、p address ip address mask1900(config)#ip address 10.5.5.11 255.255.255.02950(config#interface vlan 12950(config-if)#ip address ip_address mask2950(config)#interface vlan 12950(config-if)#ip address 10.5.5.11 255.255.255.0default gateway1900/2950(config)#ip default-gateway ip address1900/2950(config)

22、#ip default-gateway 172.20.137.1查看交换机的IP地址1900#show ipIP address: 10.5.5.11Subnet mask: 255.255.255.0Default gateway: 10.5.5.3Management VLAN: 12950#show interface vlan 1Vlan1 is up, line protocol is upHardware is Cat5k Virtual Ethernet, address is 0010.f6a9.9800 (bia 0010.f6a9.9800)Internet address

23、 is 172.16.80.79/24Broadcast address is 255.255.255.255设置双工选项1900(config)#interface e0/11900(config-if)#duplex auto | full |full-flow-control | half2950(config)#interface fe0/12950(config-if)#duplex auto | full | half设置端口速度:switch(config-if)# speed 10|100|auto查勘双工选项Switch#show interfaces fastetherne

24、t0/3查看MAC地址表1900/2950#show mac-address-table配置永久MAC地址1900(config)#mac-address-table permanent mac-address type module/port1900(config)#mac-address-table permanent 2222.2222.2222 ethernet 0/31900#show mac-address-table2950(config)#mac-address-table static mac_addr vlan vlan_id interface int1 int2 . i

25、nt15配置受限静态MAC地址1900(config)#mac-address-table restricted static mac-address type module/port src-if-list1900(config)#mac-address-table restricted static 1111.1111.1111 e0/4 e0/11900#show mac-address-table2950(config)#mac-address-table secure mac-addr interface vlan vlan-id2950(config)#mac-address-ta

26、ble secure 0003.3333.3333 fa 0/1 vlan 12950#show mac-address-table配置端口安全性1900(config-if)#port secure max-mac-count count1900(config)#interface e0/41900(config-if)#port secure1900(config-if)#port secure max-mac-count 11900(config)#address-violation suspend | disable | ignore1900# show mac-address-tab

27、le security2950(config-if)#port security max-mac-count count2950(config)#interface fa0/12950(config-if)#port security2950(config-if)#port security max-mac-count 102950(config-if)#port security action shutdown | trap2950#show mac-address-table secure2950#show port-security管理配置文件1900#copy nvram tftp:/

28、host/dst_file1900#copy tftp:/host/src_file nvram1950#copy nvram tftp:/10.1.1.1/wgswd.cfg2950#copy startup-config tftp:/host/dst_file清除 NVRAM1900#delete nvram2950#erase startup-configvlan配置1900 VLAN建立1900下,使用vlan vlan# name name vlan#命令, 如下:en#config t(config)#hostname 19001900(config)#vlan 2 name sa

29、les1900(config)#vlan 3 name marketing1900(config)#vlan 4 name mis1900(config)#exit端口分配1900(config)#int e0/21900(config-if)#vlan-membership static 21900(config)#int e0/41900(config-if)#vlan-membership static 31900(config)#int e0/51900(config-if)#vlan-membership static 41900(config-if)#exit1900(config

30、)#exitVLAN验证1900#sh vlan2900 VLAN建立在2950下创建VLAN,在特权模式下使用vlan database命令2950#vlan database2950(vlan)#vlan 2 name Marketing VLAN 2 modified: Name: Marketing2950(vlan)#vlan 3 name Accounting VLAN 3 added: Name: Accounting2950(vlan)#apply APPLY complete2950(vlan)#Ctrl+C2950#端口分配2950下的端口配置,使用switchport a

31、ccess vlan vlan#命令,2950(config-if)#int f0/22950(config-if)#switchport access vlan 22950(config-if)#int f0/32950(config-if)#switchport access vlan 32950(config-if)#int f0/42950(config-if)#switchport access vlan 42950(config-if)#exit2950(config)#exit验证配置信息,如下:2950#sh vlan 或2950#sh vlan brieftrunk配置190

32、0trunk配置1900(config)#int f0/261900(config-if)#trunk on2950下在接口配置模式,使用switchport命令,如下:2950(config)#int f0/122950(config-if)#switchport mode trunk2950(config-if)# switchport trunk encapsulation isl|dot1q2950(config-if)#Z将某VLAN从中继中删除2950(config-if)# switchport trunk allowed vlan remove vlan-list添加某个VLA

33、N到中继线路2950(config-if)# switchport trunk allowed vlan add vlan-listConfiguring Inter-VLAN Routing给连接1900的trunk端口配置,使用encapsulation isl vlan#命令,如下:2600Router(config)#int f0/0.12600Router(config-subif)#encapsulation isl vlan#2600Router(config-subif)#ip add ip add submask给连接2950的这样配置,如下:2600Router(confi

34、g)#int f0/0.12600Router(config-subif)#encapsulation dot1q vlan#2600Router(config-subif)#ip add ip add submaskVTP配置1900(config)#vtp server1900(config)#vtp domain noco1900(config)#vtp password noko在特权模式下使用show vtp命令验证,如下:1900#sh vtp VTP version: 1 Configuration revision: 0 Maximum VLANs supported loca

35、lly: 1005 Number of existing VLANs: 5 VTP domain name: noco VTP password: noko VTP operating mode: Server 2950如下: 2950(config)#vtp mode server 2950(config)#vtp domain noco 验证信息,如下: 2950#sh vtp ? counters VTP statistics status VTP domain status2950#sh vtp statusNAT配置配置静态转换Router(config)#ip nat inside

36、 source static local-ip global-ipRouter(config-if)#ip nat insideRouter(config-if)#ip nat outside配置动态地址转换Router(config)#ip nat pool name start-ip end-ip netmask netmask | prefix-length prefix-lengthRouter(config)#access-list access-list-number permit source source-wildcardRouter(config)#ip nat inside

37、 source list access-list-number pool name配置OverloadingRouter(config)#access-list access-list-number permit source source-wildcardRouter(config)#ip nat inside source list access-list-number interface interface overload清除NAT Translation TableRouter#clear ip nat translation * 清除所有的动态地址转换条目Router#clear

38、ip nat translation inside global-ip local-ip outside local-ip global-ip 清除一个简单的动态地址转换条目( 内、外)Router#clear ip nat translation outside local-ip global-ip清除一个简单的动态地址转换( 外)Router#clear ip nat translation protocol inside global-ip global-port local-ip local-port outside local-ip local-port global-ip global-port 清除一个扩展动态地址 转换条目Show命令输出信息Router#show ip nat translations

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号