CCNP课堂笔记
- 格式:doc
- 大小:61.50 KB
- 文档页数:9
#conf t从终端配置路由器int eo指定E0端口#ip addr ABCD XXXXABCD为以太网地址XXXX为子网掩码#IP addr ABCD XXXX secondary E0口直接支持两个地址类型,如果第一个为A类地址则第二个为B类或C类地址no shutdown 激活E0端口#exit退出配置#conf t#Int S0 指定s0端口#ip addr ABCD XXXXABCD为以太网S0的IP地址,XXXX为子网掩码#encap X.25-ABC分装X.25协议,ABC指定X.25为DTC或DCE操作,缺省为DTE#X.25 map ip ABCD XXXX br映射的X.25的地址,ABCD为对方的路由器的X.25端口地址。
show running config 显示所有的配置show versin显示版本号和寄存器值show history查看历史记录no ip address 删除已经配置的ip地址no IP address 删除已经配置的ip地址show history 查看历史记录show ip 查看ippassword+密码配置telnet密码enable password+密码配置明文密码2900交换机配置vlan databasevalan 1 test1valan 2 test2show vlan 查看vlanset vtp v2 enable 开启VTPshow vtp statistics 显示串发出或收到的VTP通知信息的摘要内容干线:干线指交换机和另一个允许多个虚拟网的信息流从中穿过设备之间的链接access link接入链接static vlan静态虚拟网end to end vlan端到端的虚拟网配置多层交换机vlan之间的路由:switch(config)#ip routing //激活多层交换机的路由功能switch(config)#router ip_routing_protocol//配置路由协议switch(config)#interface vlan-id //创建虚拟端口trunk link干线链接frame tagging帧标记vtp pruning vtp取消local vlan 本地虚拟网set spantree portpri设置端口优先级show spantree 验证端口优先级set spantree portvlanpri 改变某个虚拟网或虚拟网组的优先级\set spantree maxage 设置BUDU的最大生命周期进入配置模式:interface选择封装类型:switchport trunk encapsucation{is|dotlq|negotiate}配置trunk上许可的vlan:swithprot trunk allowed vlan{add|except|all|remove}在vlan database下配置vlan:vlan databasevlan 1exitVTP配置:进入全局配置模式confinguer termial将VTP配置为服务器模式 VTP server配置域名 VTP domain启动VTP版本2 VTP version 2指定VTP密码 VTP password在管理域中启动VTP修剪技术 VTP pruning使用show vtp status来查看vtp的配置及当前的状态把交换机上的catos复制到tptp服务器:capy tptp flashbootflash源文件cat4000.6-1-1.bin目的主机的IP地址将ram文件拷贝到nvram中:copy runing startup将nvrum中的文件拷贝到ram中:copy startup runing将tftp服务器中的文件拷贝到nvram中:copy tftp start将nvram中的文件拷贝到tftp服务器中:copy start tftp将内存ram中的文件拷贝到tftp服务器中:copy run tftp将tftp中的文件拷贝到内存ram中:copy tftp run删除nvram中的文件:erase startdebug命令打上时间标记:service timestamaps debug datatime msec为日志消息打上时间标记:service timestamaps log datatime msecshow vtp counters查看VTP的统计数据show interface验证私用vlan:show interface switchportshow vlan private-vlan激活生成树协议:spanning-tree vlan降低将交换机的优先级:spanning-tree vlan 200 priority 4097将当前交换机的vlan 200优先级降低为4097配置接口的开销:spanning-tree cast 18 把当前交换机的开销设置为18spanning-tree vlan 200 cast 17 把当前交换机的vlan 200开销降低为17将端口的开销降低这个端口的有可能成为根端口show spanning-tree vlan 200检验此生成树的vlan200的端口是否打开生成树是否激活show spanning-tree vlan vlan-id检验生成树是否激活查看一个交换机上的所有生成树的信息:show spanning-tree bridge配置生成树快速端口:spannning-tree portfastshow running-config interfacespanning-tree uplinkfastshow spanning-tree uplinkfast 检验交换机上的uplinkfast是否激活spanning-tree backbonefast 快速骨干show spanning-tree backbonefast 查看快速骨干是否激活spanning-tree mode mstspanning-tree mst configuretionnamerevision rev-num 配置多生成树的版本号intstance inst vlan range 把valn映射到生成树里面激活多生成树show spanning-tree mst configuretion 查看多生成树的配置show spanning-tree mst x 查看某一具体的生成树配置etherchannelinterface interface slot/portchannel-group number mode{auto/disirable/on}//二层interface port-channel port-channer numberip adress adress mst//三层show ranning-config port-channel num//查看二层etherchannel的配置show ranning-config interface intface x/yshow etherchannel number port-channel 查看某一个通道的状况switch (config-if)#channel-portocol{lacp/pagp}默认是pagp pagp是思科私有的lacp port-priority priority_value 配置lacp端口的优先级switch#lacp system-port-priority priority_value 配置交换机的优先级switch (config)#port channel load balance type 配置以太通道的负载平衡的方式show spanning-tree summary totals 检测交换机上buduguard的交换信息bpdu过滤:spanning-tree portfast bpdufilter defaultspaning-tree guard root 根的保护show spanning-tree inconsistentports 查看处于阻塞状态的端口switch (config)#udld enable 激活单向链路检测switch (config-f)#udld enable 激活某一个以太网某个端口的链路检测no udld enable //关闭非光口链路检测udld disable //关闭光口链路检测switch#udld reset 复位链路接口激活某一个端口环路保护功能:spantree guard loopswitch#show udld interfaceswitch#debug spanning-tree all 检查交换机所有的生成树debug spanning-tree event 检查交换机的所有生成树事件debug spanning-tree backbonefast 检查交换机的快速骨干的情况debug spanning-tree uplinkfast 显示生成树的快速上行链路事件路由器配置IPsec-vpn:router(config)#crypto isakmp policy priority 创建策略并指定策略的优先级router(config-isakmp)# encreption{des/3des} 指定对称加密算法router(config-isakmp)#has{sha/md5} 指定消息摘要算法router(config-isakmp)#authertication{rsa-sig/rsa-encr/pre-share} 指定身份认证方法router(config-isakmp)#group{1/2}指定dh分组编号router(config-isakmp)#lifetime seconds 指定sa生存期设置标识对方用的方法:router(config)#crypto isakmp identity{address/hastname} 建立主机名和ip地址之间的关系:router(config)#ip host hostname address1确定身份认证的密码: router(config)#crypto isakmp key keystring address peer-address显示IKE策略:router#show crypto isakmp policy定义交换集:router(config)#crypto ipsec transfrom-set transform-set-name transform1[transform2/transform3]定义ipsec的工作模式:router(cfg-crypto-tran)mode{tunnel/transport}看交换机上邻居表的信息:switch#show adjacency查看ip路由表:switch#show IP route查看多层交换机上的路由协议:switch#show ip protocolsRPR:路由处理器冗余.主控引擎坏了启动备份引擎RPR+的配置:switch(config)#redundency//进入到冗余配置switch(config-red)#mode rpr plusswitch#show redundency states//显示当前的冗余电源的冗余:power redundency_mode combined/redandunt //combined两个电源合作工作,redandunt两个电源冗余工作switch#show power//查看当前电源的供给no power enable module_id//关闭电源上的某一个模块power cycle module_id//开启电源上的某一个模块switch#show ip arp //查看虚拟路由器的IP地址和mac地址HSRP的配置:switch(config-if)#standby id ip //id是备份组的组号,ip是虚拟路由器的ip且虚拟路由器的ip必须和实际路由器的ip在同一个子网网段内配置HSRP的抢先功能:switch(config-if)#standby id preempt //id是备份组的组号配置计时器:switch(config-if)#standby timers 5 15 //5表示hellotime的时间,15表示hodetime的时间,hellotime的时间至少是hodetime时间的三倍接口的监测:switch(config-if)#standby group_number track type number interface_priority 优先级查看当前备份的状态:switch#show standby brief显示HSRP状态改变的消息:switch#debug standbySRM单路由器模式:switch(config)#redundancyswitch(config-r)#high availabilityswitch(config-r-ha)#single-router-mode检查单路由器模式是否配置好 switch#show startup-config检查当前冗余配置状态是否激活:switch#show redundancySLB服务器负载平衡功能的配置:switch(config)#ip slb serverfarm serverfarm-name//定义服务器群名switch(config-slb-sfarm)#real ip-address//设置ip地址switch(config-slb-real)#inservice//激活真实的服务器定义虚拟的服务器:switch(config)#ip slb serverfarm viltual-server-nameswitch(config-slb-vserver)#virtual address maskswitch(config-slb-vserver)#serverfarm farm_nameswitch(config-slb-vserver)#inservice//激活switch(config-slb-vserver)#client//限制只有那些客户机能访问这个服务器启动ip组播路由:switch(config)#ip multicast-routingswitch(config)#ip pim[sparse-mode|dense-mode|sparse-dense-mode]启动稀疏或密集模式的组播路由协议auto RP自动RPswitch(config)#ip pim send-rp-announce type number scope ttl group-list access-list-numberswitch(config)#ip pim send-rp-discovery scope ttl配置自举路由器:switch(config)#ip pim brs-candidate interface hash-maks-length 配置rp的候选路由器:switch(config)#ip pim version[1|2]//选择pim的版本switch(config)#ip pim rp-candidate type number ttl group-list access-list-number查看路由器的单播路由表:switch#show ip mroute查看路由器上哪些接口启动pim路由协议:switch#show ip pim interface查看路由器的pim邻居:switch#show ip pim neighbor查看路由器上的rp:switch#show ip pim rp查看自举路由器:switch#show ip pim bsr激活rip协议:router(config)#router riprouter(config-router)#network network-number//选择要激活的接口的网段router#show ip protocols//查看ripQOS定义一个类switch(config)#class-map name定义策略图switch(config)#policy-map policy-name在接口上应用一个策略图:switch(config-if)#service polity{input|output} polity-name 启动QOS:switch(config)#mls qos配置接口上的信任状态:switch(config-if)#mls qos trust{cos|dscp|ip-precedence}查看当前交换机上的类图:switch#show class-map查看交换机上的策略图:switch#show polity-map polity-name查看接口上的策略图的应用:switch#show polity-map interface 接口名 input|output class class-name打precedence标记:switch(config)#polity map polity-nameswitch(config-pmap)#class class-nameswitch(config-pmap-c)#set ip precedence 0-5打DSCP标记:switch(config)#polity mappolity-nameswitch(config-pmap)#class class-nameswitch(config-pmap-c)#set ipdscp 0-5|ef //ef指加速转发class map voicematch ipdscp ef//所有属于ipdscp ef的包属于voice类nbuy基于网络的应用识别switch#show class-mapswitch(config-cmap)#match protocol protocol-name配置拥塞控制的QOSswitch(config-if)#ip rtp priority start-port/udp端口号 port range/端口范围 bw/带宽最大的预定带宽:switch(config-if)#max-reserved-bandwidth present不超过总带宽的百分之七十五查看接口队列配置:show queue interface-type interface-numberLLQ低延迟队列:switch(config)#policy-map policy-nameswitch(config-pmap)#class class-nameswitch(config-pmap-c)#priority bandwidth检查队列配置:switch#show queue interface-type interface-number查看策略图的配置:switch#show polity interface interface-number查看某一个策略图的配置:switch#show polity-map polity-map-nameWRR加权的轮行:switch(config-if)#wrr-queue cos-map//分配服务类型cos的值switch(config-if)#wrr-queue bandwith weight1 weight2 分配权值switch(config-if)#wrr-queue random-detecte max-threshold queueIDthreshold1 threshold2 定义丢失门槛wred加权的拥塞避免switch(config-if)#random-detect dscp-based 用dscp的值计算数据包丢弃的可能性switch(config-if)#randam-detect dscp dscpvalue min-threshold max-threshold[mark-probality denominator]设置最小丢弃门槛最大丢弃门槛以及丢弃的可能性查看接口上的配置队列: switch#show queueing interface interface-spec诊断RSVP:debug ip rsvp显示优先级队列的输出:debug porioritySPAn:switch(config)#monitor sessionRSPAN:switch(config)#vlan vlan-name:switch(config-vlan)#remote spanswitch#show monitor session session-number[detail]网络分析模块上启动某一个收集类型:root@localhost#autostart collection enableswitch#show moduleswitch#show interface gigabitEthernet slot/[1|2]AAA(认证授权记账)的配置:switch(config)#aaa new-modelswitch(config)#aaa authertication login{default|list-name}methold1[methold2]}switch(config)#line[aux|console|tty|vty] line-number[ending-line-number]//应用某一个接口switch(config)#login authertication[default|list-name]//应用定义的名字aaa授权:switch(config)#aaa autherorizetion [auth-proxy|network|exec|commands level|reverse-access|configuration|immobile}{default|list-name[methode1[methode2 ...]]}switch(config)#ppp autherorizition{default|list-name}switch(config)#interface interface-type interfacenumberaaa记账:switch(config)#aaa accounting {systerm|network|exec|connection|commands level{default|list-name}}start-stop|stop only|none}[methode1[methode2...]switch(config)#ppp accounting{default|list-name}switch(config)#interface interface-type interfacenumber端口的安全配置:switch(config-if)#switchport port-[maximum value] violation[protect|restrict|shoudown]802.1X认证的配置:switch(config)#aaa authertication dot1x {defauter}method1[method2...]switch(config)#dot1x syeterm-auth-control//启动802.1x的认证switch(config-if)#dot1x port-control auto//端口上启动802.1x的认证switch#show port-security//检验端口的安全性switch#show port-security interface interface x/y//检查具体某一个端口的安全性switch#show port-security address//查看交换机所有的mac地址表中的安全的mac地址vlan的ACL配置:switch(config)#vlan access-map map-name[seq#]创建vlan的访问图switch(config-access-map)#match{ip address{1-199|1300-2699|acl-name}ipx address{800-999|acl-name} mac address acl-name}//定义匹配条件switch(config-access-map)#action {drop [log]}|{forward [capture]}|redirect{type slot/port|port-channel channel-id }//定义匹配的动作switch(config)#vlan filter map-name vlan-list list//把前面定义过的访问图应用到vlanPvlan私有vlan的配置:switch#vtp mode transpoarent//vtp为透明模式switch(config-vlan)#private-vlan {primary|isolated|community} //主vlan,隔离vlan,团体vlanswitch(config-vlan)#privaty-vlan association{secondary-vlan-list |add svl|remove svl}//把主vlan跟从vlan关联起来switch#show vlan ptivate-vlan type//显示私有vlan的配置信息pvlan端口的配置:switch(config-if)#switchport mode private-vlan{host|promiscuous}//主vlan模式,混杂模式端口switch(config-if)#switchport private-vlan host-association primary-vlan-ID secendary-vlan-id}//host模式下把这个端口划分到主vlan中去switch(config-if)#private-vlan mapping primary-vlan-IDsencendary-vlan-list|add svl|remove svl}混杂模式下把这个端口划分到主vlan中去switch#show interface private-vlan mapping //显示私有vlan的信息配置ripv2:router(config)#router riprouter(config-router)#version 2router(config-router)#network network-numberEIGRP(增强的内部网管路由协议)中Metric值的计算方法:Metric=[k1*带宽+((k2*带宽)/(256-负载))+k3*延时]默认缺省k1=1,k2=0,k3=1,k4=0,k5=0;注意:带宽取整个网络中带宽最小的链路的带宽bw(带宽)=(10 000 000/以K为单位的带宽)*256Metric=[k1*带宽+((k2*带宽)/(256-负载))+k3*延时]*[k5/(延时+k4)]默认缺省k1=1,k2=0,k3=1,k4=0,k5=1;延时=传输的延时(以微秒为单位)/10*256EIGRP的Metric=igrp的Metric*256关闭自动汇总:(config router)#no auto-summaryEIGRP汇总:(config-if)#ip summary-address eigip [as-number](自制系统号)[address][mask]EIGRP控制查询:router(config-router)#eigrp stub[receive only|connected|static|summary]//receive only只接收eigrp邻居的信息,connected 把直连的网络信息传递给eigrp邻居, static把自己的静态路由传递给他的eigrp邻居路由器,summary是自制系统号在ospf网络上配置缺省路由:router(config-router)#default-information originate[always]//always表示网络中不管有没有缺省路由都会添加一条缺省路由。