思科常用命令
- 格式:doc
- 大小:39.00 KB
- 文档页数:6
思科路由器命令大全(完整版)思科路由器命令大全(完整版)本文档旨在提供思科路由器命令的详细说明和使用指南,包括路由器配置、网络管理、安全性设置等内容。
每个章节都详细介绍了不同的命令和参数,以帮助用户更好地理解和使用思科路由器。
1:路由器基本配置1.1 主机名设置1.2 用户名和密码设置1.3 IP 地址和子网掩码配置1.4 默认网关配置2:接口配置2.1 以太网接口配置2.2 串行接口配置2.3 子接口配置2.4 虚拟局域网 (VLAN) 配置3:路由协议配置3.1 静态路由配置3.2 动态路由配置3.2.1 RIP 配置3.2.2 OSPF 配置3.2.3 BGP 配置4:网络管理4.1 SNMP 配置4.2 NetFlow 配置4.3 Syslog 配置4.4 路由器时间设置5:安全性配置5.1 访问控制列表 (ACL) 配置5.2 VPN 配置5.3 防火墙配置5.4 AAA 配置附件:本文档附带的附件包括示例配置文件、命令输出示例等,以帮助读者更好地理解和应用文档中的内容。
法律名词及注释:本文档所涉及的法律名词及其注释如下:1:主机名:指路由器的主机标识名称,用于在网络中识别路由器。
2:用户名和密码:用于登录和管理路由器的凭证信息。
3: IP 地址:网络协议中用于唯一标识设备的数字地址。
4:子网掩码:用于标识 IP 地址中网络部分和主机部分的分界线。
5:默认网关:用于转发网络流量的下一跳路由器。
6:以太网接口:用于连接局域网设备的物理接口。
7:串行接口:用于连接广域网设备的物理接口。
8:子接口:在一个物理接口上创建多个逻辑接口,用于实现VLAN 分隔等功能。
9:虚拟局域网 (VLAN):用于将局域网划分成多个逻辑网络的技术。
10:静态路由:手动配置的路由表项,用于指定数据包传输的路径。
11:动态路由:根据路由协议动态学习和更新的路由表项,用于自动路由选择。
12: RIP:路由信息协议,一种距离向量路由协议。
1. 计算机命令:PCA login: root ;使用root用户password: linux ;口令是linux# shutdown -h now ;同init 0 关机# logout ;退出登录# login ;登录# ifconfig ;显示IP地址# ifconfig eth0 <ip address> netmask <netmask> ;设置IP地址# ifconfig eth0 <ip address> netmask <netmask> down ;删除IP地址# route add 0.0.0.0 gw <ip> ;设置网关# route del 0.0.0.0 gw <ip> ;删除网关# route add default gw <ip> ;设置网关# route del default gw <ip> ;删除网关# route ;显示网关# ping <ip> ;测试网络# telnet <ip> ;远程登录2. 交换机支持的命令:交换机基本状态:switch: ;交换机的ROM状态rommon> ;路由器的ROM状态hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname <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 ;设置登录口令xxswitch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(vlan)#vtp domain <name> ;设置发vtp域名switch(vlan)#vtp password <word> ;设置发vtp密码switch(vlan)#vtp server ;设置发vtp模式switch(vlan)#vtp client ;设置发vtp模式switch(vlan)#vtp pruning ;设置vtp允许switch(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-if)#speed ;设置接口速度switch(config-if)#duplex ;设置接口作方式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address <IP> <mask> ;设置IP地址switch(config)#ip default-gateway <IP> ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息3. 路由器支持的命令:路由器显示命令: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 ;设置特权加密口令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> <netmask> ;设置IP地址router(config-if)#ip address <ip> <netmask> second ;设置第二个IProuter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address <ip> <netmask> ;设置子接口IProuter(config-subif.1)#encapsulation dot1q <n> ;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftprouter#copy startup-config tftp ;开机配置存到tftprouter#copy tftp flash: ;下传文件到flashrouter#copy tftp startup-config ;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset ;重新引导rommon>copy xmodem:<sname> flash:<dname> ;从console传输文件rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP rommon>TFTP_FILE=c2600.bin ;指定下载的文件rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS静态路由:ip route <ip-address> <subnet-mask> <gateway> ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。
思科交换机命令大全1.设置主机名/系统名IOS:switch(config)# hostname "hostname"CLI:switch(enable) set system name name-string2.设置登录口令IOS:switch(config)# enable password level 1 passwordCLI: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-addressCLI:switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.启用和浏览CDP信息IOS:switch(config-if)# cdp enableswitch(config-if)# no cdp enableCLI:switch(enable) set cdp {enable|disable} module/port5.查看Cisco邻接设备的CDP通告IOS:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]CLI:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 6.端口描述 IOS:switch(config-if)#description escription-stringCLI:switch(enable)set port name module/number description-string7.设置端口速度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}8.设置以太网的链路模式IOS:switch(config-if)# duplex {auto|full|half}CLI:switch(enable) set port duplex module/number {full|half}9.配置静态VLANIOS: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)# endCLI:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list10.配置VLAN中继线IOS: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:switch(enable)set trunk module/port [on|off|desirable|auto|nonegotiate] Vlan-range [isl|dotlq|dotl0|lane|negotiate]11.配置VTP管理域IOS:switch# vlan databaseswitch(vlan)# vtp domain domain-nameCLI:switch(enable) set vtp [domain domain-name]12.配置VTP 模式IOS:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password passwordCLI:switch(enable) set vtp [domain domain-name][mode{ sever|cilent|transparent }][password password]13.配置VTP版本IOS:switch# vlan databaseswitch(vlan)# vtp v2-modeCLI:switch(enable) set vtp v2 enable14.启动VTP剪裁IOS:switch# vlan databaseswitch(vlan)# vtp pruningCLI:switch(enable) set vtp pruning enable15.配置以太信道IOS:switch(config-if)# port group group-number [distribution {source|destination}] CLI:switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto} 16.调整根路径成本IOS:switch(config-if)#spanning-tree [vlan vlan-list] cost costCLI:switch(enable)set spantree portcost moudle/port costswitch(enable)set spantree portvlancost moudle/port [cost cost][vlan-list] 17.调整端口IDIOS:switch(config-if)#spanning-tree[vlan vlan-list]port-priority port-priority CLI:switch(enable)set spantree portpri {mldule/port}priorityswitch(enable)set spantree portvlanpri {module/port}priority [vlans]18.修改STP时钟IOS:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)#spanning-tree [vlan vlan-list] forward-time secondsswitch(config)#spanning-tree [vlan vlan-list] max-age seconds CLI:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]19.启用或禁用Port Fast 特征IOS:switch(config-if)#spanning-tree portfastCLI:switch(enable)set spantree portfast {module/port}{enable|disable}20.启用或禁用UplinkFast 特征IOS:switch(config)#spanning-tree uplinkfast [max-update-rate pkts-per-second]CLI:switch(enable)set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocolsoff|on] 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name21. 为了从一条中继链路上删除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 bridge bridge-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)# description description-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 multipointrouter(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-number41. 配置默认路由: 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、ip address:设置接口的IP地质示例:ip address 192.168.1.1 255.255.255:02、no shutdown:启用接口示例:no shutdown3、duplex:设置接口的双工模式示例:duplex auto4、speed:设置接口的速度示例:speed 1005、exit:退出接口配置模式示例:exit二、VLAN命令1、vlan database:进入VLAN数据库模式示例:vlan database2、vlan id name:创建VLAN并设置名称示例:vlan 10 name VLAN-103、vlan id:删除VLAN示例:no vlan 104、show vlan:显示VLAN信息示例:show vlan5、exit:退出VLAN数据库模式示例:exit三、路由命令1、ip route:设置静态路由示例:ip route 192.168.2:0 255.255.255:0 192.168.1.22、router rip:启用RIP路由协议示例:router rip3、network:将网络添加到RIP路由表中示例:network 10:0:0:04、redistribute:将静态路由或其他路由协议添加到RIP路由表中示例:redistribute static5、exit:退出路由配置模式示例:exit四、ACL命令1、access-list:创建标准或扩展ACL示例:access-list 10 permit 192.168.1:0 0:0:0.2552、ip access-group:应用ACL到接口示例:ip access-group 10 in3、show access-lists:显示ACL信息示例:show access-lists4、exit:退出ACL配置模式示例:exit五、SNMP命令1、snmp-server community:设置SNMP团体字符串示例:snmp-server community public RO2、snmp-server enable traps:启用SNMP陷阱示例:snmp-server enable traps3、snmp-server host:配置SNMP陷阱接收主机示例:snmp-server host 192.168.1.1004、exit:退出SNMP配置模式示例:exit六、SSH命令1、ip ssh version:设置SSH协议版本示例:ip ssh version 22、crypto key generate rsa:RSA密钥对示例:crypto key generate rsa3、username:创建新的本地用户示例:username admin privilege 15 password password1234、exit:退出SSH配置模式示例:exit七、其他命令1、show running-config:显示当前配置示例:show running-config2、copy running-config startup-config:将当前配置保存到启动配置中示例:copy running-config startup-config3、reload:重新启动设备示例:reload4、exit:退出CLI命令行模式示例:exit本文档涉及附件:1、无附件本文所涉及的法律名词及注释:1、ACL(Access Control List):访问控制列表,用于控制网络流量的进出。
思科命令大全思科常用命令大权1用户模式2:特权模式enableshow vlanshow versionshow interfaceshow mac-address-tableshow running-configcopy running-config startup-config3:全局配置模式config terminalhostnameenable passwordip default-gateway4:接口配置模式interface 端口switchport mode trunk5:line模式line console 0第2章交换机的基本配置1.配置主机hostname2.查看交换机的配置show running-config使能口令enable password加密保存的使能口令enable secret配置IP地址interface vlan1ip addressno shutdown配置交换机的网关ip default-gateway ipaddress查看交换机的MAC地址表show mac-address-table使用CDP协议show cdpshow cdp interfaceshow cdp neighborsshow cdp neighbors detailshow cdp traffic保存与删除交换机配置copy running-config startup-config第三章:虚拟局域网(VLAN)VLAN的概述VLAN是对连接在第2层交换机端口的网络用户的逻辑分段。
VLAN的作用:1。
广播控制2。
安全(副产品)3。
带宽利用4。
延迟VLAN的种类静态:基于端口的VLAN动态:基于MAC地址的VLAN在交换机上配置静态VLAN创建VLAN1。
CONFIG TERMINALVLAN 2NAME 22。
特权模式下VLAN DATABASEVLAN 2 NAME 2查看VLANSHOW VLAN删除VLANNO VLAN 2验证:SHOW VLAN BRIEF在VLAN中添加端口INTERFACE F0/2INTERFACE RANGE F0/2 - 5SWITCHPORT MODE ACCESSSWITCHPORT ACCESS VLAN 2VLAN配置实例在交换机上添加VLAN2,VLAN3,VLAN3,端口范围分别为1-4,5-8,9-12这个实例的作用就是让不同的VLAN的计算机之间的通信隔开。
思科路由器命令大全思科路由器命令大全1.基本设置命令1.1 主机名配置●hostname [主机名]:设置路由器的主机名。
1.2 用户名和密码配置●enable password [密码]:设置特权模式的密码。
●enable secret [密码]:设置加密的特权模式密码。
●username [用户名] password [密码]:创建一个本地用户并设置密码。
●line console 0:进入控制台命令行配置模式。
●password [密码]:设置控制台访问密码。
●line vty [行号] [结束行号]:进入虚拟终端配置模式。
●password [密码]:设置虚拟终端访问密码。
1.3 IP 地质配置●interface [接口类型] [接口编号]:进入接口配置模式。
●ip address [IP 地质] [子网掩码]:设置接口的IP 地质和子网掩码。
●no shutdown:启用接口。
1.4 默认网关配置●ip default-gateway [默认网关地质]:设置默认网关。
2.路由配置命令2.1 静态路由配置●ip route [目标网络] [目标子网掩码] [下一跳地质]:配置静态路由。
2.2 动态路由配置●router rip:进入 RIP 路由配置模式。
●network [网络地质]:启动 RIP 并指定要进行路由的网络地质。
●router ospf [进程号]:进入 OSPF 路由配置模式。
●network [IP 地质] [反掩码] area [区域号]:配置 OSPF。
3.状态和监控命令3.1 接口状态命令●show ip interface brief:显示路由器接口的 IP 地质和状态。
●show interfaces [接口类型] [接口编号]:显示指定接口的详细信息。
●show interfaces status:显示接口的状态和统计信息。
3.2 路由表命令●show ip route:显示路由表信息。
cisco常⽤命令进⼊特权模式Router>enable进⼊配置模式Router#configure terminal特权模式下查看全局配置Router#show running-config⾮特权模式下查看全局配置(+do 在⾮特权模式下使⽤do show查看配置)Router(config)#do show running-config重启Router#reload保存配置Router#write清空配置Router#write erase删除命令Router(config-if)#no ip address修改主机名Router(config)#hostname R1设置进⼊特权模式的密码Router(config)#enable password cisco@123设置远程登录line vty 0 4password cisco@123login //允许登录transport input telnet //允许通过的协议远程登录时查看⽇志信息Router#terminal monitor路由功能Switch(config)#ip routing //开启路由功能Switch(config)#no ip routing //关闭路由功能Switch(config)#ip default-gateway 192.168.1.254 //设置默认⽹关查看MAC地址表Switch#show mac address-table设置全/半双⼯Router(config-if)#duplex full/half路由管理距离(类似Huawei 优先级)Router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.1 ?<1-255> Distance metric for this routeProtocol DistanceDirect 0Static 1Rip 120OSPF 110Eigrp 90(170)CDP协议(思科私有,与LLDP相同)Router#show cdp neighborsVLAN,接⼝Switch(config)#vlan 10,20,30 //同时创建多个vlaninterface Ethernet0/1switchport access vlan 10switchport mode accessinterface Ethernet0/2switchport trunk encapsulation dot1q //配置封装模式(Cisco默认私有模式ISL)switchport trunk native vlan 10 //本征vlan(类似华为pvid)switchport mode trunkswitchport trunk allowed vlan allswitchport trunk allowed vlan 10,20switchport trunk allowed vlan remove 10//不允许某个vlan通过⼦接⼝interface Ethernet0/1.10 //创建⼦接⼝encapsulation dot1Q 10 //封装vlan10ip address 192.168.10.1 255.255.255.0DHCPip dhcp excluded-address 192.168.10.250 192.168.10.254ip dhcp pool dhcp-poolnetwork 192.168.10.0 255.255.255.0default-router 192.168.10.254dns-server 114.114.114.114Switch(config-if)#ip helper-address 192.168.20.254 //dhcp中继Router#show ip dhcp conflict //查看地址冲突Router#clear ip dhcp conflict * //清除dhcp冲突地址Router#show dhcp serverACLRouter(config)#access-list 1 permit 192.168.10.1 0.0.0.0 //基本aclRouter(config)#access-list 100 permit tcp 192.168.10.1 0.0.0.0 eq 80 1.1.1.1 0.0.0.0 eq 8000 //扩展acl//基于名称的acl(可以设置规则序号)Router(config)#ip access-list standard ciaco-aclRouter(config-std-nacl)#11 permit 192.168.1.1 0.0.0.0Router(config-if)#ip access-group 1 in/out //在接⼝上应⽤aclNATinterface Ethernet0/0ip address 192.168.10.1 255.255.255.0ip nat inside //内⽹⼈⼝interface Ethernet0/1ip address 200.1.1.1 255.255.255.0ip nat outside //外⽹出⼝access-list 10 permit 192.168.10.0 0.0.0.255ip nat inside source list 10 interface Ethernet0/1 //nat转换ip nat inside source static tcp 192.168.10.23 23 200.1.1.1 23 //端⼝映射链路聚合Switch(config)#interface range ethernet 0/2 - 3 //创建接⼝组(类似port-group)Switch(config-if-range)#channel-group 12 mode active //创建channel id(两端id不需要相同),设置模式 // shutdown状态下配置,如果不成功更换channel idSwitch#show etherchannel summary //查看命令STPSwitch(config)#spanning-tree mode ?mst Multiple spanning tree mode //多⽣成树(802.1s)pvst Per-Vlan spanning tree mode //传统模式(802.1D)rapid-pvst Per-Vlan rapid spanning tree mode //快速⽣成树(802.1w)Switch(config)#spanning-tree vlan 10 priority 0 //设置优先级VTP(思科私有⽤于vlan同步,只⽤于交换机间的接⼝是trunk⼝){vtp是危险协议,推荐修改为透明模式}Switch(config)#vtp mode ?client Set the device to client mode. //客户端模式(⽤于同步配置,不能创建修改删除vlan) off Set the device to off mode. //关闭server Set the device to server mode. //服务器模式(同步配置,可以创建修改删除vlan) transparent Set the device to transparent mode. //透明模式(推荐配置,不会被同步)vtp domain cisco //创建vtp域名vtp version 2 //修改版本(v1,v2,v3存在版本兼容问题)vtp password cisco@123 //设置认证密码HSRP(思科私有,类似vrrp)interface Ethernet0/1ip address 192.168.1.2 255.255.255.0standby 12 ip 192.168.1.254 //设置虚拟IP(standby id 两端必须⼀致)standby 12 priority 110 //设置优先级(默认100,越⼤越优)standby 12 preempt //开启抢占PPPusername admin password 0 cisco@123 //设置⽤户,密码interface Serial1/0ip address 192.168.10.1 255.255.255.0encapsulation ppp //封装为PPPppp authentication chap/pap //认证模式为chap或papinterface Serial1/0ip address 192.168.10.2 255.255.255.0encapsulation pppppp chap hostname adminppp chap password ciaco@123ppp pap sent-username admin password ciaco@123PPPoEServer:bba-group pppoe Ciscovirtual-template 1interface Ethernet0/1no ip addresspppoe enable group Ciscousername admin password 0 cisco@123ip local pool pppoe-pool 200.1.1.2 200.1.1.10 //创建可分配的地址池interface Virtual-Template1ip address 200.1.1.1 255.255.255.0peer default ip address pool pppoe-poolppp authentication chapClient:interface Ethernet0/1no ip addresspppoe enablepppoe-client dial-pool-number 1interface Dialer1ip address negotiatedip mtu 1492 //1500-ppp头部encapsulation pppip tcp adjust-mss 1452 //1500-(ppp头部+ip头部+tcp头部) dialer pool 1ppp authentication chap callin //启⽤chap验证ppp chap hostname adminppp chap password 0 cisco@123GREinterface Tunnel10ip address 10.1.1.1 255.255.255.0tunnel source 1.1.1.1 //本端公⽹IPtunnel destination 2.2.2.2 //对端公⽹IP。
思科常用配置命令及参数思科cisco公司制造的路由器、交换机和其他设备承载了全球80%的互联网通信,成为了网络应用的成功实践者之一,那么你知道思科常用配置命令及参数有哪些吗?下面是店铺整理的一些关于思科常用配置命令及参数的相关资料,供你参考。
思科常用配置命令及参数:启动接口,分配IP地址:router(config-if)# encapsulation frame-relay [cisco | ietf ]router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ] router(config-if)# bandwidth kilobitsrouter(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 Interfacerouter(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 Portrouter(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 Portrouter(config-if)# ip access-group Access-List-Number [ in | out ]router(config-if)# ^z配置命名ACL:router(config)# ip access-list [ standard | extended ] ACL-Namerouter(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)# ^zrouter(config)# interface Type Portrouter(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 Portrouter(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)# ^zPAP单向认证配置实例:验证方:router-server(config)# username Client password 12345 <--验证方建立数据库-->router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication pap <--选择使用PAP实现PPP认证-->router-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp pap sent-username Client password 12345 <--发送验证信息-->router-client(config-if)# ^zPAP双向认证配置实例:路由器 A:routerA(config)# username B password 12345routerA(config)# interface serial 0routerA(config-if)# encapsulation ppprouterA(config-if)# ppp authentication paprouterA(config-if)# ppp pap sent-username A password 54321routerA(config-if)# ^z路由器 B:routerB(config)# username A password 54321routerB(config)# interface serial 1routerB(config-if)# encapsulation ppprouterB(config-if)# ppp authentication paprouterB(config-if)# ppp pap sent-username B password 12345routerB(config-if)# ^zCHAP单向认证配置实例:验证方:router-server(config)# username router-client password 12345router-server(config)# interface serial 0router-server(config-if)# encapsulation ppprouter-server(config-if)# ppp authentication chaprouter-server(config-if)# ^z被验证方:router-client(config-if)# encapsulation ppprouter-client(config-if)# ppp authentication chaprouter-client(config-if)# ppp chap hostname router-clientrouter-client(config-if)# ppp chap password 12345router-client(config-if)# ^z。
思科路由器命令大全完整版Modified by JEEP on December 26th, 2020.思科交换机路由器命令大全交换机命令: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为例--设置禁用IP地址解析特性,设置启用消息同步特性switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscolabaptech2950(conf)#no ip domain-lookup -----设置禁用IP地址解析特性aptech2950(conf)#logging synchronous -----设置启用消息同步特性aptech2950(conf)#interface range fastethernet0/1-20aptech2950(conf-if-range)#spanning-tree portfast -----设置快速端口aptech2950(conf)#interface range fastethernet 0/23-24aptech2950(conf-if-range)#swichport mode trunk -----设置主干道端口aptech2950(conf)#spanning-tree uplingkfast ---设置阻塞启用迅速(只可以在访问层启用)6:设置虚拟局域网vlan 1 interface vlan 1switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1配置交换机端口ip和子网掩码aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit设置网关地址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、IPV4地址划分(判断网络号,网段)2、交换机、路由器基本知识及配置3、交换机、路由器的Telnet远程登入4、虚拟局域网VLAN的配置5、PPP协议基本配置6、静态路由、缺省路由、RIP、OSPF的基本配置7、Ipconfig、Ping、Telnet等常用命令的应用一、交换机、路由器基本配置1.配置模式切换1.用户模式进入特权模式sw>enableSw#2. 特权模式进入全局配置模式Sw#configure terminalSw(config)#3. 全局配置模式进入接口配置模式Sw(config)#interface fastEthernet 0/1Sw(config-if)#2.路由器端口IP地址的配置Router(config)#interface fastEthernet 0/1 -----进入相应接口(进入F0/1接口)Router (config-if)#no shutdown -----开启端口(路由器默认为关闭)Router (config-if)#ip address 192.168.1.1 255.255.255.0 -----设置IP地址IP地址掩码备注:输入shutdown可关闭对应的端口或(可使用图形界面):(路由器端口默认是关闭,需要把On打钩)3.配置设备名称Switch(config)#hostname SW -----在配置模式输入hostname+名字或:二、交换机、路由器的Telnet远程登入Telnet 默认是开启,需要在设备接口配置可连通的IP地址,路由器在具体的物理接口上配置IP地址,交换机在VLAN上配置IP地址,确保PC机可以连通远程登入的设备(使用PING测试)。
可以连通在做如下操作(1)只配置登入密码Sw(config)#line vty 0 4 ---启用5条线路让5个用户接入,并进入line配置模式Switch(config-line)#password abc ----设置登录密码abcSwitch(config-line)#login ----要求密码登入(只要输入密码)(2)配置登入账号以及密码Sw(config)#username admin password admin ---------配置账号密码Sw(config)#line vty 0 4 ----启用5条线路让5个用户接入,并进入line配置模式Switch(config-line)#login local ----要求本地账号登入(需要输入账号以及密码)(3)无账号密码登入Sw(config)#line vty 0 4 ---启用5条线路让5个用户接入,并进入line配置模式Switch(config-line)#no login ----无账号密码登入注意1:在设置密码后如果无法登入,需要在输入命令login\login local,也就是login\login local需在设置完密码后输入。
思科路由器命令大全完整版一、基本配置命令1、`enable`:进入特权模式。
2、`configure terminal`:进入全局配置模式。
3、`hostname 主机名`:设置路由器的主机名。
4、`interface 接口类型接口编号`:进入指定接口的配置模式,例如`interface ethernet 0/0`。
5、`ip address IP 地址子网掩码`:为接口配置 IP 地址和子网掩码。
6、`no shutdown`:启用接口。
二、路由配置命令1、`ip route 目标网络子网掩码下一跳地址`:添加静态路由。
2、`router ospf 进程号`:启用 OSPF 路由协议,并指定进程号。
3、`network 网络地址反掩码 area 区域号`:在 OSPF 中宣告网络。
三、访问控制列表(ACL)命令1、`accesslist 编号 permit|deny 源地址源掩码目的地址目的掩码协议端口`:创建访问控制列表规则。
2、`ip accessgroup 编号 in|out`:将访问控制列表应用到接口的入站或出站方向。
四、NAT 配置命令1、`ip nat inside source list 访问控制列表编号 interface 外部接口overload`:配置 PAT(端口地址转换)。
2、`interface 接口 ip nat inside`:指定接口为内部接口。
3、`interface 接口 ip nat outside`:指定接口为外部接口。
五、VLAN 配置命令1、`vlan VLAN 号`:创建 VLAN。
2、`name VLAN 名称`:为 VLAN 命名。
3、`interface vlan VLAN 号`:进入 VLAN 接口配置模式。
六、端口镜像命令1、`monitor session 会话号source interface 源接口`:指定源端口。
2、`monitor session 会话号 destination interface 目的接口`:指定目的端口。
思科路由器常用命令大全推荐文章斐讯路由器设置图解热度: h3c路由器配置命令热度: cisco路由器配置命令热度:路由器设置好了上不了网怎么办热度:无线路由器怎么安装到台式电脑上热度:以下是小编向大家分享的思科路由器常用命令大全,希望可以帮到你。
1 #show ?access-expression 显示访问控制表达式access-lists 显示访问控制表apollo Apollo 网络信息appletalk Apple Talk 信息arap 显示Appletalk 远端通道统计arp 地址解析协议表async 访问路由接口的终端行上的信息bridge 前向网络数据库buffers 缓冲池统计clns CLNS网络信息clock 显示系统时钟cmns 连接模式网络服务信息compress 显示压缩状态configuration 非易失性内存的内容controllers 端口控制状态debugging 调试选项状态decnet DEC网络信息dialer 拨号参数和统计dnsix 显示Dnsix/DMPP信息entry 排队终端入口extended 扩展端口信息flash 系统闪烁信息flh-log 闪烁装载帮助日志缓冲区frame-relay 帧中继信息history 显示对话层历史命令hosts IP域名,查找方式,名字服务,主机表interfaces 端口状态和设置ip IP信息ipx Novell IPX信息isis IS-IS路由信息keymap 终端键盘映射lat DEC LAT信息line 终端行信息llc2 IBM LLC2 环路信息lnm IBM 局网管理local-ack 本地认知虚环路memory 内存统计netbios-cache NetBios命名缓冲存贮器内存node 显示已知LAT节点ntp 网络时间协议processes 活动进程统计protocols 活动网络路由协议queue 显示队列内容queueing 显示队列设置registry 功能注册信息rhosts 远程主机文件rif RIF存贮器入口route-map 路由器信息sdlle 显示sdlc-llc2转换信息services 已知LAT服务sessions 远程连接信息smds SMDS信息source-bridge 源网桥参数和统计spanning-tree 跨越树形拓朴stacks 进程堆栈应用standby 热支持协议信息stun STUN状态和设置subsystem 显示子系统tcp TCP连接状态terminal 显示终端设置tn3270 TN3270 设置translate 协议转换信息ttycap 终端容易表users 显示终端行的信息version 系统硬、软件状态vines VINES信息whoami 当前终端行信息x25 X.25信息xns XNS信息xermote Xremote统计2 #config ?Memory 从非易失性内存设置Network 从TFTP网络主机设置Overwrite-network 从TFTP网络主机设置覆盖非易失性内存Terminal 从终端设置3 Configure commads:Access-list 增加一个访问控制域Apollo Apollo全局设置命令appletalk Appletalk 全局设置命令arap Appletalk远程进出协议arp 设置一个静态ARP入口async-bootp 修改系统启动参数autonomous-system 本地所拥有的特殊自治系统成员banner 定义注册显示信息boot 修改系统启动时参数bridge 透明网桥buffers 调整系统缓冲池参数busy-message 定义当连接主机失败时显示信息chat-s cript 定义一个调制解调器对话文本clns 全局CLNS设置子命令clock 设置时间时钟config-register 定义设置寄存器decnet 全局DEC网络设置子命令default-value 缺省字符位值dialer-list 创建一个拨号清单入口dnsix-nat 为审计提供DMDM服务enable 修改优先命令口令end 从设置模式退出exit 从设置模式退出frame-relay 全局帧中继设置命令help 交互帮助系统的描述hostname 设置系统网络名iterface 选择设置的端口ip 全局地址设置子命令ipx Novell/IPX全局设置命令keymap 定义一个新的键盘映射lat DEC本地传输协议line 设置终端行lnm IBM局网管理locaddr-priority-list 在LU地址上建立优先队列4 Exec commands:<1-99>; 恢复一个会话bfe 手工应急模式设置clear 复位功能clock 管理系统时钟configure 进入设置模式connect 打开一个终端copy 从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上debug 调试功能disable 退出优先命令状态disconnect 断开一个网络连接enable 进入优先命令状态erase 擦除快闪内存exit 退出exce模式help 交互帮助系统的描述lat 打开一个本地传输连接lock 锁定终端login 以一个用户名登录logout 退出终端mbranch 向树形下端分支跟踪多路由广播mrbranch 向树形上端分支跟踪反向多路由广播name-connection 给一个存在的网络连接命名no 关闭调试功能pad 打开X.29 PAD连接ping 发送回显信息ppp 开始点到点的连接协议reload 停机并执行冷启动resume 恢复一个活动的网络连接rlogin 打开远程注册连接rsh 执行一个远端命令send 发送信息到另外的终端行setup 运行setup命令show 显示正在运行系统信息slip 开始SLIP协议start-chat 在命令行上执行对话描述systat 显示终端行的信息telnet 远程登录terminal 终端行参数test 测试子系统内存和端口tn3270 打开一个tin3270连接trace 跟踪路由到目的地undebug 退出调试功能verify 验证检查闪烁文件的总数where 显示活动的连接which-route 执行OSI路由表查找并显示结果write 把正在运行的设置写入内存、网络、或终端x3 在PAD上设置X.3参数xremote 进入xremote模式logging 修改注册(设备)信息login-string 定义主机指定的注册字符串map-class 设置静态表类map-list 设置静态表清单menu 定义用户接口菜单mop 设置DEC MOP服务器netbios NETBIOS通道控制过滤no 否定一个命令或改为缺省设置ntp 设置NTPpriority-list 建立特权列表prompt 设置系统提示符queue-list 建立常规队列列表rcmd 远程命令设置命令rcp-enable 打开Rep服务rif 源路由进程router-map 建立路由表或进入路由表命令模式router 打开一个路由进程rsh-enable 打开一个RSH服务sap-priority-list 在SAP或MAC地址上建立一个优先队列service 修改网络基本服务snmp-server 修改SNMP参数state-machine 定义一个TCP分配状态的机器stun STUN全局设置命令tacacs-server 修改TACACS队列参数terminal-queue 终端队列命令tftp-server 为网络装载请求提供TFTP服务tn3270 tn3270设置命令translate 解释全局设置命令username 建立一个用户名及其权限vines VINES全局设置命令x25 X.25 的第三级x29 X.29 命令xns XNS 全局设置命令xremote 设置Xremote5 (config)#ipGlobal IP configuration subcommands:Accounting-list 选择保存IP记帐信息的主机Accounting-threshold 设置记帐入口的最大数accounting-transits 设置通过入口的最大数alias TCP端口的IP地址取别名as-path BGP自治系统路径过滤cache-invalidate-delay 延迟IP路由存贮池的无效classless 跟随无类前向路由规则default-network 标志网络作为缺省网关候选default-gateway 指定缺省网(如果没有路由IP)domain-list 完成无资格主机的域名domain-lookup 打开IP域名服务系统主机转换domain-name 定义缺省域名forward-protocol 控制前向的、物理的、直接的IP广播host 为IP主机表增加一个入口host-routing 打开基于主机的路由(代理ARP和再定向)hp-host 打开HP代理探测服务mobile-host 移动主机数据库multicast-routing 打开前向IPname-server 指定所用名字服务器的地址ospf-name-lookup 把OSPF路由作为DNS名显示pim PIM 全局命令route 建立静态路由routing 打开IP路由security 指定系统安全信息source-route 根据源路由头的选择处理包subnet-zero 允许子网0子网tcp 全局TCP参数以上就是店铺带给大家不一样的精彩。
思科交换机常用命令大全1.1 用户模式与特权模式用户模式:可以使用一些基本的查询命令特权模式:可以对交换机进行相关的配置进入特权模式命令:Switch>enable退出特权模式命令:Switch#exit启用命令查询:?时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求)显示信息命令:Switch#show 可选参数注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数查看交换机配置: Switch#show running-config保存交换机配置:Switch#copy running-config startup-configSwitch#wr查看端口信息:Switch#show interface查看MAC地址表:Switch#show mac-address-table查看交换机CPU的状态信息:Switch#show processes1.2 全局配置模式进入全局配置模式:Switch#configure terminal主机名修改:Switch(config)#hostname 主机名(自选参数)特权模式进入密码: Switch(config)#enable secret 密码(自选参数)取消特权模式密码:Switch(config)#no enable secret取消主机名设置: Switch(config)#no hostname退出配置模式: Switch(config)#exit需要特别注意的是在配置模式中无法使用show命令,如果要使用的话show前必须加do和空格,例如:do show *指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数(VLAN号)root primary例如: Switch(config)#spanning-tree vlan 1 root primary需要注意的是:设置根交换机是基于VLAN的关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN 号)例如: Switch(config)#no spanning-tree vlan 11.3 接口配置模式进入接口配置模式:Switch(config)#interface 端口名称(可选参数)启用端口:Switch(config-if)#no shutdown停用端口:Switch(config-if)#shutdown进入同种类型多端口配置:Switch(config)# interface range fastethernet 0/1-5进入不同类型多端口配置:Switch(config)#interface range fastethernet 0/1-5,gigabitethernet 0/1-2退出接口配置模式:Switch(config-if)#exit1.4 二层端口的配置端口速率: Switch(config-if)#speed 可选参数双工模式: Switch(config-if)#duplex 可选参数禁用链路协商:Switch(config-if)#no negotiation auto 启用链路协商:Switch(config-if)#negotiation auto1.5 VLAN的配置新建VLAN:Switch(config)#vlan 自选参数(VLAN号)Switch(config-vlan)#name自选参数(VLAN名)例如:Switch(config)#vlan 1Switch(config-vlan)#name lab1Switch(config-vlan)#exit删除VLAN: Switch#vlan databaseSwitch(vlan)#no vlan 自选参数(vlan号)例如:Switch#vlan databaseSwitch(vlan)#no vlan 2将一个接口加入VLAN:Switch(config)#interface 可选参数(接口号)Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 自选参数(VLAN号)Switch(config-if)#no shutdownSwitch(config-if)#exit例如:Switch(config)#interface f0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 1Switch(config-if)#no shutdownSwitch(config-if)#exit将一个接口退出VLAN:Switch(config)#interface 可选参数(接口号)Switch(config-if)#no switchport access vlan 自选参数(VLAN号)例如:Switch(config)#interface f0/1Switch(config-if)#no switchport access vlan 2修改一个接口为端口汇聚模式Switch(config)#interface 可选参数(接口号)Switch(config-if)#switchport mode trunkVLAN的验证命令:Switch#show vlan 显示VLAN列表Switch#show interface switchport 查看具体接口的VLAN成员资格信息1.6 VTP的配置VTP Domain Name(VTP域名)Switch#configure terminalSwitch(config)#vtp domain 自选参数例如: Switch(config)#vtp domain Lab_NetworkVTP mode(VTP模式)Switch(config)#vtp mode 可选参数(Server|Client| Transparent)例如: Switch(config)#vtp mode ServerVTP Pruning(VTP修剪)Switch(config)#vtp pruning注意:有的交换机不支持VTP修剪命令查看VTP的配置命令:Switch#show vtp status显示交换机运行的VTP模式,配置修订号和交换机所属的VTP域Switch#show vtp counters显示VTP消息相关的统计数据1.7 远程登录交换机设置配置管理VLAN:Switch(conf)#interface vlan 1Switch(config-if)#ip address x.x.x.x 255.255.255.0Switch(config-if)#no shutdown注意:IP地址必须与远程连接交换机的PC机地址在同一网段在交换机上指定默认网关:Switch(config)#ip default-gateway x.x.x.x注意:指定的默认网关仅当前交换机有效。
1、清除NAT缓存:clear ip nat translation *2、清除交换机上的所有配置:erase nvram/wrie erase------>reload(重启)3、设置路由器telnet管理:en----->conf t------>line vty 0 4------>login------>password cisco4、设置交换机telnet管理:en----->conf t------>interface vlan 1------>no shut------>ip address 192.168.0.253------->enable password cisco 如果想管理其他网段的交换机需设置网关:en----->conf t------>p default-gateway 192.168.0.254 ------->telnet 192.168.1.2535、查看硬件信息:show idb all show version 75系列查看机框序列号:show diag 查看板卡序列号:show rsp chassis-info 7513查看板卡序列号:show diagbus 6509:show module (后可加参数) show idprom (后可参数,可查如风扇、电源等序列号等)6、使日志同步(可取消输入命令时系统自动生成的日志):logging synchronous7、超时设置:A、登陆超时(输入用户名和密码时):timeout login response 20(20秒 B、登陆后无操作超时:exec-timeout 0 0(为永不超时)8、配置SSH: Router(config#ip http server Router(config#ip http secure-server Router(config#ip http authentication local Router(config#username cisco privilege 15 password 0 cisco Router(config#line console 0 Router(config-line#login local Router(config-line#exit Router(config#line vty 0 4 Router(config-line#privilege level 15 Router(config-line#login local Router(config-line#transport input telnet Router(config-line#transport input telnet ssh Router(config-line#^Z Router#conf t Router(config#int f0/0 Router(config-if#ip address 1.1.1.1255.255.255.0 Router(config-if#no shut Router(config-if#do ping 1.1.1.2 !!!!! --------------------------------------------------------------------------------------------------- 打开WEB,输入https://1.1.1.1 进行连接测试 9、配置无线: Router(config#int dotl1radio 0 Router(config-if# ip address 10.1.12.1 255.255.255.0 Router(config-if#no shutRouter(config-if#ssid WIRELESS Router(config-if-ssid#guest-mode Router(config-if-ssid#authentication open Router(config-if-ssid#infrastructure-ssid Router(config-if-ssid#exit Router(config-if#line con 0 Router(config-line#password consoleRouter(config-line#logging sync Router(config-line#exec-timeout 0 0 Router(config-line#exit ......... 10、配置DHCP: Router(config#ip dhcp pool R3WLAN Router(dhcp-config#network 10.11.2.0 255.255.255.0 Router(dhcp-config#default-router 10.11.2.1Router(dhcp-config#exit Router(config#ip dhcp excluded-address 10.11.2.1 11、清除ASA5510的配置:write erase/重新加载:reload 12、思科IOS基本配置 R(config#hostname wildlee——设置思科IOS系统名称 R(config#no ip domain lookup——关闭域名解析功能 Wildlee(config#line console 0—-指定控制线路Wildlee(config#line vty 0 15—–指定虚拟终端访问线路 Wildlee(config-line#exec-timeout 5 0—–指定线路超时时间5分0秒 Wildlee(config-line#password wildlee—–指定console线路的访问密码为wildlee Wildlee(config#enable secret wildlee——设置特权访问密码为wildlee Wildlee(config#service password-encryption——加密明文密码 Wildlee(config#banner motd $this is text$——欢迎广告词 VLAN配置命令 1.创建vlan Wildlee(config#vlan {vlan id}——–给vlan设置ID Wildlee(config-vlan#name {vlan name}———给vlan取名 2.配置中继端口 wildlee(config-if#switchport trunk encapsulation dot1q———-定义中继端口封装模式 wildlee(config-if#switchport mode trunk ————-配置端口为中继端口 3.划分端口 wildlee(config#interface {interface}——-指定要加入vlan的接口 wildlee(config#interface range {interface},{interface}——-将多个不连续端口划分到vlan wildlee(config#interface range {interface 0/1 – 20}———将多个连续的端口划分到vlan wildlee(config-if#speed {10|100|1000}——指定接口速率 wildlee(config-if#duplex {auto|half|full}——-指定双工模式 wildlee(config-if#switchport mode access————将指定接口定义为访问端口 wildlee(config-if#switchport access vlan id———–将指定端口分配到特定vlan wildlee#show mac-address-table ——-查看接口MAC地址列表 wildlee#show mac-address-table aging-time ———-查看交换机MAC地址学习老化时间wildlee(config#mac-address-table aging-time time[s]———修改此时间值 4.给vlan配置IP wildlee(config#interface vlan {vlan id}———指定VLAN号 wildlee(config-vlan#ip address {ip address与 netmask}—–给vlan配置IP地址用于vlan间路由 5.查看配置 wildlee#show interface fastEthernet {interface}———查看指定接口wildlee#show interface fastEthernet {interface} switchport——-查看交换机端口状态及封装模式 wildlee#show ip interface brief———查看接口摘要信息 wildlee#show vlan-switchport——-查看vlan接口配置情况 VTP配置命令 Wildlee(config#vtp domain{vtp name}———配置vtp域名 Wildlee(config#vtp mode {server|client|transparent}——–配置配置vtp工作模式 Wildlee(config#vtp password {vtp password}——-给vtp设置密码 Wildlee(config#vtp pruning ——-启用vtp修剪 Wildlee#show vtp status——查看vtp配置情况 Wildlee#show vtp counters——-显示vtp消息发送与接收情况典型VTP与VLAN配置过程 a.设置VTP DOMAIN(核心、分支交换机上都设置) b.配置中继(核心、分支交换机上都设置) c.创建VLAN(在server上设置) d.将交换机端口划入VLAN e.配置三层交换 STP生成树协议 wildlee(config#spanning-tree vlan {vlan id}——-开启生成树协议 wildlee(config#spanning-tree vlan {vlan id} root primary——-设置为根交换机 wildlee(config#spanning-tree vlan {vlan id} priority {bridge priority}——-设置交换机ID优先级值 wildlee(config-if#spanning-tree vlan {vlan id} cost {cost}———设置交换机端口成本值 wildlee(config-if#spanning-tree vlan {vlan id} port-priority {priority}———设置端口优先级 wildlee#show spanning-tree——-查看生成树信息设定交换机MAC地址老化时间 switch(config#mac-address-table aging-time <10-1000000>--------默认是300秒设定交换机端口/MAC绑定 switch(config#mac-address-table static 0100.5e00.0005 vlan 1 interface f0/1 13、ip unnumbered Loopback0 借用端口IP地址命令“借用IP地址”实际就是:一个接口上没有配置IP地址,但是还想使用该接口。
思科路由器命令大全详解思科路由器命令大全详解本文档旨在提供一份最新最全的思科路由器命令详解,供读者参考使用。
以下为各个章节的详细内容:1、连接管理1.1 连接路由器1.1.1 使用串行接口连接路由器1.1.2 使用以太网接口连接路由器1.2 断开与路由器的连接1.3 查看当前连接状态2、基本配置2.1 配置路由器主机名2.2 设置密码和特权级2.2.1 设置密码2.2.2 设置特权级密码2.3 配置路由器接口2.3.1 配置IP地质2.3.2 配置子网掩码 2.3.3 配置默认网关 2.4 查看路由器配置信息2.5 保存路由器配置3、路由配置3.1 配置静态路由3.2 配置动态路由3.2.1 RIP协议配置 3.2.2 OSPF协议配置 3.2.3 BGP协议配置3.3 查看路由表4、网络地质转换(NAT)配置 4.1 配置静态NAT4.2 配置动态NAT4.3 配置PAT4.4 查看NAT配置信息5、访问控制列表(ACL)配置5.1 配置标准ACL5.2 配置扩展ACL5.3 应用ACL到接口5.4 查看ACL配置6、路由器安全性配置6.1 配置SSH访问6.2 配置Telnet访问 6.3 配置访问类别6.4 配置防火墙6.5 配置AAA认证7、接口配置7.1 配置以太网接口 7.2 配置串行接口7.3 配置VLAN接口 7.4 配置隧道接口附件:本文档附带以下附件:1:思科路由器命令示例图表2:思科路由器配置实例法律名词及注释:1、版权:法律规定的对原创作品的独占使用权。
2、许可证:许可证是通过行政机关的批准,对依法许可的活动设定限制和要求。
3、违约:违反合同中的任何条款或条件的行为或事件。
思科常用命令大全1用户模式2:特权模式enableshow vlanshow versionshow interfaceshow mac-address-tableshow running-configcopy running-config startup-config 3:全局配置模式config terminalhostnameenable passwordip default-gateway4:接口配置模式interface 端口switchport mode trunk5:line模式line console 0第2章交换机的基本配置1.配置主机hostname2.查看交换机的配置show running-config使能口令enable password加密保存的使能口令enable secret配置IP地址interface vlan1ip addressno shutdown配置交换机的网关ip default-gateway ipaddress查看交换机的MAC地址表show mac-address-table使用CDP协议show cdpshow cdp interfaceshow cdp neighborsshow cdp neighbors detailshow cdp traffic保存与删除交换机配置copy running-config startup-config第三章:虚拟局域网(VLAN)VLAN的概述VLAN是对连接在第2层交换机端口的网络用户的逻辑分段。
VLAN的作用:1。
广播控制2。
安全(副产品)3。
带宽利用4。
延迟VLAN的种类静态:基于端口的VLAN动态:基于MAC地址的VLAN在交换机上配置静态VLAN创建VLAN1。
CONFIG TERMINALVLAN 2NAME 22。
特权模式下VLAN DATABASEVLAN 2 NAME 2查看VLANSHOW VLAN删除VLANNO VLAN 2验证:SHOW VLAN BRIEF在VLAN中添加端口INTERFACE F0/2INTERFACE RANGE F0/2 - 5SWITCHPORT MODE ACCESSSWITCHPORT ACCESS VLAN 2VLAN配置实例在交换机上添加VLAN2,VLAN3,VLAN3,端口范围分别为1-4,5-8,9-12这个实例的作用就是让不同的VLAN的计算机之间的通信隔开。