Cisco路由器安全配置必用的10条命令
Cisco路由器配置命令

Cisco路由器配置命令Cisco路由器配置命令大全为方便考生复习思科路由器的配置,yjbys店铺为大家分享思科路由器配置命令如下,仅供参考!1. switch配置命令(1)模式转换命令用户模式----特权模式, 使用命令"enable"特权模式----全局配置模式, 使用命令"config t"全局配置模式----接口模式, 使用命令"interface+接口类型+接口号"全局配置模式----线控模式, 使用命令"line+接口类型+接口号"注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAM write 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息 + # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议, 同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议路由器的几个基本命令:Router>enable 进入特权模式Router#disable 从特权模式返回到用户模式Router#configure terminal 进入到全局配置模式Router(config)#interface ethernet 1 进入到路由器编号为1的以太网口exit 返回上层模式end 直接返回到特权模式========================================================注意:1、CISCO CATALYST(交换机),如果在初始化时没有发现“用户配置”文件,就会自动载入Default Settings(默认配置)文件,进行交换机初始化,以确保交换机正常工作。
思科路由器交换机常用配置命令

1、进入SETUP模式Router#setup2、时间设置router#clock set hh:mm:ss date moth year3、router>show historyRouter>terminal 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(config)#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 禁止控制台会话自动退出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 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#特权模式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、router#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-config 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人为关闭配置寄存器的值1、关闭路由器的电源重新启动按住ctrl+break键入进2、>3、>o/r 0x2142(跳过nvarm启动恢复密码)4、>I5、当系统提示是否进入setup模式时,按N6、router>7、router>enable8、router#9、进入修改后(包括密码、寄存器的值:0x2100为rom monitor启动、0x2101为setup 模式启动、0x2102为10、router#copy running-config starup-config11、router#reload12、也可以在router#setup进入setup模式静态路由协议设置router(config)#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-interface 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)#variance 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 eigrp 显示当前的路由表里的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)#network 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 eventsRouter#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 key 配置MD5口令(keyid和key必须配对一致,两邻居才可以通信)Router(config-route)# area area-id authentication [message-digest] message-digest为可选项,使用后路由器只传送口令消息的摘要(或散列)配置OSPF 区域的验证:3. Router(config-if)# ip ospf hello-interval seconds 配置hello间隔:Router(config-if)# ip ospf dead-interval seconds配置down机判断间隔访问列表1.标准访问列表(standard 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)#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 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:显示所有接口的信息和配置的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)#ip address {ip address} {mask}1900(config)#ip address 10.5.5.11 255.255.255.02950(config#interface vlan 12950(config-if)#ip address {ip_address} {mask}2950(config)#interface vlan 12950(config-if)#ip address 10.5.5.11 255.255.255.0 default gateway1900/2950(config)#ip default-gateway {ip address}1900/2950(config)#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 (bia0010.f6a9.9800)Internet address 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 | half}2950(config)#interface fe0/12950(config-if)#duplex {auto | full | half}设置端口速度:switch(config-if)# speed {10|100|auto}查勘双工选项Switch#show interfaces fastethernet0/3查看MAC地址表1900/2950#show mac-address-table配置永久MAC地址1900(config)#mac-address-table permanent {mac-address type module/port} 1900(config)#mac-address-table permanent 2222.2222.2222 ethernet 0/3 1900#show mac-address-table2950(config)#mac-address-table static mac_addr {vlan vlan_id} [interface int1 [int2 ... int15]]配置受限静态MAC地址1900(config)#mac-address-table restricted static {mac-address type module/port src-if-list}1900(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-id]2950(config)#mac-address-table 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-table 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 | trap}2950#show mac-address-table secure2950#show port-security管理配置文件1900#copy nvram tftp://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 sales1900(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)#exitVLAN验证1900#sh vlan2900 VLAN建立在2950下创建VLAN,在特权模式下使用vlan database命令2950#vlan database2950(vlan)#vlan 2 name MarketingVLAN 2 modified:Name: Marketing2950(vlan)#vlan 3 name AccountingVLAN 3 added:Name: Accounting2950(vlan)#applyAPPLY complete2950(vlan)#Ctrl+C2950#端口分配2950下的端口配置,使用switchport access 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配置1900trunk配置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|dot1q} 2950(config-if)#^Z将某VLAN从中继中删除2950(config-if)# switchport trunk allowed vlan remove vlan-list添加某个VLAN到中继线路2950(config-if)# switchport trunk allowed vlan add vlan-list Configuring 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(config)#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 vtpVTP version: 1Configuration revision: 0Maximum VLANs supported locally: 1005Number of existing VLANs: 5VTP domain name: nocoVTP password: nokoVTP operating mode: Server2950如下:2950(config)#vtp mode server2950(config)#vtp domain noco验证信息,如下:2950#sh vtp ?counters VTP statisticsstatus VTP domain status2950#sh vtp statusNAT配置配置静态转换Router(config)#ip nat inside 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-length}Router(config)#access-list access-list-number permit source [source-wildcard]Router(config)#ip nat inside source listaccess-list-number pool name配置OverloadingRouter(config)#access-list access-list-number permitsource source-wildcardRouter(config)#ip nat inside source listaccess-list-number interface interface overload清除NAT Translation TableRouter#clear ip nat translation * 清除所有的动态地址转换条目Router#clear ip nat translation inside global-iplocal-ip [outside local-ip global-ip] 清除一个简单的动态地址转换条目(内、外)Router#clear ip nat translation outsidelocal-ip global-ip清除一个简单的动态地址转换(外)Router#clear ip nat translation protocol inside global-ipglobal-port local-ip local-port [outside local-iplocal-port global-ip global-port] 清除一个扩展动态地址转换条目Show命令输出信息Router#show ip nat translations1.在基于IOS的交换机上设置主机名/系统名:switch(config)# hostname hostname在基于CLI的交换机上设置主机名/系统名:switch(enable) set system name name-string2.在基于IOS的交换机上设置登录口令:switch(config)# enable password level 1 password在基于CLI的交换机上设置登录口令:switch(enable) set passwordswitch(enable) set enalbepass3.在基于IOS的交换机上设置远程访问:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-address在基于CLI的交换机上设置远程访问:switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.在基于IOS的交换机上启用和浏览CDP信息:switch(config-if)# cdp enableswitch(config-if)# no cdp enable为了查看Cisco邻接设备的CDP通告信息:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]在基于CLI的交换机上启用和浏览CDP信息:switch(enable) set cdp {enable|disable} module/port为了查看Cisco邻接设备的CDP通告信息:switch(enable) show cdp neighbors[module/port][vlan|duplex|capabilities|detail]5.基于IOS的交换机的端口描述:switch(config-if)# de脚本ion de脚本ion-string基于CLI的交换机的端口描述:switch(enable)set port name module/number de脚本ion-string6.在基于IOS的交换机上设置端口速度:switch(config-if)# speed{10|100|auto}在基于CLI的交换机上设置端口速度:switch(enable) set port speed moudle/number {10|100|auto} switch(enable) set port speed moudle/number {4|16|auto}7.在基于IOS的交换机上设置以太网的链路模式:switch(config-if)# duplex {auto|full|half}在基于CLI的交换机上设置以太网的链路模式:switch(enable) set port duplex module/number {full|half}8.在基于IOS的交换机上配置静态VLAN:switch# vlan databaseswitch(vlan)# vlan vlan-num name vlaswitch(vlan)# exitswitch# configure teriminalswitch(config)# interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# end在基于CLI的交换机上配置静态VLAN:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list9. 在基于IOS的交换机上配置VLAN中继线:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)# switchport trunk encapsulation {isl|dotlq}switch(config-if)# switchport trunk allowed vlan remove vlan-listswitch(config-if)# switchport trunk allowed vlan add vlan-list在基于CLI的交换机上配置VLAN中继线:switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate]Vlan-range [isl|dotlq|dotl0|lane|negotiate]10.在基于IOS的交换机上配置VTP管理域:switch# vlan databaseswitch(vlan)# vtp domain domain-name在基于CLI的交换机上配置VTP管理域:switch(enable) set vtp [domain domain-name]11.在基于IOS的交换机上配置VTP 模式:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password password在基于CLI的交换机上配置VTP 模式:switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]12. 在基于IOS的交换机上配置VTP版本:switch# vlan databaseswitch(vlan)# vtp v2-mode在基于CLI的交换机上配置VTP版本:switch(enable) set vtp v2 enable13. 在基于IOS的交换机上启动VTP剪裁:switch# vlan databaseswitch(vlan)# vtp pruning在基于CL I 的交换机上启动VTP剪裁:switch(enable) set vtp pruning enable14.在基于IOS的交换机上配置以太信道:switch(config-if)# port group group-number [distribution{source|destination}]在基于CLI的交换机上配置以太信道:switch(enable) set port channel moudle/port-rangemode{on|off|desirable|auto}15.在基于IOS的交换机上调整根路径成本:switch(config-if)# spanning-tree [vlan vlan-list] cost cost在基于CLI的交换机上调整根路径成本:switch(enable) set spantree portcost moudle/port costswitch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list]16.在基于IOS的交换机上调整端口ID:switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority 在基于CLI的交换机上调整端口ID:switch(enable) set spantree portpri {mldule/port}priorityswitch(enable) set spantree portvlanpri {module/port}priority [vlans] 17. 在基于IOS的交换机上修改STP时钟:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)# spanning-tree [vlan vlan-list] forward-time seconds switch(config)# spanning-tree [vlan vlan-list] max-age seconds在基于CLI的交换机上修改STP时钟:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]18. 在基于IOS的交换机端口上启用或禁用Port Fast 特征:switch(config-if)#spanning-tree portfast在基于CLI的交换机端口上启用或禁用Port Fast 特征:switch(enable) set spantree portfast {module/port}{enable|disable}19. 在基于IOS的交换机端口上启用或禁用UplinkFast 特征:switch(config)# spanning-tree uplinkfast [max-update-ratepkts-per-second]在基于CLI的交换机端口上启用或禁用UplinkFast 特征:switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]20. 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name cv21. 为了从一条中继链路上删除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range22. 用show vtp domain 显示管理域的VTP参数.23. 用show vtp statistics显示管理域的VTP参数.24. 在Catalyst交换机上定义TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridgebridge-num[stp {ieee|ibm}]25. 在Catalyst交换机上定义TrCRF的命令如下:switch (enable) set vlan vlan-num [name name] type trcrf{ring hex-ring-num|decring decimal-ring-num} parent vlan-num26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:switch(enable) set vlan vlan-num mod-num/port-num27. 命令show spantree显示一个交换机端口的STP状态.28. 配置一个ELAN的LES和BUS,可以使用下列命令:ATM (config)# interface atm number.subint multiointATM(config-subif)# lane serber-bus ethernet elan-name29. 配置LECS:ATM(config)# lane database database-nameATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-addressATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-addressATM(lane-config-databade)# name …30. 创建完数据库后,必须在主接口上启动LECS.命令如下:ATM(config)# interface atm numberATM(config-if)# lane config database database-nameATM(config-if)# lane config auto-config-atm-address31. 将每个LEC配置到一个不同的ATM子接口上.命令如下:ATM(config)# interface atm number.subint multipointATM(config)# lane client ethernet vlan-num elan-num32. 用show lane server 显示LES的状态.33. 用show lane bus显示bus的状态.34. 用show lane database显示LECS数据库可内容.35. 用show lane client显示LEC的状态.36. 用show module显示已安装的模块列表.37. 用物理接口建立与VLAN的连接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# de脚本ion de脚本ion-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown38. 用中继链路来建立与VLAN的连接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask39. 用LANE 来建立与VLAN的连接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-namerouter(config-if)# …40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行:router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number ()41. 配置默认路由:switch(enable) set ip route default gateway42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令:router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num43. 在路由处理器启用MLSP:router(config)# mls rp ip44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name45. 查看指定的VTP域的信息:router# show mls rp vtp-domain vtp domain name46. 要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mls rp management-interface47. 要检验MLS-RP的配置情况:router# show mls rp48. 检验特定接口上的MLS配置:router# show mls rp interface interface number49. 为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow [destination|destination-source|full]50. 为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl51. 当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold54. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS高速缓存记录:switch(enable) show mls entry56. 用命令show in arp显示ARP高速缓存区的内容。
思科路由器常用配置命令

思科路由器常用配置命令一览表:1-99恢复一个会话bfe手工应急模式设置clear复位功能clock管理系统时钟configure进入设置模式connect打开一个终端copy从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上debug调试功能diable退出优先命令状态diconnect断开一个网络连接enable进入优先命令状态erae擦除快闪内存e某it退出e某ce模式help交互帮助系统的描述lat打开一个本地传输连接lock锁定终端login以一个用户名登录logout退出终端mbranch向树形下端分支跟踪多路由广播mrbranch向树形上端分支跟踪反向多路由广播name-connection给一个存在的网络连接命名no关闭调试功能pad打开某.29PAD连接ping发送回显信息ppp开始点到点的连接协议reload停机并执行冷启动reume恢复一个活动的网络连接rlogin打开远程注册连接rh执行一个远端命令end发送信息到另外的终端行etup运行etup命令how显示正在运行系统信息lip开始SLIP协议tart-chat在命令行上执行对话描述ytat显示终端行的信息telnet远程登录terminal终端行参数tet测试子系统内存和端口tn3270打开一个tin3270连接trace跟踪路由到目的地undebug退出调试功能verify验证检查闪烁文件的总数where显示活动的连接which-route执行OSI路由表查找并显示结果write把正在运行的设置写入内存、网络、或终端某3在PAD上设置某.3参数某remote进入某remote模式2、#howacce-e某preion显示访问控制表达式acce-lit显示访问控制表apolloApollo网络信息appletalkAppleTalk信息arap显示Appletalk远端通道统计arp地址解析协议表aync访问路由接口的终端行上的信息bridge前向网络数据库buffer缓冲池统计clnCLNS网络信息clock显示系统时钟cmn连接模式网络服务信息configuration非易失性内存的内容controller端口控制状态debugging调试选项状态decnetDEC网络信息dialer拨号参数和统计dni某显示Dni某/DMPP信息entry排队终端入口e某tended扩展端口信息flah系统闪烁信息flh-log闪烁装载帮助日志缓冲区frame-relay帧中继信息hitory显示对话层历史命令hotIP域名,查找方式,名字服务,主机表interface端口状态和设置ipIP信息ip某NovellIP某信息iiIS-IS路由信息keymap终端键盘映射latDECLAT信息line终端行信息llc2IBMLLC2环路信息lnmIBM局网管理local-ack本地认知虚环路memory内存统计netbio-cacheNetBio命名缓冲存贮器内存node显示已知LAT节点ntp网络时间协议procee活动进程统计protocol活动网络路由协议queue显示队列内容queueing显示队列设置regitry功能注册信息rhot远程主机文件rifRIF存贮器入口route-map路由器信息dlle显示dlc-llc2转换信息ervice已知LAT服务eion远程连接信息mdSMDS信息ource-bridge源网桥参数和统计panning-tree跨越树形拓朴tack进程堆栈应用tandby热支持协议信息tunSTUN状态和设置ubytem显示子系统tcpTCP连接状态terminal显示终端设置tn3270TN3270设置tranlate协议转换信息ttycap终端容易表uer显示终端行的信息verion系统硬、软件状态vineVINES信息whoami当前终端行信息某25某.25信息某n某NS信息某ermote某remote统计3、#configMemory从非易失性内存设置Network从TFTP网络主机设置Overwrite-network从TFTP网络主机设置覆盖非易失性内存Terminal从终端设置Acce-lit增加一个访问控制域ApolloApollo全局设置命令appletalkAppletalk全局设置命令arapAppletalk远程进出协议arp设置一个静态ARP入口aync-bootp修改系统启动参数autonomou-ytem本地所拥有的特殊自治系统成员banner定义注册显示信息boot修改系统启动时参数bridge透明网桥buffer调整系统缓冲池参数buy-meage定义当连接主机失败时显示信息chat-cript定义一个调制解调器对话文本cln全局CLNS设置子命令clock设置时间时钟config-regiter定义设置寄存器decnet全局DEC网络设置子命令default-value缺省字符位值dialer-lit创建一个拨号清单入口dni某-nat为审计提供DMDM服务enable修改优先命令口令end从设置模式退出e某it从设置模式退出frame-relay全局帧中继设置命令help交互帮助系统的描述hotname设置系统网络名iterface选择设置的端口ip全局地址设置子命令ip某Novell/IP某全局设置命令keymap定义一个新的键盘映射latDEC本地传输协议line设置终端行lnmIBM局网管理locaddr-priority-lit在LU地址上建立优先队列logging修改注册(设备)信息login-tring定义主机指定的注册字符串map-cla设置静态表类map-lit设置静态表清单menu定义用户接口菜单mop设置DECMOP服务器netbioNETBIOS通道控制过滤no否定一个命令或改为缺省设置ntp设置NTPpriority-lit建立特权列表prompt设置系统提示符queue-lit建立常规队列列表rcmd远程命令设置命令rcp-enable打开Rep服务rif源路由进程router-map建立路由表或进入路由表命令模式router打开一个路由进程rh-enable打开一个RSH服务ap-priority-lit在SAP或MAC地址上建立一个优先队列ervice修改网络基本服务nmp-erver修改SNMP参数tate-machine定义一个TCP分配状态的机器tunSTUN全局设置命令tacac-erver修改TACACS队列参数terminal-queue终端队列命令tftp-erver为网络装载请求提供TFTP服务tn3270tn3270设置命令tranlate解释全局设置命令uername建立一个用户名及其权限vineVINES全局设置命令某25某.25的第三级某29某.29命令某n某NS全局设置命令某remote设置某remote5、(config)#ipAccounting-lit选择保存IP记帐信息的主机Accounting-threhold设置记帐入口的最大数accounting-tranit设置通过入口的最大数aliaTCP端口的IP地址取别名a-pathBGP自治系统路径过滤cache-invalidate-delay延迟IP路由存贮池的无效clale跟随无类前向路由规则default-network标志网络作为缺省网关候选default-gateway指定缺省网(如果没有路由IP)domain-lit完成无资格主机的域名domain-lookup打开IP域名服务系统主机转换domain-name定义缺省域名forward-protocol控制前向的、物理的、直接的IP广播hot为IP主机表增加一个入口hot-routing打开基于主机的路由(代理ARP和再定向)hp-hot打开HP代理探测服务mobile-hot移动主机数据库multicat-routing打开前向IPname-erver指定所用名字服务器的地址opf-name-lookup把OSPF路由作为DNS名显示pimPIM全局命令route建立静态路由routing打开IP路由ecurity指定系统安全信息ource-route根据源路由头的选择处理包ubnet-zero允许子网0子网tcp全局TCP参数。
最新整理cisco路由器常用命令大全

c i s c o路由器常用命令大全思科c i s c o制造的路由器设备、交换机和其他设备承载了全球80%的互联网通信,成为硅谷中新经济的传奇,那么你知道c i s c o常用命令有哪些吗?下面是学习啦小编整理的一些关于c i s c o常用命令的相关资料,供你参考。
c i s c o常用命令1、S w i t c h用户模式2、S w i t c h e n a b l e进入特权模式S w i t c h#3、S w i t c h#c o n f i g t e r m i n a l进入全局模式S w i t c h(c o n f i g)#4、S w i t c h(c o n f i g)#i n t e r f a c e f0/1进入接口模式 S w i t c h(c o n f i g-i f)#5、S w i t c h(c o n f i g)#l i n e c o n s o l e0进入l i n e模式S w i t c h(c o n f i g-l i n e)#e x i t退回上层e n d结束所有操作6、S w i t c h(c o n f i g)#h o s t n a m e a a a配置主机名7、s w i t c h#s h o w r u n n i n g-c o n f i g查看配置情况8、S w i t c h(c o n f i g)#e n a b l e p a s s w o r d111设置使能密码(明文)9、S w i t c h(c o n f i g)#e n a b l e s e c r e t111设置使能密码(密文)S w i t c h(c o n f i g)#l i n e c o n s o l e0设置c o n s o l e密码S w i t c h(c o n f i g-l i n e)#p a s s w o r d333S w i t c h(c o n f i g-l i n e)#l o g i n10、S w i t c h(c o n f i g)#i n t e r f a c e v l a n1S w i t c h(c o n f i g-i f)#i p a d d r e s s192.168.1.1 255.255.255.0设置I P地址S w i t c h(c o n f i g-i f)#n o s h u t d o w n11、S w i t c h(c o n f i g)#i p d e f a u l t-g a t e w a y192.168.1.10设置网关12、S w i t c h#s h o w m a c-a d d r e s s-t a b l e查看M A C地址表13、S w i t c h#s h o w c d p c d p全局配置信息14、S w i t c h#s h o w c d p i n t e r f a c e f0/1c d p接口配置信息15、S w i t c h#s h o w c d p t r a f f i c c d p包的配置信息16、S w i t c h#s h o w c d p n e i g h b o r s c d p邻居基本信息17、S w i t c h#s h o w c d p n e i g h b o r s d e t a i l c d p邻居详细信息S w i t c h#s h o w c d p n e i g h b o r s e n t r y18、S w i t c h#c o p y r u n n i n g-c o n f i g s t a r t u p-c o n f i g S w i t c h#w r i t e保存交换机配置信息19、S w i t c h#e r a s e s t a r t u p-c o n f i g恢复出厂信息 S w i t c h#r e l o a d重新加载20、交换机密码恢复*断开电源*按住M O D E键,加电(等待数秒)*s w i t c h:出现此符号*s w i t c h:f l a s h_i n i t初始化f l a s h*s w i t c h:d i r f l a s h:(查看文件,可省去)*s w i t c h:r e n a m e c o n f i g.t e x t c o n f i g.o l d改名*s w i t c h:b o o t重启*s w i t c h e n a b l e进入特权*s w i t c h#d i r f l a s h:(查看文件,可省去)*s w i t c h#r e n a m e c o n f i g.o l d c o n f i g.t e x t改名*s w i t c h#c o p y f l a s h:c o n f i g.t e x t r u n n i n g-c o n f i g 复制到系统内*s w i t c h#c o n f i t t e r m i n a l进入全局模式*s w i t c h(c o n f i g)#e n a b l e p a s s w o r d222设置新密码21、s w i t c h#s h o w v l a n-s w b r i e f查看v l a n22、s w i t c h#v l a n d a t a b a s e进入v l a n模式s w i t c h(v l a n)#v l a n20n a m e b b b创建v l a n并命名23、s w i t c h(v l a n)#n o v l a n20删除v l a n24、添加端口到v l a n(单个)s w i t c h(c o n f i g)#i n t e r f a c e f0/1进入接口模式s w i t c h(c o n f i g-i f)#s w i t c h p o r t a c c e s s v l a n 10添加至v l a n10s w i t c h(c o n f i g-i f)#e n d退出s w i t c h#s h o w v l a n b r i e f(i d)验证v l a ns w i t c h(c o n f i g)#s h o w r u n n i n g-c o n f i g i n t e r f a c e f0/1(查看某接口)25、添加端口到v l a n(批量)s w i t c h(c o n f i g)#i n t e r f a c e r a n g e f0/1-5s w i t c h(c o n f i g-i f-r a n g e)#s w i t c h p o r t a c c e s sv l a n1026、s w i t c h(c o n f i g)#i n t e r f a c e f0/1进入接口s w i t c h(c o n f i g-i f)#s w i t c h p o r t m o d e t r u n k设置为t r u n k(永久)s w i t c h(c o n f i g-i f)#s w i t c h p o r t m o d e d y n a m i cd e s i r a b l e/a u t o(其它t r u n k)s w i t c h(c o n f i g-i f)#s w i t c h p o r t t r u n k a l l o w e d v l a n r e m o v e10移除v l a n10)s w i t c h(c o n f i g-i f)#s w i t c h p o r t t r u n k a l l o w e d v l a n a d d20添加v l a n2027、s w i t c h#s h o w i n t e r f a c e f0/1s w i t c h p o r t查看接口模式s h o w i p i n t e r f a c e b r i e f看过文章c i s c o常用命令的人还看了:1.C I S C O路由器的配置与调试2.C i s c o路由器常用配置命令3.C i s c o路由器配置命令全攻略4.如何查看C i s c o路由器的配置信息5.思科C i s c o路由器的基础配置知识6.思科路由器怎么进入思科路由器怎么设置。
思科交换机 路由器配置命令大全

思科Cisco交换机、路由器设置命令交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname <hostname> ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令为 xxxswitch(config)#enable password xxx ;设置特权非密口令为 xxxswitch(config)#line console 0 ;进控制台口(Rs232)初始化switch(config-line)#line vty 0 4 ;进入虚拟终端virtual ttyswitch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口1加入VLAN 2switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan中继switch(config)#vtp domain <name> ;设置发vtp域名switch(config)#vtp password <word>switch(config)#vtp mode serverswitch(config)#vtp mode client交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ip address <IP> <mask> ;添加远程登录IP switch(config)#ip default-gateway <IP> ;添加默认网关switch#dir flash: ;查看内存交换机显示命令:switch#write ;写入保存switch#show vtpswitch#show run ;查看当前配置信息switch#show vlan ;看VLANswitch#show interface ;显示所有端口信息switch#show int f0/0 ;显示端口0的信息 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^路由器显示命令:router#show run ;显示接口router#show interface ;显示接口router#show ip route ;显示路由router#show cdp nei ;看邻居router#reload ;重新起动设置口令:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname <hostname> ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令为 xxxrouter(config)#enable password xxx ;设置特权非密口令为 xxxrouter(config)#line console 0 ;进控制台口(Rs232)初始化router(config-line)#line vty 0 4 ;进入虚拟终端virtual ttyrouter(config-line)#login ;允许登录router(config-line)#password xx ;设置登录口令xx router(config)# (Ctrl+z) ;返回特权模式router#exit ;返回命令配置IP地址:router(config)#int s0/0 ;进行串Serail接口router(config-if)#no shutdown ;起动接口router(config-if)#clock rate 64000 ;设置时钟router(config-if)#ip address 10.1.1.1 255.255.0.0 ;设置IP地址和子网掩码router(config-if)#ip add 10.1.1.2 255.255.0.0 second;router(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address <ip><netmask> ;router(config-subif.1)#encapsulation dot1q <n> ;router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导复制操作:router#copy running-config startup-config ;存配置router#copy running-config tftp ;上载router#copy startup-config tftprouter#copy tftp flash: ;特权模式下升级IOSrouter#copy tftp startup-config ;下载配置文件到nvramROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置,26 36 45xxrommon>confreg 0x2102 ;使用配置,恢复工作状态rommon>reset ;重新引导,等效于重开机rommon>copy xmodem:<sname> flash:<dname> ;从console升级IOSrommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IPrommon>TFTP_FILE=c2600.bin ;所要下载的文件rommon>tftpdnld ;ROM监控状态下升级IOSrommon>dir flash: ;查看闪存中的内容rommon>boot ;引导IOS静态路由:ip route <ip-address> <subnet-mask> <gateway> 例:router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2动态路由:router(config)#ip routing ;启动路由router(config)#router rip ;启动RIP路由协议。
最详细的CISCO路由器配置命令及方法

switch> 用户模式1:进入特权模式 enableswitch> enableswitch#2:进入全局配置模式 configure terminalswitch> enableswitch#configure terminalswitch(conf)#3:交换机命名 hostname aptech2950 以aptech2950为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使能口令 enable password cisco 以cisco为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco5:配置使能密码 enable secret ciscolab 以cicsolab为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscolab6:设置虚拟局域网vlan 1 interface vlan 1switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip和子网掩码aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway 192.168.254 设置网关地址7:进入交换机某一端口 interface fastethernet 0/17 以17端口为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface fastethernet 0/17aptech2950(conf-if)#8:查看命令 showswitch> enableswitch# show version 察看系统中的所有版本信息show interface vlan 1 查看交换机有关ip 协议的配置信息show running-configure 查看交换机当前起作用的配置信息show interface fastethernet 0/1 察看交换机1接口具体配置和统计信息show mac-address-table 查看mac地址表show mac-address-table aging-time 查看mac地址表自动老化时间9:交换机恢复出厂默认恢复命令switch> enableswitch# erase startup-configureswitch# reload10:双工模式设置switch> enableswitch#configure terminalswitch2950(conf)#hostname aptch-2950aptech2950(conf)# interface fastethernet 0/17 以17端口为例aptech2950(conf-if)#duplex full/half/auto 有full , half, auto 三个可选项11:cdp相关命令switch> enableswitch# show cdp 查看设备的cdp全局配置信息show cdp interface fastethernet 0/17 查看17端口的cdp配置信息show cdp traffic 查看有关cdp包的统计信息show cdp nerghbors 列出与设备相连的cisco设备12:csico2950的密码恢复拔下交换机电源线。
cisco路由基本配置命令

一、几种配置命令模式switch>这种提示符表示是在用户命令模式,只能使用一些查看命令。
switch#这种提示符表示是在特权命令模式。
switch(config)# 这种提示符表示是全局配置模式switch(config-if)# 端口配置命令模式图一几种命令模式二、检查、查看命令这些命令是查看当前配置状况,通常是以show(sh)为开始的命令。
show version查看IOS的版本、show flash查看flash内存使用状况、show mac-address-table查看MAC地址列表图二图三图四图五Show ? 帮助命令显示当前所有的查看命令图六查看端口状态信息三、密码设置命令Cisco交换机、路由器中有很多密码,设置好这些密码可以有效地提高设备的安全性。
switch(config)#enable password 设置进入特权模式进的密码switch(config-line) 可以设置通过console端口连接设备及telnet 远程登录时所需要的密码图七设置交换机的各种密码默认情况下,这些密码都是以明文的形式存储,所以很容易查看到。
为了避免这种情况,我们可以以密文的形式存储各种密码:servicepassword-encryption图九图十密码以密文的形式存储四、配置IP地址及默认网关图十一五、管理MAC地址表switch#show mac-address-table 显示MAC地址列表switch#clear mac-address-table dynamic 清除动态MAC地址列表图十二图十三设置静态MAC地址六、配置端口安全switch(config-if)switchport port-securityswitch(config-if)switchport port-security maximum 4图十四图十五七、一个配置实例图十六实例拓扑图图十七图十八图十九二、配置vlanVlan(Virtual Local Area Network)即虚拟局域网。
思科路由器(CiscoRouter)常用配置命令大全

思科路由器(CiscoRouter)常用配置命令大全思科路由器(Cisco Router)常用配置命令大全1. Access-enable允许路由器在动态访问列表中创建临时访问列表入口2. Access-group把访问控制列表(ACL)应用到接口上3. Access-list定义一个标准的IP ACL4. Access-template在连接的路由器上手动替换临时访问列表入口5. Appn向APPN子系统发送命令6. Atmsig 执行ATM信令命令7. B 手动引导操作系统8. Bandwidth 设置接口的带宽9. Banner motd 指定日期信息标语10. Bfe 设置突发事件手册模式11. Boot system 指定路由器启动时加载的系统映像12. Calendar 设置硬件日历13. Cd 更改路径14. Cdp enable 允许接口运行CDP协议15. Clear 复位功能16. Clear counters 清除接口计数器17. Clear interface 重新启动接口上的件逻辑18. Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率19. Cmt 开启/关闭FDDI连接管理功能20. Config-register 修改设置寄存器设置21. Configure 允许进入存在的设置模式,在中心站点上维护并保存设置信息22. Configure memory 从NVRAM加载设置信息23. Configure terminal 从终端进行手动设置24. Connect 打开一个终端连接25. Copy 复制设置或映像数据26. Copy flash tftp 备份系统映像文件到TFTP服务器27. Copy running-config startup-config 将RAM中的当前设置存储到NVRAM28. Copy running-config tftp 将RAM中的当前设置存储到网络TFTP服务器上29. Copy tftp flash 从TFTP服务器上下载新映像到Flash30. Copy tftp running-config 从TFTP服务器上下载设置文件31. Debug 使用调试功能32. Debug dialer 显示接口在拨什么号及诸如此类的信息33. Debug ip rip 显示RIP路由选择更新数据34. Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息35. Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息36. Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程37. Debug ppp 显示在实施PPP中发生的业务和交换信息38. Delete 删除文件39. Deny 为一个已命名的IP ACL设置条件40. Dialer idle-timeout 规定线路断开前的空闲时间的长度41. Dialer map 设置一个串行接口来呼叫一个或多个地点42. Dialer wait-for-carrier-time 规定花多长时间等待一个载体43. Dialer-group 通过对属于一个特定拨号组的接口进行设置来访问控制44. Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL和协议的组合来控制控制拨号45. Dir 显示给定设备上的文件46. Disable 关闭特许模式47. Disconnect 断开已建立的连接48. Enable 打开特许模式49. Enable password 确定一个密码以防止对路由器非授权的访问50. Enable password 设置本地口令控制不同特权级别的访问51. Enable secret 为enable password命令定义额外一层安全性(强制安全,密码非明文显示)52. Encapsulation frame-relay 启动帧中继封装53. Encapsulation novell-ether 规定在网络段上使用的Novell 独一无二的格式54. Encapsulation PPP 把PPP设置为由串口或ISDN接口使用的封装方法55. Encapsulation sap 规定在网络段上使用的以太网802.2格式Cisco的密码是sap56. End 退出设置模式57. Erase 删除闪存或设置缓存58. Erase startup-config 删除NVRAM中的内容59. Exec-timeout 设置EXEC命令解释器在检测到用户输入前所等待的时间60. Exit 退出所有设置模式或关闭一个激活的终端会话和终止一个EXEC61. Exit 终止所有设置模式或关闭一个活动的对话和结束EXEC62. format 格式化设备63. Frame-relay local-dlci 为使用帧中继封装的串行线路启动本地管理接口(LMI)64. Help 获得交互式帮助系统65. History 查看历史记录66. Hostname 使用一个主机名来设置路由器,该主机名以提示符或缺省文件名的方式使用67. Interface 设置接口类型并且输入接口设置模式68. Interface 设置接口类型和进入接口设置模式69. Interface serial 选择接口并且输入接口设置模式70. Ip access-group 控制对一个接口的访问71. Ip address 设定接口的网络逻辑地址72. Ip address 设置一个接口地址和子网掩码并开始IP处理73. Ip default-network 建立一条缺省路由74. Ip domain-lookup 允许路由器缺省使用DNS75. Ip host 定义静态主机名到IP地址映射76. Ip name-server 指定至多6个进行名字-地址解析的服务器地址77. Ip route 建立一条静态路由78. Ip unnumbered 在为给一个接口分配一个明确的IP地址情况下,在串口上启动互连网协议(IP)的处理过程79. Ipx delay 设置点计数80. Ipx ipxwan 在串口上启动IPXWAN协议81. Ipx maximum-paths 当转发数据包时设置Cisco IOS软件使用的等价路径数量82. Ipx network 在一个特定接口上启动互连网数据包交换(IPX)的路由选择并且选择封装的类型(用帧封装)83. Ipx router 规定使用的路由选择协议84. Ipx routing 启动IPX路由选择85. Ipx sap-interval 在较慢的链路上设置较不频繁的SAP(业务广告协议)更新86. Ipx type-20-input-checks 限制对IPX20类数据包广播的传播的接受87. Isdn spid1 在路由器上规定已由ISDN业务供给商为B1信道分配的业务简介号(SPID)88. Isdn spid2 在路由器上规定已由ISDN业务供给商为B2信道分配的业务简介号(SPID)89. Isdntch-type 规定了在ISDN接口上的中心办公区的交换机的类型90. Keeplive 为使用帧中继封装的串行线路LMI(本地管理接口)机制91. Lat 打开LAT连接92. Line 确定一个特定的线路和开始线路设置93. Line concole 设置控制台端口线路94. Line vty 为远程控制台访问规定了一个虚拟终端95. Lock 锁住终端控制台96. Login 在终端会话登录过程中启动了密码检查97. Login 以某用户身份登录,登录时允许口令验证98. Logout 退出EXEC模式99. Mbranch 向下跟踪组播地址路由至终端100. Media-type 定义介质类型101. Metric holddown 把新的IGRP路由选择信息和正在使用的IGRP路由选择信息隔离一段时间102. Mrbranch 向上解析组播地址路由至枝端103. Mrinfo 从组播路由器上获取邻居和版本信息104. Mstat 对组播地址多次路由跟踪后显示统计数字105. Mtrace 由源向目标跟踪解析组播地址路径106. Name-connection 命名已存在的网络连接107. Ncia 开启/关闭NCIA服务器108. Network 把一个基于NIC的地址分配给一个和他直接相连的路由器把网络和一个IGRP的路由选择的过程联系起来在IPX路由器设置模式下,在网络上启动加强的IGRP109. Network 指定一个和路由器直接相连的网络地址段110. Network-number 对一个直接连接的网络进行规定111. No shutdown 打开一个关闭的接口112. Pad 开启一个X.29 PAD连接113. Permit 为一个已命名的IP ACL设置条件114. Ping 把ICMP响应请求的数据包发送网络上的另一个节点检查主机的可达性和网络的连通性对网络的基本连通性进行诊断115. Ping 发送回声请求,诊断基本的网络连通性116. Ppp 开始IETF点到点协议117. Ppp authentication 启动Challenge握手鉴权协议(CHAP)或密码验证协议(PAP)或将两者都启动,并且对在接口上选择的CHAP和PAP验证的顺序进行规定118. Ppp chap hostname 当用CHAP进行身份验证时,创建一批似乎是同一台主机的拨号路由器119. Ppp chap password 设置一个密码,该密码被发送到对路由器进行身份验证的主机命令对进入路由器的用户名/密码的数量进行了限制120. Ppp pap sent-username 对一个接口启动远程PAP支持,并且在PAP对同等层请求数据包验证过程中使用sent-username和password121. Protocol 对一个IP路由选择协议进行定义,该协议能是RIP,内部网关路由选择协议。
干货!思科网络设备配置命令大全

干货!思科网络设备配置命令大全础配置1思科设备管理基础命令enable 从用户模式进入特权模式configure terminal 进入配置模式interface g0/0进入千兆以太网接口g0/0ip address 172.16.0.1 255.255.0.0配置接口的 ip 地址no shutdown 开启接口line vty 0 4进入虚拟终端 vty 0 - vty 4password CISCO配置认证密码login 用户要进入路由器,需要先进行登录exit 退回到上一级模式enable password CISCO配置进入特权模式的密码,密码不加密end 直接回到特权模式show int g0/0 显示 g0/0 接口的信息hostname Terminal-Server 配置路由器的主机名enable secret ccielab 配置进入特权模式的密码,密码加密no ip domain-lookup 路由器不使用 DNS 服务器解析主机的 IP地址logging synchronous 路由器上的提示信息进行同步,防止信息干扰我们输入命令no ip routing 关闭路由器的路由功能ip default-gateway 10.1.14.254 配置路由器访问其他网段时所需的网关show line 显示各线路的状态line 33 48 进入 33-48 线路模式transport input all 允许所有协议进入线路int loopback0 进入 loopback0 接口ip host R1 2033 1.1.1.1 为 1.1.1.1 主机起一个主机名alias exec cr1 clear line 33 为命令起一个别名privilege exec level 0 clear line把命令 clear line 的等级改为 0,在用户模式下也可以执行它banner motd 设置用户登录路由器时的提示信show ip int brief 查看接口状态2VLAN相关命令vlan X 创建VLAN Xname SPOTO 将VLAN X命名为SPOTOexit 退出当前模式interface e0/0 进入以太网接口e0/0switchport mode access 将二层接口设置为接入模式switchport access vlan X 将接口划入vlan Xinterface e0/1switchport trunk encapsulation dot1q trunk链路封装协议为 802.1qswitchport mode trunk 将二层接口配置模式为 trunkswitchport trunk allow vlan X trunk接口单独放行某个 vlan。
Cisco路由器配置基本命令

Cisco路由器配置基本命令特权模式:enableRouter1 # show running-configRouter1 # show ip routeRouter # show ip interface briefSwitch # show vlanSwitch # show ip interface配置模式:configure terminal1) console密码SW2(config)#line console 0SW2(config-line)#password ciscoSW2(config-line)#login //启⽤密码认证,默认没有,需要加上去SW2(config-line)#login local //本地开启⽤户认证SW2(config)username xiao password fan //创建本地⽤户SW2(config)username xiao privilege 15 password fan //以该⽤户登⼊设备后直接进⼊特权模式说明---对⽤户的权限定义0-15级,最⾼为15,任何命令都可操作SW2(config)service password-encryption //明⽂密码加密2)特权模式密码(设置全局密码)SW2>enadleSW2(config)#configure terminal1.(config)#enable password en cisco←密码encisco2.(config)#enable secret jmcisco←密码jmcisco #2个同时设,只有secret 有效,因为其优先极⾼(config)#login <--⼀定要加,表⽰启⽤全局密码设置完成exitenable password xiaofan 优先级低enable secret cisco 优先级⾼思科加密⽅式:0 显⽰的是密码本⾝7 密⽂加密,容易破解5 复杂密⽂加密3)虚拟通道密码SW2>enadleSW2(config)#configure terminalSW2(config)#line vty 0 4SW2(config-line)#password telnetciscoSW2(config-line)#login //默认就有SW2(config-line)#login local //开启本地⽤户认证,使⽤本地⽤户数据库SW2(config-line)no login //不需要密码就可登陆路由类(静态路由和动态路由)静态路由:ip route address subnet-mask address默认路由ip route 0.0.0.0 0.0.0.0 address动态路由:rip v2* Router1配置RIP协议Router(config)# router rip !开启RIP协议进程Router(config-router)# network 172.16.1.0 !申明本设备的直连⽹段Router(config-router)# network 172.16.2.0Router(config-router)# version 2Router(config-router)# no auto-summary !关闭路由信息的⾃动汇总功能* 三层交换机配置RIP协议Switch (config)# router rip !开启RIP协议进程Switch (config-router)# network 172.16.1.0 !申明本设备的直连⽹段Switch (config-router)# network 172.16.5.0Switch (config-router)# version 2vlan和trunk*三层交换机基本配置Switch# configure terminalSwitch (config)# vlan 10Switch (config-vlan)# exitSwitch (config)# vlan 50Switch (config-vlan)# exitSwitch (config)# interface f0/1Switch (config-if)# switchport access vlan 10Switch (config-if)# exitSwitch (config)# interface f0/5Switch (config-if)# switchport access vlan 50Switch (config-if)# exitSwitch (config)# interface vlan 10 !创建VLAN虚接⼝,并配置IPSwitch (config-if)# ip address 172.16.1.2255.255.255.0Switch (config-if)# no shutdownSwitch (config-if)# exitSwitch (config)# interface vlan 50 !创建VLAN虚接⼝,并配置IPSwitch (config-if)# no shutdownSwitch (config-if)# exittrunk在sw1、sw2之间使⽤sw1(config)#interface f0/0 进⼊要设置的端⼝(f0/0)sw1(config-if)#switchport mode trunk 将端⼝进⾏trunk设置sw1(config-if)#no shutdown 激活此端⼝访问控制(ACL)标准访问列表配置实例:R1(config)#access-list 10 deny 192.168.2.0 0.0.0.255R1(config)#access-list 10 permit anyR1(config)#int fa0/0.1R1(config-subif)#ip access-group 10 out扩展访问控制列表配置实例:R2(config)#access-list 110 deny tcp any host 192.168.1.12 eq wwwR2(config)#access-list 110 deny tcp any host 192.168.1.12 eq ftpR2(config)#int fa0/0R2(config-if)#ip access-group 110 out上⾯配置的含义是拒绝访问192.168.1.12的www和ftp服务access-list 101 permit tcp any 172.16.4.13 0.0.0.0 eq www //设置ACL101,容许源地址为任意IP,⽬的地址为172.16.4.13主机的80端⼝即WWW服务。
路由器配置常用命令汇总

路由器配置常用命令汇总路由器是连接网络设备的关键组件,用于将网络流量从一个网络传输到另一个网络。
配置路由器是网络管理员的重要任务之一,通过配置路由器,管理员可以确保网络安全,优化网络性能和管理网络流量。
下面是常用的路由器配置命令的汇总。
1.基本设置命令- enable:进入特权模式- configure terminal:进入全局配置模式- hostname [name]:设置路由器主机名- interface [interface-name]:进入接口配置模式- ip address [ip-address] [subnet-mask]:设置接口的IP地址和子网掩码2.接口配置命令- shutdown:关闭接口- no shutdown:启用接口- description [description]:为接口添加描述信息- speed [speed]:设置接口速率- duplex [duplex]:设置接口双工模式(全双工或半双工)3.路由配置命令- ip route [network-address] [subnet-mask] [next-hop-address]:添加静态路由- ip default-gateway [default-gateway-address]:设置默认网关- router rip:进入RIP路由协议配置模式- network [network-address]:启用RIP协议,并指定需要进行路由的网络地址4.网络地址转换(NAT)命令- ip nat inside source static [local-ip] [global-ip]:静态NAT配置- ip nat inside source list [access-list-number] interface [interface-name] overload:动态NAT配置- access-list [access-list-number] permit [source-address] [subnet-mask]:创建ACL以定义需要进行NAT转换的源地址5.防火墙配置命令- access-list [access-list-number] permit [source-address] [subnet-mask]:创建允许流量通过的ACL规则- access-list [access-list-number] deny [source-address] [subnet-mask]:创建阻止流量通过的ACL规则- interface [interface-name] ip access-group [access-list-number] in/out:将ACL应用到接口的进出方向6.路由器安全配置命令- enable secret [password]:设置特权模式密码- username [name] password [password]:创建本地用户名和密码- line vty 0 4:进入虚拟终端配置模式- login local:启用本地用户名和密码验证- service password-encryption:对密码进行加密7.服务配置命令- ip dhcp pool [pool-name]:创建DHCP地址池- network [network-address] [subnet-mask]:指定地址池所在的网络地址和子网掩码- default-router [default-gateway-address]:指定默认网关- dns-server [dns-server-address]:指定DNS服务器地址8.路由器监控和故障排除命令- show interface [interface-name]:显示接口信息- show ip route:显示路由表- show ip interface brief:显示接口摘要信息- show ip nat translations:显示NAT转换信息- ping [ip-address]:向指定IP地址发送ping命令进行连通性测试这只是一部分常用的路由器配置命令,实际使用中还有更多的命令可用于不同的路由器配置场景。
思科交换机路由器命令大全

思科交换机路由器命令大全1. 交换机支持的命令:交换机基本状态:switch: ;ROM状态,路由器是rommon> hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address ;设置IP地址switch(config)#ip default-gateway ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息2. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ;返回特权模式router#exit ;返回命令路由器配置:router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address ;设置IP地址router(config-if)#ip address second ;设置第二个IP router(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address ;设置子接口IProuter(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftp router#copy startup-config tftp ;开机配置存到tftprouter(config-if)#ip access-group in|out ;default:out 例1:router(config)#access-list 4 permit 10.8.1.1router(config)#access-list 4 deny 10.8.1.0 0.0.0.255 router(config)#access-list 4 permit 10.8.0.0 0.0.255.255 router(config)#access-list 4 deny 10.0.0.0 0.255.255.255 router(config)#access-list 4 permit anyrouter(config)#int f0/0router(config-if)#ip access-group 4 in扩展访问控制列表:access-list permit|deny icmp wild>[type]access-list permit|deny tcp wild>[port]例3:router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echorouter(config)#access-list 101 permit ip any anyrouter(config)#int s0/0router(config-if)#ip access-group 101 in例3:router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80router(config)#access-list 102 permit ip any anyrouter(config)#interface s0/1router(config-if)#ip access-group 102 out删除访问控制例表:router(config)#no access-list 102router(config-if)#no ip access-group 101 in路由器的nat配置Router(config-if)#ip nat inside ;当前接口指定为内部接口Router(config-if)#ip nat outside ;当前接口指定为外部接口Router(config)#ip nat inside source static [p] <私有IP>< 公网IP> [port]Router(config)#ip nat inside source static 10.65.1.260.1.1.1Router(config)#ip nat inside source static tcp 10.65.1.380 60.1.1.1 80Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20255.255.255.0Router(config)#ip nat inside source list 1 pool p1Router(config)#ip nat inside destination list 2 pool p2Router(config)#ip nat inside source list 2 interface s0/0overloadRouter(config)#ip nat pool p2 10.65.1.2 10.65.1.4255.255.255.0 type rotaryRouter#show ip nat translationrotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配。
CISCO配置命令大全

CISCO配置命令大全路由器的基本配置1 .配置以太网(Ethernet)端口:# conf t从终端配置路由器。
# int e0指定E0口。
# ip addr ABCD XXXXABCD为以太网地址,XXXX为子网掩码。
# ip addr ABCD XXXX secondaryE0口同时支持两个地址类型。
如果第一个为A类地址,则第二个为B或C类地址。
# no shutdown激活E0口。
# exit2.X.25的配置# conf t# int S0指定S0口.# ip addr ABCD XXXXABCD为以太网S0的IP地址,XXXX为子网掩码.。
# encap X25-ABC封装X.25协议。
ABC指定X.25为DTC或DCE操作,缺省为DTE。
# x25 addr ABCDABCD为S0的X.25端口地址,由邮电局提供。
# x25 map ip ABCD XXXX br映射的X.25地址.ABCD为对方路由器(如:S0)的IP地址,XXXX为对方路由器(如:S0)的X.25端口地址。
# x25 htc X配置最高双向通道数.X的取值范围1-4095,要根据邮电局实际提供的数字配置。
# x25 nvc X配置虚电路数。
X不可超过据邮电局实际提供的数,否则,将影响数据的正常传输。
# exit---- 3 .专线的配置:# conf t# int S2指定S2口。
# ip addr ABCD XXXXABCD为S2的IP地址,XXXX为子网掩码。
# exit4.帧中继的配置# conf t# int s0# ip addr ABCD XXXXABCD为S0的IP地址,XXXX为子网掩码。
# encap frante_relay封装frante_relay协议。
# no nrzi_encodingNRZI=NO# frame_relay lmi_type q933aLMI使用Q933A标准.LMI(Local management Interface)有3种:ANSI:T1.617;CCITTY:Q933A和CISCO特有的标准。
计算机网络应用 Cisco路由器的常见命令

计算机网络应用Cisco路由器的常见命令路由器必须经过配置后才能工作,因为在路由器出厂时NVRAM(非易失性内存)中默认是空的,并没有配置文件。
需要用户根据实际情况,借助于计算机的超级终端软件、显示器及键盘等对路由器进行设置。
有关路由器的设置命令很多,其中最常见的命令总结如下。
1.enable(从用户模式进入特权模式)Router>Router>enableRouter#2.configure terminal(进入全局配置模式)Router#Router#configure terminalRouter(config)#3.hostname R1(以R1为例为路由器命名)Router(config)#Router(config)#hostname R1R1(config)#4.interface fastehernet 0/17(进入路由器某一端口,例如17端口)Router(config)#Router(config)#interface fastethernet 0/17Router(config-if)#5.ip address(设置端口IP地址信息)Router(config-if)#Router(config-if)#ip address 192.168.1.1 255.255.255.0 (设置端口IP地址和子网掩码)Router(config-if)#no shutdown 使IP地址生效Router(config-if)#exit 退回上一级模式Router(config)#6.show(查看命令)Router#show version 察看系统中的所有版本信息Router#show interfaces 查看路由器上所有端口信息Router#show running-configure 查看路由器当前的配置信息Router#show interface fastethernet 0/1 察看路由器fastethernet 0/1接口配置信息Router#show ip router 查看路由器的路由表7.ping(测试物理连通性)ping命令分为标准ping命令和扩展ping命令。
Cisco(恩科)路由器-交换机命令大全

Cisco(恩科)路由器-交换机命令大全1.switch配置命令(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号"全局配置模式----线控模式,使用命令"line+接口类型+接口号"注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的摘要信息banner motd # +信息+ # 配置路由器或交换机的描述信息description+信息配置接口听描述信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送数据包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLAN(虚拟局域网)configure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。
(完整)Cisco配置命令

switch〉用户模式1:进入特权模式 enableswitch> enableswitch#2:进入全局配置模式 configure terminalswitch> enableswitch#c onfigure terminalswitch(conf)#3:交换机命名 hostname aptech2950 以aptech2950为例switch〉 enableswitch#c onfigure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使能口令 enable password cisco 以cisco为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco5:配置使能密码 enable secret ciscolab 以cicsolab为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscolab6:设置虚拟局域网vlan 1 interface vlan 1switch〉 enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 192。
168.1。
1 255.255。
255.0 配置交换机端口ip和子网掩码aptech2950(conf—if)#no shut 是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ip default—gateway 192。
Cisco配置命令

switch>用户模式1:进入特权模式“enable”switch> enableswitch#2:进入全局配置模式“configure terminal”switch> enableswitch#configure terminalswitch(conf)#3:交换机命名hostname aptech2950 以aptech2950为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使能口令enable password cisco 以cisco为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco5:配置使能密码enable secret ciscolab 以cicsolab为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscolab6:设置虚拟局域网vlan 1 interface vlan 1switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip和子网掩码aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway 192.168.1.254 设置网关地址7:进入交换机某一端口interface fastehernet 0/17 以17端口为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#8:查看命令showswitch> enableswitch# show version 察看系统中的所有版本信息show interface vlan 1 查看交换机有关ip 协议的配置信息show running-configure 查看交换机当前起作用的配置信息show interface fastethernet 0/1 察看交换机1接口具体配置和统计信息show mac-address-table 查看mac地址表show mac-address-table aging-time 查看mac地址表自动老化时间9:交换机恢复出厂默认恢复命令switch> enableswitch# erase startup-configureswitch# reload10:双工模式设置switch> enableswitch#configure terminalswitch2950(conf)#hostname aptch-2950aptech2950(conf)# interface fastehernet 0/17 以17端口为例aptech2950(conf-if)#duplex full/half/auto 有full , half, auto 三个可选项11:cdp相关命令switch> enableswitch# show cdp 查看设备的cdp全局配置信息show cdp interface fastethernet 0/17 查看17端口的cdp配置信息show cdp traffic 查看有关cdp包的统计信息show cdp nerghbors 列出与设备相连的cisco设备12:csico2950的密码恢复拔下交换机电源线。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Cisco路由器安全配置必用的10条命令
2007-04-26 16:29:58
标签:Cisco路由器cisco安全配置10条命令
当谈到配置一台新的cisco路由器,多数配置依赖于路由器的类型以及它将服务的用途。
然而,有一些东西是你在每台新的cisco路由器上都应该配置的。
有哪个命令的标准是你希望思科在每台路由器上都使用的吗?每位管理员都其自己的“正确”配置每台路由器的命令。
这是我认为你应该在每台路由器上都配置的十条命令的列表(没有特别的顺序)。
在路由器上配置一个登录帐户
我强烈建议在路由器和交换机上配置一个真实的用户名和口令帐号。
这样做,意味着你需要用户和口令来获得访问权。
除此之外,我建议为用户名使用一个秘密口令,而不仅有一个常规口令。
它用md5加密方法来加密口令,并且大大提高了安全性。
举例如下:
router(config)# username root secret my$password
在配置了用户名后,你必须启用使用该用户名的端口。
举例如下:
router(config)# line con 0
router(config-line)# login local
router(config)# line aux 0
router(config-line)# login local
router(config)# line vty 0 4
router(config-line)# login local
在路由器上设置一个主机名
我猜测路由器上缺省的主机名是router。
你可以保留这个缺省值,路由器同样可以正常运行。
然而,对路由器重新命名并唯一地标识它才有意义。
举例如下: router(config)# hostname router-branch-23
除此之外,你可以在路由器上配置一个域名,这样它就知道所处哪个dns域中。
举例如下:
router-branch-23(config)# ip domain name
为进入特权模式设置口令
当谈到设置进入特权模式的口令时,许多人想到使用enable password命令。
然而,代替使用这个命令,我强烈推荐使用enable secret命令。
这个命令用md5加密方法加密口令,所以提示符不以明文显示。
举例如下:
router(config)# enable secret my$password
加密路由器口令
cisco路由器缺省情况下在配置中不加密口令。
然而,你可以很容易地改变这一点。
举例如下:
router(config)# service password-encryption
禁用web服务
cisco路由器还在缺省情况下启用了web服务,它是一个安全风险。
如果你不打算使用它,最好将它关闭。
举例如下:
router(config)# no ip http server
配置dns,或禁用dns查找
让我们讨论cisco路由器中我个人认为的一个小毛病:缺省情况下,如果在特权模式下误输入了一个命令,路由器认为你试图telnet到一个远程主机。
然而它对你输入的内容却执行dns查找。
如果你没有在路由器上配置dns,命令提示符将挂起直到dns查找失败。
由于这个原因,我建议使用下面两个方法中的一个。
一个选择是禁用dns。
做法是:
router(config)# no ip domain-lookup
或者,你可以正确地配置dns指向一台真实的dns服务器。
router(config)# ip name-server
配置命令别名
许多网络管理员都知道在路由器上配置命令的缩写(也就是别名)。
举例如下:
router(config)# alias exec s sh run
这就是说你现在可以输入s,而不必输入完整的show running-configuration命令。
设置路由器时钟,或配置ntp服务器
多数cisco设备没有内部时钟。
当它们启动时,它们不知道时间是多少。
即使你设置时间,如果你将路由器关闭或重启,它不会保留该信息。
首先设置你的时区和夏令时。
例子如下:
router(config)# clock timezone cst -6
router(config)# clock summer-time cdt recurring
然后,为了确保路由器的事件消息显示正确的时间,设置路由器的时钟,或者配置一个ntp服务器。
设置时钟的例子如下:
router# clock set 10:54:00 oct 5 2005
如果你已经在网络中有了一个ntp服务器(或可以访问internet的路由器),你可以命令路由器将之作为时间源。
这是你最好的选择,当路由器启动时,它将通过ntp服务器设置时钟。
举例如下:
router(config)# ntp server 132.163.4.101
不让日志消息打扰你的配置过程
cisco ios中另一个我认为的小毛病就是在我配置路由器时,控制台界面就不断弹出日志消息(可能是控制台端口,aux端口或vty端口)。
要预防这一点,你可以这样做。
所以在每一条端口线路上,我使用日志同步命令。
举例如下:
router(config)# line con 0
router(config-line)# logging synchronous
router(config)# line aux 0
router(config-line)# logging synchronous
router(config)# line vty 0 4
router(config-line)# logging synchronous
除此之外,你可以在端口上修改这些端口的执行超时时间。
例如,我们假设你想禁用vty线路上默认的十分钟超时时间。
在线路配置模式下使用 exec-timeout 0 0命令,使路由器永不退出。
在路由器缓冲区或系统日志服务器中记录系统消息
捕获路由器的错误和事件以及监视控制台是解决问题的关键。
默认情况下,路由器不会将缓冲的事件记录发送到路由器内存中。
然而,你可以配置路由器将缓冲的事件记录发送到内存。
举例如下:
router(config)# logging buffered 16384
你还可以将路由器事件发送到一个系统日志服务器。
由于该服务器处在路由器外部,就有一个附加的优点:即使路由器断电也会保留事件记录。