交换机口令大全

合集下载

交换机常用操作指令华为

交换机常用操作指令华为

华为交换机常用指令一、交换机设备登陆及配置:1、设备登陆配置我中心维护汇聚和热点交换机,交换机类型为5300、2300和GPON,交换机使用secure CRT软件登录;交换机使用之前需要刷机,使用secureCRT配置:协议是serial,端口com12,波特流9600,流控制不配置;刷交换机所需要的信息:在3a模式下用户名和密码;snmp为网络管理协议,配置网管所需的指令,固定不变;telnet配置——远程登陆配置信息;登陆汇聚和热点交换机首先93-5交换机核心交换机,登录协议选择ssh登录,登陆其它交换机在93-5上使用telnet远程登陆命令跳转,只能单向;核心交换机登陆用户名:hanxu69309,密码:Hx9309;华为汇聚和热点交换机的登陆用户名和密码都为huaweitest;其他核心交换机的登录地址:交换机型号为9312交换机型号为6500交换机型号为6500交换机型号为8500交换机型号为8500交换机型号为93062、交换机配置思路:➢配置设备名称;➢管理AP所需要配置的信息➢管理交换机配置的信息➢在3a模式下配置,配置以下用户名和密码;配置固定➢snmp为网络管理协议,下面为加入网管所配置的指令,固定不变;➢telnet配置——远程登陆配置信息3、数据准备:➢管理VLAN的ID;➢交换机的管理IP;➢交换机连接其他交换机的接口号;➢验证方式、用户名和密码;二、5300交换机开站指令1、交换机简介5300系列交换机,包括5328和5324等,不能给AP供电;下面介绍的指令为5328,是5300系列的一种,共有28个端口;532853242、开站指令➢配置设备名称;System 78 C-1G3a2A25GC3YB91dhcp enable 0.0.02F-1G0.0.03a2A25GC3YB91 ➢snmp为网络管理协议,下面为加入网管所配置的指令,固定不变;snmp-agent //snmp为网络管理协议snmp-agent local-engineid 800007DB000FE2D45DF46877 //snmp-agent community read SDm0bile acl 2009snmp-agent community read publiccm0snmp-agent community write privatecm0snmp-agent community read SDJN-2008-Wlan-nms acl 2001snmp-agent sys-info version allsnmp-agent target-ho➢telnet配置——远程登陆配置信息user-interface vty 0 4 //vty虚拟线路authentication-mode aaa //认证模式为3aidle-timeout 15 0 //登陆时间return四、华为GPON开站指令1、交换机简介基于GPON技术的设备基本结构与已有的PON类似,也是由局端的OLT光线路终端,用户端的ONT/ONU光网络终端或称作光网络单元,连接前两种设备由单模光纤SM fiber和无源分光器Splitter组成的ODN光分配网络以及网管系统组成;GPONGPON与其他交换机有些许区别,配置思路如下:a)OLT数据配置步骤:1、设备命名2、创建线路模板第一次开局需要配置,后期只需要使用3、创建VLAN,上行口透传VLAN4、进入GPON单板模式下,添加新发现ONU,下发ONU IP地址5、在config模式下透传ONU 业务VLAN、管理VLANb)ONU数据配置:1、创建VLAN2、上行口透传VLAN3、在端口上添加、透传vlan2、开站指令➢设备命名sysname SD_JN_HuaiYinShuCai_MA5680T //设备命名为SD_JN_HuaiYinShuCai_MA5680T➢创建线路模板第一次开局需要配置,后期只需要使用ont-lineprofile gpon profile-id 1 profile-name "line-profile_1" //创建一个线路模板,刚开局的时候做,以后只引用就行;tcont 1 dba-profile-id 8 //tcont模板1绑定速率模板,8表示速率模板为“最大带宽1000M”gem add 0 eth tcont 1 //gem 0号模板绑定tcont模板1,相当于gem 0号模板绑定了速率模板gem mapping 0 0 vlan 680 //gem 绑定ONU管理VLAN,允许0-7,共8个VLANgem mapping 0 1 vlan 7 //gem 绑定AP管理VLANgem mapping 0 2 vlan 1113 //gem 绑定AP 业务VLANcommit //保存➢创建VLAN,上行口透传VLANvlan 7 smart //创建AP管理VLAN 7vlan 654 smart //创建OLT管理VLAN 654vlan 680 smart //创建ONU管理VLAN680vlan 1113 smart //创建AP业务VLAN1113vlan 3000 smart //创建OLT管理VLAN 3000port vlan 7 0/19 0 //上行口0/19 0表示0框19槽0口,上行口透传AP 管理VLAN7port vlan 654 0/19 0 //上行口透传OLT管理VLAN 654port vlan 1113 0/19 0 //上行口透传AP业务VLAN 1113port vlan 3000 0/19 0 //上行口透传OLT管理VLAN 3000➢进入GPON单板模式下,添加新发现ONU,下发ONU IP地址interface gpon 0/1 //进入GPON单板0/1 0表示0框,1表示1槽位port 0 ont-auto-find enable //打开0端口ONU自动发现功能开局时只做一次就可以port 1 ont-auto-find enable //打开1端口ONU自动发现功能开局时只做一次就可以port 2 ont-auto-find enable //打开2端口ONU自动发现功能开局时只做一次就可以port 3 ont-auto-find enable //打开3端口ONU自动发现功能开局时只做一次就可以port 4 ont-auto-find enable //打开4端口ONU自动发现功能开局时只做一次就可以port 5 ont-auto-find enable //打开5端口ONU自动发现功能开局时只做一次就可以port 6 ont-auto-find enable //打开6端口ONU自动发现功能开局时只做一次就可以port 7 ont-auto-find enable //打开7端口ONU自动发现功能开局时只做一次就可以为0,引用线路模板1;配置ONU的物理地址,SN码等同于MAC;ont ipconfig 1 0 static ip-address vlan 680//为1端口ONTID编号为0的ONU下发IP地址为680service-port 0 vlan 680 gpon 0/1/1 ont 0 gemport 0 multi-service user-vlan 680 tag-transform translate //创建一个VLAN680的服务模板,映射到在gpon 0框1槽位1端口ONTID为0的ONUservice-port 1 vlan 7 gpon 0/1/1 ont 0 gemport 0 multi-service user-vlan 7 tag-transform translate //创建一个VLAN 7的服务模板,映射到在gpon 0框1槽位1端口ONTID为0的ONUservice-port 2 vlan 1113 gpon 0/1/1 ont 0 gemport 0 multi-serviceuser-vlan 1113 tag-transform translate //创建一个VLAN 1113的服务模板,映射到在gpon 0框1槽位1端口ONTID为0的ONUinterface vlanif654 //创建VLAN 654接口interface vlanif680 //创建VLAN 680接口ip //配置ONU管理地址interface vlanif3000 //创建VLAN 3000接口meth routing disableip route-static 0.0.0 //配置VLAN 3000默认路由ip route-static 0.0.0return➢ONU数据配置,创建VLAN,上行口透传VLANtelnet //远程登录ONU地址enableconfigswitch language-mode //当前语言模式已切换到本地语种sysname HuaTaiQiChe_MA5626 //给ONU命名为:HuaTaiQiChe_MA5626vlan 7 smart //创建AP管理VLAN 7vlan 680 smart //创建ONU业务VLAN 680vlan 1113 smart //创建AP业务VLAN 1113port vlan 7 0/0 1 //上行口“0/0 1”表示0框0槽位1端口,在0框0槽1端口透传VLAN 7port vlan 680 0/0 1 //在0框0槽1端口透传VLAN 680 port vlan 1113 0/0 1 //在0框0槽1端口透传VLAN 1113➢在端口上添加、透传VLANservice-port 0 vlan 7 eth 0/1/1 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位1端口 VLAN 模式为untaggedservice-port vlan 7 eth 0/1/2 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6//创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位2端口 VLAN 模式为untaggedservice-port vlan 7 eth 0/1/3 multi-service user-vlan untagged rx-cttrONU 0框1槽位3端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/4 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位4端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/5 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位5端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/6 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位6端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/7 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位7端口 VLAN模式为untaggedservice-port vlan 7 eth 0/1/8 multi-service user-vlan untagged rx-cttr 6 tx-cttr 6 //创建一个VLAN 7的服务模板,映射到在ONU 0框1槽位8端口 VLAN模式为untaggedAP的管理VLAN7;service-port vlan 1113 eth 0/1/1 multi-service user-vlan 1113 rx-cttr 6 tx- cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位1端口 VLAN为透传模式;ONU业务VLAN1113service-port vlan 1113 eth 0/1/2 multi-service user-vlan 1113 rx-cttr到在ONU 0框1槽位2端口 VLAN为透传模式service-port vlan 1113 eth 0/1/3 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位3端口 VLAN为透传模式service-port vlan 1113 eth 0/1/4 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位4端口 VLAN为透传模式service-port vlan 1113 eth 0/1/5 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位5端口 VLAN为透传模式service-port vlan 1113 eth 0/1/6 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位6端口 VLAN为透传模式service-port vlan 1113 eth 0/1/7 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位7端口 VLAN为透传模式service-port vlan 1113 eth 0/1/8 multi-service user-vlan 1113 rx-cttr 6 tx-cttr 6 //创建一个VLAN 1113的服务模板,映射到在ONU 0框1槽位8端口 VLAN为透传模式Save五、常用指令:System //表示进入配置状态display cu //查看交换机上所有的配置Display interface brief //53、33和23的交换机,显示此交换机的端口状态命令;命令用来查看接口状态和配置的简要信息,包括接口的物理状态、协议状态、接收方向最近一段时间的带宽利用率、发送方向最近一段时间的带宽利用率、接收的错误报文数和发送的错误报文数; display interface gigabitethernet 0/0/1 //查看以太网接GigabitEthernet0/0/1的运行状态;//查看交换机是否通,ping管理地址;Display vlan XX //显示透传VLANxx的端口Undo VLAN 2 //去掉VLANdisplay access-user //命令用来按照指定条件查看在线用户会话连接信息;display alarm urgent //命令用来查看S-switch的告警信息;命令将接口加入隔离组后,可执行本命令查看已经加入到隔离组中的接口信息;汇聚交换机不做隔离,热点交换机做隔离;Display arp //显示交换机学来的地址,包括交换机和AP的,23和24是上行口,其他为下行口;display ip interface brief //表示显示接口与IP相关的摘要信息,包括IP地址、子网掩码、物理链路和协议的Up/Down状态;display mac-address //命令用来查看MAC地址表信息,显示的内容包括目的MAC地址、目的设备所属的VLAN、出接口、表项类型和标签交换路径;display alarm urgent //命令用来查看S-switch的告警信息;不指定可选参数时,该命令将显示所有告警记录信息;int GI1/1/1 //进入某端口;Shutdown //进入后,执行shutdown表示关闭;Undo shutdown开启display cpu-usage //命令用来查看CPU占用率的统计信息和配置信息; display device //命令用来查看S-switch设备的CPU型号、内存容量、Flash存储器容量和各槽位所插部件的信息;不指定可选参数时,该命令将显示S-switch设备的CPU型号、内存容量、Flash存储器容量和所有槽位所插部件的信息;display diagnostic-information //命令用来查看并保存系统当前各模块的诊断信息,以便系统出现故障时,一次性将信息收集全,便于问题定位;display environment //命令用来查看S-switch设备的温度信息; display this interface //命令用来查看当前接口视图的接口状态信息; display reboot-info //命令用来查看设备的复位信息;display schedule reboot //命令用来查看S-switch定时重新启动的设置信息;Reboot //命令用来重新启动S-switch设备;该命令功能与S-switch 关闭电源再开启电源的效果相同;在对S-switch进行远程维护时,不需到现场重新启动S-switch,只需执行本命令即可在远程重新启动S-switch;debugging ip icmp //命令用来打开ICMP的调试开关,如果把ICMP 重定向报文发送开关和ICMP主机不可达报文发送开关关闭,则不发送报文;undo debugging ip icmp //命令用来关闭ICMP连接的调试开关;Debugging //命令用来打开调试信息开关;undo debugging //命令用来关闭调试信息开关;缺省情况下,所有的调试信息开关处于关闭状态;在打开调试信息开关后,S-switch将有可能产生大量的调试信息,从而降低S-switch的工作效率;谨慎使用debugging all命令;display debugging //命令用来查看已经打开的调试信息开关;如果不指定可选参数,本命令将显示所有已经打开的调试信息开关;icmp-reply fast //命令用来使能设备ping快回功能;undo icmp-reply fast //命令用来去使能设备ping快回功能;缺省情况下设备ping快回功能使能;设备开启ping快回功能后,设备对收到的目的地址是自己的ICMP Echo报文做快速应答;ping快回功能使能后,设备不能对ICMP报文进行统计;设备使能ping快回功能后,设备没有收到ping发起端的ARP时也能快速应答ICMP Echo报文,但是不能触发设备学习ping发起端的ARP;设备开启ping快回功能后,设备对收到的目的地址是自己的ICMP Echo报文做快速应答;ping快回功能使能后,设备不能对ICMP报文进行统计;设备使能ping快回功能后,设备没有收到ping发起端的ARP时也能快速应答ICMP Echo报文,但是不能触发设备学习ping发起端的ARP;Ping //命令用来检查IP网络连接及主机是否可达;Tracert //命令用来测试数据包从发送主机到目的地所经过的网关;通过执行此命令所显示的内容,可以检查网络连接是否可达,以及分析网络什么地方发生了故障;tracert命令的执行过程:首先发送一个TTL为1的数据包,因此第一跳发送回一个ICMP错误消息以指明此数据包不能被发送因为TTL超时,之后此数据包被重新发送,TTL为2,同样第二跳返回TTL超时,这个过程不断进行,直至到达目的地;执行这些过程的目的是记录每一个ICMP TTL超时消息的源地址,以提供一个IP数据包到达目的地所经历的路径;当用命令测试发现网络出现故障后,可以用tracert测试网络何处有故障;tracert命令的输出信息包括到达目的地所有网关的IP地址,如果某网关超时,则输出“”;。

(完整版)锐捷交换机命令大全

(完整版)锐捷交换机命令大全

【第一部分】交换机支持的命令:1.交换机基本状态:switch: ;ROM状态,路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态2.交换机口令设置: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 ;设置登录口令xxswitch#exit ;返回命令3.交换机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 2 switch(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;设置发vtp域名switch(config)#vtp password;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式4.交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address;设置IP地址switch(config)#ip default-gateway;设置默认网关switch#dir flash: ;查看闪存5.交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息【第二部分】路由器支持的命令:1.路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动2.路由器口令设置: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 ;返回命令3.路由器配置: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 ;设置第二个IProuter(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 ;重新引导4.路由器文件操作: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: flash: ;从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 ;引导IOS5.静态路由:ip route;命令格式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 ;默认路由举例6.动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。

交换机常用配置命令大全

交换机常用配置命令大全

交换机网关-H3C交换机常用配置命令大全一.用户配置<H3C>system-view[H3C]super password H3C 设置用户分级密码[H3C]undo super password 删除用户分级密码[H3C]localuser bigheap 123456 1 Web网管用户设置,1(缺省)为管理级用户,缺省admin,admin[H3C]undo localuser bigheap 删除Web网管用户[H3C]user-interface aux 0 只支持0[H3C-Aux]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟[H3C-Aux]undo idle-timeout 恢复默认值[H3C]user-interface vty 0 只支持0和1[H3C-vty]idle-timeout 2 50 设置超时为2分50秒,若为0则表示不超时,默认为5分钟[H3C-vty]undo idle-timeout 恢复默认值[H3C-vty]set authentication password 123456 设置telnet密码,必须设置[H3C-vty]undo set authentication password 取消密码[H3C]display users 显示用户[H3C]display user-interface 显示用户界面状态二.系统IP配置[H3C]vlan 20[H3C]management-vlan 20[H3C]interface vlan-interface 20 创建并进入管理VLAN[H3C]undo interface vlan-interface 20 删除管理VLAN接口[H3C-Vlan-interface20]ip address 192.168.1.2 255.255.255.0 配置管理VLA N接口静态IP地址(缺省为192.168.0.234)[H3C-Vlan-interface20]undo ip address 删除IP地址[H3C-Vlan-interface20]ip gateway 192.168.1.1 指定缺省网关(默认无网关地址)[H3C-Vlan-interface20]undo ip gateway[H3C-Vlan-interface20]shutdown 关闭接口[H3C-Vlan-interface20]undo shutdown 开启[H3C]display ip 显示管理VLAN接口IP的信息[H3C]display interface vlan-interface 20 查看管理VLAN的接口信息<H3C>debugging ip 开启IP调试功能<H3C>undo debugging ip三.DHCP客户端配置[H3C-Vlan-interface20]ip address dhcp-alloc 管理VLAN接口通过DHCP方式获取IP地址[H3C-Vlan-interface20]undo ip address dhcp-alloc 取消[H3C]display dhcp 显示DHCP客户信息<H3C>debugging dhcp-alloc 开启DHCP调试功能<H3C>undo debugging dhcp-alloc四.端口配置[H3C]interface Ethernet0/3[H3C-Ethernet0/3]shutdown[H3C-Ethernet0/3]speed 100 速率,可为10,100,1000和auto(缺省)[H3C-Ethernet0/3]duplex full 双工,可为half,full和auto(缺省) 光口和汇聚后不能配置[H3C-Ethernet0/3]flow-control 开启流控,默认为关闭[H3C-Ethernet0/3]broadcast-suppression 20 设置抑制广播百分比为20%,可取5,10,20,100,缺省为100,同时组播和未知单播也受此影响[H3C-Ethernet0/3]loopback internal 内环测试[H3C-Ethernet0/3]loopback external 外环测试,需插接自环头,必须为全双工或者自协商模式[H3C-Ethernet0/3]port link-type trunk 设置链路的类型为trunk,可为access (缺省),trunk[H3C-Ethernet0/3]port trunk pvid vlan 20 设置20为该trunk的缺省VLAN,默认为1(trunk线路两端的PVID必须一致)[H3C-Ethernet0/3]port access vlan 20 将当前access端口加入指定的VLAN [H3C-Ethernet0/3]port trunk permit vlan all 允许所有的VLAN通过当前的t runk端口,可多次使用该命令[H3C-Ethernet0/3]mdi auto 设置以太端口为自动监测,normal(缺省)为直通线,a cross为交叉线[H3C]link-aggregation Ethernet 0/1 to Ethernet 0/4 将1-4口加入汇聚组,1为主端口,两端需要同时配置,设置了端口镜像以及端口隔离的端口无法汇聚[H3C]undo link-aggregation Ethernet 0/1 删除该汇聚组[H3C]link-aggregation mode egress 配置端口汇聚模式为根据目的MAC地址进行负荷分担,可选为 in gress,egress和both,缺省为both[H3C]monitor-port Ethernet 0/2 将该端口设置为镜像端口,必须先设置镜像端口,删除时必须先删除被镜像端口,而且它们不能同在一个端口,该端口不能在汇聚组中,设置新镜像端口时,新取代旧,被镜像不变[H3C]mirroring-port Ethernet 0/3 to Ethernet 0/4 both 将端口3和4设置为被镜像端口,both为同时监控接收和发送的报文,inbound表示仅监控接收的报文,outbou nd表示仅监控发送的报文[H3C]display mirror[H3C]display interface Ethernet 0/3<H3C>reset counters 清除所有端口的统计信息[H3C]display link-aggregation Ethernet 0/3 显示端口汇聚信息[H3C-Ethernet0/3]virtual-cable-test 诊断该端口的电路状况五.VLAN配置[H3C]vlan 2[H3C]undo vlan all 删除除缺省VLAN外的所有VLAN,缺省VLAN不能被删除[H3C-vlan2]port Ethernet 0/4 to Ethernet 0/7 将4到7号端口加入到VLAN2中,此命令只能用来加access端口,不能用来增加trunk或者hybrid端口[H3C-vlan2]port-isolate enable 打开VLAN内端口隔离特性,不能二层转发,默认不启用该功能[H3C-Ethernet0/4]port-isolate uplink-port vlan 2 设置4为VLAN2的隔离上行端口,用于转发二层数据,只能配置一个上行端口,若为trunk,则建议允许所有VLAN通过,隔离不能与汇聚同时配置[H3C]display vlan all 显示所有VLAN的详细信息S1550E支持基于端口的VLAN,通过创建不同的user-group来实现,一个端口可以属于多个user-group,不属于同一个user-group的端口不能互相通信,最多支持50个user-group [H3C]user-group 20 创建user-group 20,默认只存在user-group 1[H3C-UserGroup20]port Ethernet 0/4 to Ethernet 0/7 将4到7号端口加入到VLAN20中,初始时都属于user-group 1中[H3C]display user-group 20 显示user-group 20的相关信息六.集群配置S2100只能作为成员交换机加入集群中,加入后系统名改为"集群名_成员编号.原系统名"的格式.即插即用功能通过两个功能实现: 集群管理协议MAC组播地址协商和管理VLAN协商[H3C]cluster enable 启用群集功能,缺省为启用[H3C]cluster 进入群集视图[H3C-cluster]administrator-address H-H-H name switch H-H-H为命令交换机的MAC,加入switch集群[switch_1.H3C-cluster]undo administrator-address 退出集群[H3C]display cluster 显示集群信息[H3C]management-vlan 2 集群报文只能在管理VLAN中转发,同一集群需在同一个管理VLAN中,需在建立集群之前指定管理VLAN<H3C>debugging cluster七.QoS配置QoS配置步骤:设置端口的优先级,设置交换机信任报文的优先级方式,队列调度,端口限速[H3C-Ethernet0/3]priority 7 设置端口优先级为7,默认为0[H3C]priority-trust cos 设置交换机信任报文的优先级方式为cos(802.1p优先级,缺省值),还可以设为dscp方式(dscp优先级方式)[H3C]queue-scheduler hq-wrr 2 4 6 8 设置队列调度算法为HQ-WRR(默认为WR R),权重为2,4,6,8[H3C-Ethernet0/3]line-rate inbound 29 将端口进口速率限制为2Mbps,取1-28时,速率为rate*8*1024/125,即64,128,192...1.792M;29-127时,速率为(rate-27)*1024,即2M,3M,4M...100M,千兆时可继续往下取,128-240时,速率为(rate-115)*8*1024,即104 M,112M,120M...1000M[H3C]display queue-scheduler 显示队列调度模式及参数[H3C]display priority-trust 显示优先级信任模式八.系统管理[H3C]mac-address blackhole H-H-H vlan 1 在VLAN1中添加黑洞MAC[H3C]mac-address static H-H-H interface Ethernet 0/1 vlan 1 在VLAN1中添加端口一的一个mac[H3C]mac-address timer aging 500 设置MAC地址表的老化时间为500s[H3C]display mac-address[H3C]display arp[H3C]mac-address port-binding H-H-H interface Ethernet 0/1 vlan 1 配置端口邦定[H3C]display mac-address port-binding[H3C]display saved-configuration[H3C]display current-configuration<H3C>save[H3C]restore default 恢复交换机出厂默认配置,恢复后需重启才能生效[H3C]display version<H3C>reboot[H3C]display device[H3C]sysname bigheap[H3C]info-center enable 启用系统日志功能,缺省情况下启用[H3C]info-center loghost ip 192.168.0.3 向指定日志主机(只能为UNIX或LI NUX,不能为Windows)输出信息,需先开启日志功能,缺省关闭[H3C]info-center loghost level 8 设置系统日志级别为8,默认为5.级别说明: 1.emergencies 2.alerts 3.critical 4.errors 5.warnings 6.notifications rma tional 8.debugging<H3C>terminal debugging 启用控制台对调试信息的显示,缺省控制台为禁用<H3C>terminal logging 启用控制台对日志信息的显示,缺省控制台为启用<H3C>terminal trapping 启用控制台对告警信息的显示,缺省控制台为启用[H3C]display info-center 显示系统日志的配置和缓冲区记录的信息[H3C]display logbuffer 显示日志缓冲区最近记录的指定数目的日志信息[H3C]display trapbuffer 显示告警缓冲区最近记录的指定数目的日志信息<H3C>reset logbuffer 清除日志缓冲区的信息<H3C>reset trapbuffer 清除告警缓冲区的信息九.网络协议配置NDP即是邻居发现协议,S1550E只能开启或关闭NDP,无法配置,默认有效保留时间为180 s,NDP报文发送的间隔60s[H3C]ndp enable 缺省情况下是开启的[H3C-Ethernet0/3]ndp enable 缺省情况下开启[H3C]display ndp 显示NDP配置信息[H3C]display ndp interface Ethernet 0/1 显示指定端口NDP发现的邻居信息<H3C>debugging ndp interface Ethernet 0/1HABP协议即Huawei Authentication Bypass Protocol,华为鉴权旁路协议,是用来解决当交换机上同时配置了802.1x和HGMPv1/v2时,未经授权和认证的端口上将过滤HGMP报文,从而使管理设备无法管理下挂的交换机的问题。

交换机命令大全

交换机命令大全

交换机配置命令华为,思科,北电,迈普等配置命令各有不同,以下先以思科设备为例: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 1 和网关地址switch> 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 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的密码恢复拔下交换机电源线。

交换机口令设置

交换机口令设置

交换机口令设置: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 ;进入端口1 switch(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路由协议。

交换机口令周期

交换机口令周期

交换机口令周期1、设置控制台密码:(打开交换机进入用户模式的密码)switch (config)#line console 0 (进入0号控制台)switch (config-line)#password 111 (设置控制台密码为111)switch (config-line)#login (开启密码)switch (config-line)#exit2、设置进入特权密码:switch (config)#enable password 111 (设置进入特权模式的明文密码为111)switch (config)#enable secret 111 (设置进入特权模式的加密密码为111) switch (config-line)#exit注:实际上如果Password和Secret同时设定,只需要输入Secret密码即可,Password 密码失效;3、设置Telnet密码:switch (config)#line vty 0 4 (设置0-4(共5个)用户可以进行Telnet登录)switch (config-line)#password 111 (设置Telent远程登录的密码为111) switch (config-line)#login (开启密码)switch (config-line)#exit4、开启加密服务:switch (config)#services password-encryption5、终端空闲5分钟自动Logoutswitch (config)#line vty 0 4 (设置0-4(共5个)用户可以进行Telnet登录)switch (config-line)#exec-timeout 5 0 (设置终端空闲5分钟自动Logout)6、清除类似“*Mar 1 00:10:25.515: %LINK-5-CHANGED: Interface FastEthernet0/0...”的提示:switch (config)#line vty 0 4switch (config-line)#logging synchronous7、密码取消:switch (config)#line console 0 (进入0号控制台)switch (config-line)#no password (设置控制台密码为111)switch (config)#no enable password (取消进入特权模式的明文密码为)switch (config)#no enable secret (取消进入特权模式的加密密码为)switch (config)#line vty 0 4 (设置0-4(共5个)用户可以进行Telnet登录)switch (config-line)#no password (取消Telent远程登录的密码)switch (config-line)#no login (不进行密码检查)8、恢复出厂设置:switch #delete config.text (删除配置文件config.text) switch #reloadswitch #erase startup-confit (清除Flash卡配置文件) switch #reload。

Cisco路由器及交换机口令集合

Cisco路由器及交换机口令集合

Cisco路由器及交换机口令集合交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#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 ;设置登录口令xxswitch#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 2 switch(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 ;设置VTP域名switch(config)#vtp passwordswitch(config)#vtp mode serverswitch(config)#vtp mode client交换机设置IP地址:switch(config)#interface vlan 1 ;进入VLAN 1switch(config-if)#ip address ;添加远程登录IPswitch(config)#ip default-gateway ;添加默认网关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 ;显示路由touter#show cdp nei ;看邻居router#reload ;重新启动设置口令:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#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 ;设置登录口令xxrouter(config)#(Ctrl+z) ;返回特权模式switch#exit ;返回命令配置IP地址:router(config)#int s0/0 ;进行串serail接口router(config-if)#no shutdown ;启动接口router(config-if)#clock rate 6400 ;设置时钟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 secondrouter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip addressrouter(config-subif.1)#encapsulation dot1qrouter(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导复制操作:router#copy running-config starup-config ;存配置router#copy running-config tftp ;上载router#copy startup-config tftprouter#copy tftp flash: ;特权模式下升级IOSrouter#copy tftp startup-config ;下载配置文件到nvram ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置,26 36 45xx rommon>confreg 0x2102 ;使用配置,恢复工作状态rommon>reset ;重新引导,等效于重新开机rommon>copy xmodem: flash ;从console升级IOSIOS:rommon>IP_ADDRESS=10.65.1.2rommon>IP_SUNNET_MASK=255.255.0.0rommon>TFTP_SERVER=10.65.1.1rommon>TFTP_FILE=c2600.binrommon>tftpdnldrommon>dir flash:rommon>boot静态路由:ip toute例:router(config)#ip toute 10.1.0.0 255.255.0.0 10.2.1.1 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路由协议router(config-router)#network ;配置范围,有的支持allrouter(config-router)#negihbor ;点对点帧中继命令:router(config)#frame-relay switching ;使能帧中继交换router(config-s0)#encapsulation frame-relay ;使能帧中继router(config-s0)#frame-relay intf-type DCE ;DCE端(需要配虚电路) touter(config-s0)#farme-relay local-dlci 20 ;配置虚电路号基本访问控制列表:router(config)#access-list permit|denyrouter(config)#interface ;default:deny anyrouter(config-if)#ip access-group in|out ;default:out例:RB(config)#access-list 4 permit 10.8.1.1RB(config)#access-list 4 deny 10.8.1.0 0.0.0.255RB(config)#access-list 4 permit 10.8.0.0 0.0.255.255RB(config)#access-list 4 deny 10.0.0.0 0.255.255.255RB(config)#access-list 4 permit anyRB(config)#int f0/0RB(config-if)#ip access-group 4 in扩展访问列表:access-list permit|deny icmp [port]例1:router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo router(config)#access-list 101 permit ip any anyrouter(config)#int s0/0router(config-if)#ip access-group 101 in例2:router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80 router(config)#access-list 102 permit ip any anyrouter(config)#interface s0/1router(config-if)#ip access-group 102 outrouter(config)#no access-list 102router(config-if)#no ip access-group 101 in在路由器上设置SNMP Community Strings:router(config)#snmp-server community read-community-string rorouter(config)#snmp-server community write-community-string rw在交换机上设置SNMP Community Strings:switch(config)#snmp-server community read-community-strings ro switch(config)#snmp-server community write-community-strings rw在路由器上配置日志信息(Syslog Message logging):router(config)#logging onrouter(config)#logging server-ip-addressrouter(config)#logging trap serverity-level路由器恢复出厂设置erase start-config或write erase或erase NVROM。

迈普交换机常用指令

迈普交换机常用指令

查看POE状态3026G:1.show power inlineS3026G#show power inlinePower Inline Status: OnPower Available: 185 WPower Used: 0 WPower Remaining: 185 WMin V oltage: 44 VMax V oltage: 57 VPolice: OffLegacy: OffDisconnect: AcMode: SignalHW Version: 30SW Version: 05.0.52. show power inline interface [ethernet <interface-number> | <interface-name>]Switch#show power inline interface ethernet1/1-6Interface Status Oper Power(mW) Max(mW) Current(mA) V olt(V)Priority Class------------ ------- ------ --------- ------- -----------Ethernet1/1 enable off 0 15400 0 0 high 0Ethernet1/2 enable off 0 15400 0 0 low 0Ethernet1/3 enable off 0 15400 0 0 low 0Ethernet1/4 enable off 0 15400 0 0 low 0Ethernet1/5 enable off 0 15400 0 0 low 0Ethernet1/6 enable off 0 15400 0 0 low 03、switch# show power fact-power显示结果描述与分析System Total Power : 150.0 W 系统总功率Total Power Allocated : 0.1 W 当前已使用的功率Available power : 149.9 W 剩余可用的功率2. switch# show power pd-status 0/3Power-Over-Ethernet port 0/3 status information:显示结果描述与分析Powered device current : 4.0mA PD的电流Powered device voltage : 46.8V PD的电压Powered device power : 0.1W PD的功率Powered device temperature :45℃POE端口的温度switch>?enable -- Enable Privileged modeexit -- Exit telnet sessionhelp -- helpshow -- Show running system informationswitch>1. 对特权用户配置命令“show interface ethernet 1”,只要输入“sh in e 1”即可。

路由器交换机配置口令大全

路由器交换机配置口令大全

一、路由器配置>Enable 进入特权模式#Ex IT返回上一级操作模式#del flash:config.text 删除配置文件(交换机及1700系列路由器)#erase startup-config 删除配置文件(2500系列路由器)#write memory 或copy running-config startup-config 保存配置#Configure terminal 进入全局配置模式(config)# hostname routerA 配置设备名称为routerA(config)#banner motd & 配置每日提示信息&为终止符(config)# enable secret star 或者:enable password star设置路由器的特权模式密码为star;secret 指密码以非明文显示,password指密码以明文显示查看信息#show running-config 查看当前生效的配置信息#show interface fastethernet 0/3 查看F0/3端口信息#show interface serial 1/2 查看S1/2端口信息#show ip interface brief 查看端口信息#show version 查看版本信息#show running-config 查看当前生效的配置信息#show controllers serial 1/2 查看该端口信息, 用于R2501#show ip route 查看路由表信息#show access-lists 1 查看标准访问控制列表1的配置信息远程登陆(telnet)(config)# line vty 0 4 进入线路0~4的配置模式,4为连续线路最后一位的编号,线路为0~4 (conifg-line)#login(config-line)#password star 配置远程登陆密码为star(config-line)#end 返回上层端口的基本配置(config)#Interface fastethernet 0/3 进入F0/3的端口配置模式(config)#interface range fa 0/1-2 进入F01至F0/2的端口配置模式(config-if)#speed 10 配置端口速率为10M,可选10,100,auto(config-if)#duplex full 配置端口为全双工模式,可选full(全双工),half(半双式),auto(自适应) (config-if)#no shutdown 开启该端口(config)# interface serial 1/2 进入端口S1/2的配置模式(config-if)# ip address 1.1.1.1 255.255.255.0 配置端口IP及掩码(config-if)# clock rate 64000 配置时钟频率(单位为K , 仅用于DCE端)(config-if)# bandwidth 512 配置端口带宽速率为512KB(单位为KB)(config-if)# no shutdown 开启该端口(config-if)#encapsulation PPP 定义封装类型为PPP,可选项:Frame-relay 帧中继Hdlc 高级数据链路控制协议lapb X.25的二层协议PPP PPP点到点协议X25 X.25协议路由协议(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1 配置静态路由注:172.16.1.0 255.255.255.0 为目标网络的网络号及子网掩码172.16.2.1 为下一跳的地址,也可用接口表示,如ip route 172.16.1.0 255.255.255.0 serial 1/2(172.16.2.0所接的端口)(config)# router rip 开启RIP协议进程(config-router)# network 172.16.1.0 申明本设备的直连网段信息(config-router)# version 2 开启RIP V2,可选为version 1(RIPV1)、version 2(RIPV2)(config-router)# no auto-summary 关闭路由信息的自动汇总功能(只有在RIPV2支持)(config)# router ospf 开启OSPF路由协议进程(针对1762,无需使用进程ID)(config)# router ospf 1 开启OSPF路由协议进程(针对2501,需要加OSPF进程ID)(config-router)# network 192.168.1.0 0.0.0.255 area 0申明直连网段信息,并分配区域号(area0为骨干区域)注意:如果是Rip Version1,那么在不连续的子网中,需要为中间网段的两个路由器都配置子接口!!!RA(config)#int serial0RA(config-if)#ip address 172.16.2.1 255.255.255.0 secondaryRB(config)#int serial0RB(config-if)#ip address 172.16.2.2 255.255.255.0 secondaryPAP路由器Ra为被验证方、Rb为验证方;两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:Rb(config)# username Ra password 0 star 验证方配置被验证方的用户名,密码Rb(config)# intterface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation ppp 定义封装类型为PPPRb(config-if)# ppp authentication pap PPP启用PAP认证方式Ra(config)# itnterface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation ppp 定义封装类型为PPPRa(config-if)# ppp pap sent-username Ra password 0 star 设置用户名为ra 密码为star,用于发送到验证方进行验证#debug ppp authentication 可选命令:观察PAP验证过程(如果没看到验证消息,则将端口shutdown,然后再no shutdown,即可看到验证过程的相关信息)CHAP路由器Ra、Rb, 两路由器用V.35线连接(串口线),分别配置各端口的IP及时钟频率后:被验证方配置:Ra(config)# username Rb password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Ra(config)# interface serial 1/2 进入S1/2端口Ra(config-if)# encapsulation PPP 定义封装类型为PPP验证方配置:Rb(config)# username Ra password 0 star 以对方的主机名作为用户名,密码和对方的路由器一致Rb(config)# interface serial 1/2 进入S1/2端口Rb(config-if)# encapsulation PPP 定义封装类型为PPPRb(config-if)# ppp authentication chap PPP启用CHAP方式验证PAP与CHAP的区别:1. PAP:被验证方发送用户名、密码到验证方进行身份验证,所以需要在端口模式下设置Ra(config)#ppp pap sent-username Ra password 0 star;验证方需要定义用户和密码配对数据库记录,所以要定义命令:Rb(config)# username Ra password 0 star2. Chap:CHAP由验证方主动发起挑战,由被验证方应答进行验证(三次握手),所以验证方要配置命令:Rb(config-if)# ppp authentication chap。

交换机路由器命令大全(结合配置实例)

交换机路由器命令大全(结合配置实例)

交换机路由器命令大全(结合配置实例)交换机路由器命令大全(结合配置实例)交换机和路由器是计算机网络中常用的网络设备,用于实现数据包的转发和路由选择。

在实际应用中,我们需要使用命令来配置交换机和路由器的各项参数。

本文将给出交换机和路由器常用命令的大全,并结合实际配置示例进行说明。

一、交换机命令1. 查看交换机基本信息查看交换机型号、固件版本、序列号等基本信息:show version2. 配置交换机端口设置交换机接口的速率、全双工模式等参数:interface interface_namespeed speed_valueduplex {full | half}3. 查看交换机端口状态查看交换机端口的连接状态、速率、工作模式等信息:show interfaces status4. 配置交换机VLAN创建VLAN和端口关联,实现VLAN的隔离和管理:vlan vlan_idname vlan_nameinterface interface_name5. 查看交换机MAC表显示交换机学习到的MAC地址和对应的端口:show mac-address-table6. 配置交换机链路聚合将多个物理端口绑定为一个逻辑端口,提高带宽和冗余性:interface port-channel channel_numberdescription description_textswitchport mode trunk/access7. 交换机Spanning Tree配置配置交换机的Spanning Tree协议参数,避免网络环路:spanning-tree vlan vlan_idpriority priority_value二、路由器命令1. 查看路由表显示路由器的路由表,包括直连路由、静态路由和动态路由表项:show ip route2. 配置静态路由手动配置路由器的静态路由表,指定目的网络和下一跳信息:ip route destination_network subnet_mask next_hop_ip3. 配置路由器接口配置路由器的接口参数,包括IP地址、子网掩码、描述等:interface interface_nameip address ip_address subnet_maskdescription description_text4. 配置路由器OSPF协议配置路由器之间的OSPF动态路由协议,实现网络的动态路由选择:router ospf process_idnetwork network_address wildcard_mask area area_number5. 配置路由器ACL配置路由器的访问控制列表,用于控制数据包的流量:access-list access_list_number permit/deny source destination6. 配置路由器NAT配置路由器的网络地址转换功能,实现内网与外网的互通:interface interface_nameip nat inside/outside三、配置实例1. 配置交换机端口接口GigabitEthernet0/1配置为100Mbps全双工模式:interface GigabitEthernet0/1speed 100duplex full2. 配置交换机VLAN创建VLAN10,将接口GigabitEthernet0/1划分到VLAN10:vlan 10name VLAN10interface GigabitEthernet0/13. 配置路由器接口将接口GigabitEthernet0/0配置为192.168.1.1/24的IP地址:interface GigabitEthernet0/0ip address 192.168.1.1 255.255.255.0description LAN interface4. 配置静态路由配置路由器的静态路由表,将目的网络192.168.2.0/24指向下一跳192.168.1.2:ip route 192.168.2.0 255.255.255.0 192.168.1.25. 配置路由器ACL设置访问控制列表,允许源IP地址为192.168.1.0/24的流量通过:access-list 1 permit 192.168.1.0 0.0.0.2556. 配置路由器NAT设置路由器的NAT,将内部接口GigabitEthernet0/1地址转换为公网地址:interface GigabitEthernet0/1ip nat inside以上是交换机和路由器常用命令的大全以及配置实例。

交换机英文的常用大全

交换机英文的常用大全

交换机命令大全1.在基于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-addressswitch(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)# description description-string基于CLI的交换机的端口描述:switch(enable)set port name module/number description-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-range mode{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-rate pkts-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-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-address ATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-address ATM(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. 口令和设备名设置添加一个交换机或一个路由器,先对交换机进行操作,双击SwitchAswitch>en ;第一次密码为空switch#conf t ;进入全局配置模式switch(config)#hostname swa ;设置交换机名swa(config)#enable secret aaa ;设置特权加密口令为aaaswa(config)#enable password aax ;设置特权非密口令为aaxswa(config)#line console 0 ;进入控制台口(Rs232)swa(config-line)#login ;登录要求口令验证swa(config-line)#password aa ;设置登录口令aaswa(config-line)#line vty 0 4 ;进入虚拟终端virtual ttyswa(config-line)#login ;登录要求口令验证swa(config-line)#password a ;设置登录口令aswa(config-line)#exit ;返回上一层swa(config)#exit ;返回上一层swa#sh run ;看配置信息swa#exit ;返回命令swa>enpassword: ;请问输入哪个口(aaa)secret是设置加密口令,现在一般的设置都使用这种口令设置方式,它比非加密口令优先级高,即没设置secret口令时,非加密口令才有效。

双击ROA对路由器进行与交换机类似的设置。

2. 清除口令清除交换机口令,实际中是在开机时按住交换机上的mode按钮,在模拟软件中按Ctrl+Break口令请除。

清除路由器口令,实际中是在上电时,按Ctrl+Break。

在软件模拟中双击RouterA进入终端模式,再按Ctrl+Break进入rommon>状态,操作如下:(1) 先设置路由的特权口令router>en ;第一次密码为空router#conf t ;进入全局配置模式router(config)#enable secret aaa ;设置特权加密口令为aaa router(config)#end ;返回特权状态router#exitrouter>enpassword:aaarouter#(2) 清除路由器的口令这个操作是在假设口令丢失的情况下使用的方法,具体的操作是启动时按Ctrl+Break进入rommon> 状态,打开寄存器配置开关。

H3C交换机命令大全

H3C交换机命令大全

H3C交换机命令大全用户视图<H3C>************************************************************************************** *****systen*view系统视图************************************************************************************** *****[H3C]?[H3C]super password 修改super密码[H3C]sysname 交换机命名[H3C]interface ethernet 0/1 进入接口视图[H3C]quit 退出系统视图[H3C]info*center console channel console 信息输出设置[H3C]monitor*port ethernet 0/1 配置端口镜像配置端口************************************************************************************** *****[H3C*Ethernet0/1]duplex {half|full|auto} 配置端口双工工作状态[H3C*Ethernet0/1]speed {10|100|auto} 配置端口工作速率[H3C*Ethernet0/1]flow*control 配置端口流控(防止拥塞丢包)[H3C*Ethernet0/1]mdi {across|auto|normal} 配置端口MDI/MDIX状态[H3C*Ethernet0/1]shutdown/undo shutdown 关闭/打开接口VLAN基本配置************************************************************************************** *****[H3C]vlan 3 创建/删除一个VLAN/进入VLAN配置视图[H3C]undo vlan 3[H3C*vlan3]port ethernet0/1 to ethernet0/4 给VLAN增加/删除以太网接口[H3C*Ethernet0/2]port access vlan 3 将端口加入到指定VLAN[H3C*Ethernet0/2]port link*type {trunk|access|hybrid} 设置端口工作模式[H3C*Ethernet0/2]port trunk permit vlan {ID|All} 设置trunk端口允许通过的VLAN [H3C*Ethernet0/2]port trunk pvid vlan 3 设置trunk端口的PVID************************************************************************************** *****交换机端口的3种工作模式:Access模式:不支持802.1q帧的传送Hybird模式:允许多个vlan的报文发送时不打标签Trunk 模式:只允许缺省vlan的报文发送时不打标签若trunk端口上收到了非802.1q帧时,交换机会给该帧加上802.1q的标志字段,该标志字段中的VLAN ID即该端口的PVID,使用port trunk pvid vlan vlan*id 配置端口的PVID配置端口聚合************************************************************************************** *****端口聚合,也称为端口汇聚或端口干路,是将多个端口聚合在一起,实现对出/入流量在各成员端口间进行分担的一种技术,解决上行链路的瓶颈问题,完成所有接入端口流量总和的传输。

交换机命令大全

交换机命令大全

2960>‎e n ;第‎一次密码为‎空29‎60h#c‎o nf t‎;进入全‎局配置模式‎296‎0(con‎f ig)#‎h ostn‎a me s‎w a ;设‎置交换机名‎296‎0(con‎f ig)#‎e nabl‎e sec‎r et a‎a a ;设‎置特权加密‎口令为 a‎a a2‎960(c‎o nfig‎)#ena‎b le p‎a sswo‎r d aa‎x;设置‎特权非密口‎令为 aa‎x29‎60(co‎n fig)‎#line‎cons‎o le 0‎;进入控‎制台口(R‎s232)‎296‎0(con‎f ig-l‎i ne)#‎p assw‎o rd a‎a;设置‎登录口令a‎a29‎60(co‎n fig-‎l ine)‎#logi‎n;登录‎要求口令验‎证29‎60(co‎n fig-‎l ine)‎#line‎vty ‎0 4 ;‎进入虚拟终‎端virt‎u al t‎t y2‎960(c‎o nfig‎-line‎)#pas‎s word‎a ;设‎置登录口令‎a29‎60(co‎n fig-‎l ine)‎#logi‎n;登录‎要求口令验‎证29‎60(co‎n fig-‎l ine)‎#exit‎;返回上‎一层2‎960(c‎o nfig‎)#exi‎t;返回‎上一层‎2960#‎s h ru‎n;看配‎置信息‎2960#‎e xit ‎;返回命令‎配置V‎l an新‎建一个Vl‎a n的命令‎Swit‎c h>en‎a ble ‎进‎入特权模式‎Swi‎t ch#c‎o nfig‎u re t‎e rmin‎a l ‎进入‎全局配置模‎式Sw‎i tch ‎(conf‎i g)# ‎v lan ‎v lan-‎i d ‎创建一‎个Vlan‎或者进入V‎l an配置‎模式S‎w itch‎(con‎f ig-v‎l an)#‎name‎vlan‎-name‎给Vla‎n命名(取‎消设置:n‎o nam‎e)S‎w itch‎(con‎f ig-v‎l an)#‎mtu ‎m tu-s‎i ze 设‎置最大通讯‎量(取消设‎置:no ‎m tu) ‎Swit‎c h (c‎o nfig‎-vlan‎)#rem‎o te-s‎p an ‎开启远‎程流量监控‎(关闭:n‎o rem‎o te-s‎p an) ‎Swit‎c h (c‎o nfig‎-vlan‎)# en‎d回到特‎权模式‎S witc‎h#sho‎w vla‎n‎‎查看当前配‎置Sw‎i tch#‎c opy ‎r unni‎n g-co‎n fig ‎s tart‎u p co‎n fig ‎保存配置‎删除Vl‎a n的命令‎Swit‎c h>en‎a ble ‎进‎入特权模式‎Swi‎t ch#c‎o nfig‎u re t‎e rmin‎a l ‎进入‎全局配置模‎式Sw‎i tch ‎(conf‎i g)# ‎n o vl‎a n vl‎a n-id‎‎删除V‎l an‎S witc‎h (co‎n fig)‎# end‎回到特权‎模式S‎w itch‎#show‎vlan‎brie‎f‎查看删除情‎况Sw‎i tch#‎c opy ‎r unni‎n g-co‎n fig ‎s tart‎u p co‎n fig ‎保存配置‎端口加入‎特定Vla‎n的命令‎S witc‎h>ena‎b le ‎进入‎特权模式‎Swit‎c h#co‎n figu‎r e te‎r mina‎l‎进入全‎局配置模式‎Swi‎t ch (‎c onfi‎g)# i‎n terf‎a ce i‎n terf‎a ce-i‎d‎进入端口配‎置Sw‎i tch ‎(conf‎i g-if‎)# sw‎i tchp‎o rt m‎o de a‎c cess‎‎将接口的模‎式设为访问‎模式S‎w itch‎(con‎f ig-i‎f)# s‎w itch‎p ort ‎a cces‎s vla‎n vla‎n-id ‎将端口加入‎指定的Vl‎a n(恢复‎端口默认配‎置:def‎a ult ‎i nter‎f ace ‎i nter‎f ace-‎i d)‎S witc‎h (co‎n fig-‎i f)# ‎e nd ‎‎回到特权模‎式Sw‎i tch#‎s how ‎r unni‎n g-co‎n fig ‎i nter‎f ace ‎i nter‎f ace-‎i d ‎查看端‎口模式‎S witc‎h#sho‎w int‎e rfac‎e s in‎t erfa‎c e-id‎swit‎c hpor‎t查看端‎口详细配置‎Swi‎t ch#c‎o py r‎u nnin‎g-con‎f ig s‎t artu‎p-con‎f ig 保‎存配置‎批量端口加‎入特定Vl‎a n的命令‎int ‎r ange‎fa0/‎1 - 1‎0sw‎i tchp‎o rt ‎acce‎s s ‎V Lan ‎ V2‎将特定端‎口设为tr‎u nk2‎960-0‎1(con‎f ig)#‎d efau‎l t in‎t erfa‎c e fa‎s tEth‎e rnet‎0/1 ‎端口‎恢复默认值‎‎2960‎-01(c‎o nfig‎)#int‎e rfac‎e fas‎t ethe‎r net0‎/1 ‎‎进‎入端口模式‎2960‎-01(c‎o nfig‎-if)#‎s witc‎h port‎mode‎trun‎k‎‎设置端‎口为tru‎n k模式‎2960-‎01(co‎n fig-‎i f)#s‎w itch‎p ort ‎n oneg‎o tiat‎e‎‎将接口设‎置为不协商‎模式29‎60-01‎(conf‎i g-if‎)end‎2960-‎01#wr‎启用s‎n mp‎S witc‎h>ena‎b le ‎进入‎特权模式‎Swit‎c h#co‎n figu‎r e te‎r mina‎l‎进入全‎局配置模式‎Swi‎t ch (‎c onfi‎g)# s‎n mp-s‎e rver‎comm‎u nity‎stri‎n g [v‎i ew v‎i ew-n‎a me] ‎[ro |‎rw] ‎[acce‎s s-li‎s t-nu‎m ber]‎(关‎闭snmp‎: no ‎s nmp-‎s erve‎r)(‎删除团体字‎符: no‎snmp‎-serv‎e r co‎m muni‎t y st‎r ing)‎配‎置snmp‎团体字符并‎开启snm‎p 代理服务‎Str‎i ng: ‎团体口令字‎符(所有S‎N MP命令‎中只有设置‎团体口令的‎s nmp-‎s erve‎rcom‎m unit‎y是必须的‎,其它的都‎是可选的.‎)Vi‎e w: v‎i ew 可‎以用于限定‎哪些MIB‎分支不能用‎本comm‎u nity‎-stri‎n g存取预‎先用snm‎p-ser‎v er v‎i ew定义‎ro ‎| rw:‎ro获得‎M IB对象‎信息;rw‎获得并可以‎修改MIB‎对象信息‎acce‎s s-li‎s t-nu‎m ber:‎访问列表号‎Swi‎t ch (‎c onfi‎g)#ac‎c ess-‎l ist ‎a cces‎s-lis‎t-num‎b er {‎d eny ‎|pe‎r mit}‎sour‎c e [s‎o urce‎-wild‎c ard]‎‎配置拒绝或‎者允许访问‎s nmp代‎理服务的I‎P地址,访‎问列表号为‎上一步指定‎的列表号‎Swit‎c h (c‎o nfig‎)#end‎回‎到特权模式‎Swi‎t ch#s‎h ow r‎u nnin‎g-con‎f ig 查‎看配置‎S witc‎h#cop‎y run‎n ing-‎c onfi‎g sta‎r tup-‎c onfi‎g保存配‎置ci‎s co29‎60口令恢‎复交换机‎口令恢复的‎步骤⒈‎串口线连接‎到到交换机‎的cons‎o le口。

交换机口令和主机名设置

交换机口令和主机名设置

交换机口令和主机名设置1. 口令和设备名设置添加一个交换机或一个路由器,先对交换机进行操作,双击SwitchAswitch>en ;第一次密码为空switch#conf t ;进入全局配置模式switch(config)#hostname swa ;设置交换机名swa(config)#enable secret aaa ;设置特权加密口令为aaaswa(config)#enable password aax ;设置特权非密口令为aaxswa(config)#line console 0 ;进入控制台口(Rs232)swa(config-line)#login ;登录要求口令验证swa(config-line)#password aa ;设置登录口令aaswa(config-line)#line vty 0 4 ;进入虚拟终端virtual ttyswa(config-line)#login ;登录要求口令验证swa(config-line)#password a ;设置登录口令aswa(config-line)#exit ;返回上一层swa(config)#exit ;返回上一层swa#sh run ;看配置信息swa#exit ;返回命令swa>enpassword: ;请问输入哪个口(aaa)secret是设置加密口令,现在一般的设置都使用这种口令设置方式,它比非加密口令优先级高,即没设置secret口令时,非加密口令才有效。

双击ROA对路由器进行与交换机类似的设置。

2. 清除口令清除交换机口令,实际中是在开机时按住交换机上的mode按钮,在模拟软件中按Ctrl+Break口令请除。

清除路由器口令,实际中是在上电时,按Ctrl+Break。

在软件模拟中双击RouterA进入终端模式,再按Ctrl+Break进入rommon>状态,操作如下:(1) 先设置路由的特权口令router>en ;第一次密码为空router#conf t ;进入全局配置模式router(config)#enable secret aaa ;设置特权加密口令为aaarouter(config)#end ;返回特权状态router#exitrouter>enpassword:aaarouter#(2) 清除路由器的口令这个操作是在假设口令丢失的情况下使用的方法,具体的操作是启动时按Ctrl+Break进入rommon> 状态,打开寄存器配置开关。

交换机配置口令

交换机配置口令

Switch> --用户模式提示符Switch> enable --进入交换机配置模式Switch#vlan database --进入到交换机vlan数据库配置模式Switch(vlan)#vlan 2 name vlan2 --添加一个VLAN 2并命名为vlan2Switch# copy startup running --重新从NVRAM加载配置到内存Switch# copy tftp run --从tftp服务器上加载配置到内存Switch# copy tftp start --从tftp服务器复制配置到NVRAM Switch# copy run tftp --把内存的配置保存到tftp服务器上Switch# copy start tftp --把NVRAM中的配置备份到tftp服务器上Switch# config terminal --进入全局配置模式Switch(config)# enable password cisco --设置密码为ciscoSwitch(config)# enable secret cisco2005--设置交换机加密口令为cisco2005Switch(config)#hostname SW1 --设置交换机名称为SW1Switch(config)#end --返回特权模式Switch(config)#exit --返回上一次配置Switch#disable --返回用户模式Switch(config)#ip address 192.168.1.2 255.255.255.0 --设置交换机IP地址Switch(config)#ip default-gateway 192.168.1.1 --设置默认网关Switch(config)#ip domain-name --设置域名Switch(config)#ip name-server 192.168.10.10 --设置域名服务器IP 地址Switch#show ip --查看IP配置Switch#show fastethernet 0/24 查看24端口的配置情况Switch(config)#interface 端口类型槽位号/端口号--配置交换机端口如:Switch(config)#interface g1/1 g表示的是吉比特端口即1000MSwitch(config-if)#duplex {auto | full | full-flow-control | half} --配置交换机模式auto表示自动协商full表示全双工full-flow-control表示带流量控制的全双工half表示半双工Switch(config-if)#speed {10|100|1000|auto} --强制设置交换机的速率Switch(config-if)#shutdown --关闭某端口Switch(config-if)#no shutdown --开启某个端口Switch(config-if)#switchport mode access --设置某个端口为access 端口Switch(config-if)#switchport access vlan vlan-id 把某个端口分配给某个局域网Switch(config-if)#switchport multi vlan add vlan-list为某个端口指定vlan-listSwitch(config-if)#switchport mode {dynamic {auto|desirable}|trunk} --配置trunk模式(dynamic auto--自动协商是否成为trunk,dynamic desirable—如果对方端口是trunk,desirable或自动模式,把端口设置为trunk,trunk—设置端口为强制的trunk方式,而不理会对方端口是否为trunk)Switch(config-if)#switchport trunk encapsulation {isl | dot1q} --指定数据帧的封装形式,其中isl是Cisco专用的VLAN封装形式,DOT1Q 是IEEE制定的国际标准Switch(config-if)#switchport trunk allowed vlan {add vlan-list |all|except vlan-list} --定义trunk允许的VLAN,all表示所有,except表示除此之外都允许Switch(vlan)#vlan vlan-id mtu mtu-size修改mtu大小Switch(vlan)#vtp mode {server|client|transparent} --配置交换机的VTP工作模式Switch(vlan)#vtp domain domain-name --配置VTP的域名Switch(vlan)#vtp password password-string 为VTP域设置口令Switch(vlan)#vtp pruning 启用VTP修剪功能,使用no关键字停止修剪功能Switch(vlan)#vtp version {1|2} --选择VTP的版本Switch#show vtp status --验证VTP配置Switch#copy run start --保存配置Switch(config-if)#spanning-tree vlan 8 port-priority 10 –将端口权值10并付给vlan 8Switch(config-if)#spanning-tree vlan 8 cost 30 --设置vlan8生成树路径值为30示例:配置VTPVTP服务器的配置:Switch>enableSwitch#vlan databaseSwitch(vlan)#vtp domain zhangSwitch(vlan)#vtp serverSwitch(vlan)#vlan 2 name vlan2 Switch(vlan)#exitSwitch#config tSwitch(config)#int f 0/24Switch(config-if)#switchport mode trunk Switch(config-if)#endVTP客户机的配置:Switch>enableSwitch#vlan databaseSwitch(vlan)#vtp domain zhangSwitch(vlan)#vtp clientSwitch(vlan)#exit。

CSCIO交换机口令大全

CSCIO交换机口令大全

1.在基于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)# description description-string基于CLI的交换机的端口描述:switch(enable)set port name module/number description-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-list switch(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 [costcost][vlan-list]16.在基于IOS的交换机上调整端口ID:switch(config-if)# spanning-tree[vlan vlan-list]port-priorityport-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 seconds switch(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}[rateupdate-rate] [all-protocols off|on]20. 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个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 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-addressles1-nsap-addressATM(lane-config-databade)# name elan2-name server-atm-addressles2-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 multipoint router(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipoint router(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. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

3. 使能口令:Switch(config)#enable Password 密码
4. 加密保存的使能口令:Switch(config)#enable secret 密码
5. 配置IP地址:
Switch(config)#interface vlan 1
Switch(config-if)#ip address IP地址 网关
switch:
(4)再switch:后执行flash_init命令。
(5)查看Flash中的文件。
(6)把config.text文件改名为config.old文件。
(7)执行boot命令,启动交换机。
(8)进入特权模式查看flash里的文件。
(9)把文件config.old改为config.text文件。
一、模式命令:
1. 用户模式:Switch>
2. 特权模式:Switch>enable
Switch#
3. 全局配置模式:Switch#config terminal
Switch(config)#
4. 接口配置模式:Switch(config)#interface fastethernet0/1
3. 在vlan中添加端口:
Switch#config terminal
Switch(config)#interface f0/1(端口)
Switch(config-if)#Switchport mode access
Switch(config-if)#switchport access vlan 2
Switch(config-if)#end
一次将多个端口添加到vlan中:
Switch#config terminal
Switch(config)#interface range f0/1 - 5(端口)
Switch(config-if)#switchport access vlan 2
(10)把config.text复制为系统的running-config.
(11)进入配置模式重新设置密码并存盘,密码恢复完成。
2. 配置接口为动态协商模式的命令:
Switch(config)# interface f0/1(端口)
Switch(config-if)#switchport mode dynamic desirable/auto
3. 从trunk中删除vlan:
Switch(config)# interface f0/1(端口)
-----------------------------------------------------------
Catalyst 2950交换机密码恢复
(1)拔下交换机的电源。
(2)用手按再交换机的MODE按键上,插上电源线。
(3)看到控制台出现如下提示,松开MODE建。
1. 配置主机名:Switch(config)#hostname Sw1
Sw1(config)#
2、 设置登陆台密码:Switch(config)#line console 0
Switch(config-line)#password 密码
Switch(config-line)#login
Switch(config-if)#Switchport trunk allowed vlan remove 2
4. 在trunk中添加vlan:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport trunk allowed vlan add 2
3. 保存机配置:
Switch#copy running-config startup-config或者Switch#write
Hale Waihona Puke 4. 恢复交换机出厂值:
Switch#erase startup-config
Switch#reload
三、全局配置模式下的命令:
Switch(config-if)#no shutdown
6. 配置交换机网关:Switch(config)#ip default-gateway 网关
四、VLAN配置命令:
1. 创建vlan命令:
a) 全局配置模式下:
Switch(config)#vlan 2
Switch(config-if)#
5. Line模式:Switch(config)#line console 0
Switch(config-line)#
二、特权模式下的命令:
1. 查看机MAC地址:Switch#show mac-address-table
Switch(config)#name v2
Switch(config)#mtu 数值
Switch(config)#end
b) Vlan数据库下:
Switch#vlan database
Switch#vlan 2 name v2
Switch#vlan 2 mut 数值
Switch#exit
2. 删除vlan命令:
a) 全局配置模式下:
Switch(config)#no vlan 2
Switch(config)#end
b) Vlan数据库下:
Switch#no vlan 2 name v2
Switch#exit
Switch(config-if)#end
注:switch#show vlan biref(查看vlan信息)
4. 配置vlan trunk:
1. 配置接口为trunk命令:
Switch(config)# interface f0/1(端口)
Switch(config-if)#Switchport mode trunk
2. 发现(CDP):
Switch#show cdp
Switch#show cdp interface fastethernet0/1
Switch#show cdp neighbors
Switch#show cdp neighbors detail
Switch#show cdp entry
相关文档
最新文档