交换机口令设置
交换机口令大全

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中:
神州数码交换机命令

交换机基本状态:hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令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 ;当前端口加入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模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address ;设置IP地址switch(config)#ip default-gateway ;设置默认网关switch#dir Flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息完了最最要的一步。
(完整版)锐捷交换机命令大全

【第一部分】交换机支持的命令: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路由协议。
交换机用户名密码设置

思科交换机密码配置和清除思科交换机密码配置一.设置console密码>enable#configure trminal(confing)#line console 0←console口①(config-line)#password (cisco)←密码(config-line)#login ← (一定不能少的,决定该口令是否起作用).console密码设置完成exit二:设置全局密码enable#configure terminal②(config)#enable secret (class)←密码(config)#login全局密码设置完成exit三.设置远程登入(telnet)密码enable#config terminal(config)#line vty 0 4(0 4是口)③(config-line)#password (class)←密码(config-lline)#loginexit四.保存以上设置>enable#copy running-config strat-config思科交换机密码的破解⒈连接交换机的console口到终端或PC仿真终端。
用无Modem的直连线连接PC的串行口到交换机的console口。
⒉首先得拔掉电源,因为思科交换机上没有开关所以我们只能拔掉电源接下来我们要做的就是按住MODE按钮接着插上电源等端口指示灯灭掉松开⒊初始化flash。
>flash_init⒋更名含有password的配置文件。
>rename flash:config.text flash:config.old⒌启动交换机。
>boot⒍进入特权模式。
>enable⒎此时开机是已忽略password。
#rename flash:config.old flash:config.text⒏copy配置文件到当前系统中。
#copy flash:config.text system:running-config⒐修改口令。
cisco交换机配置口令大全

cisco交换机配置口令大全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 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高速缓存区的内容。
h3c交换机、路由器console和tel密码配置

一、CONSOLE口登陆在AUX用户接口视图下,可以设置CONSOLE用户登陆的口令认证。
有如下三种认证方式None:不需要口令认证Password:需要简单的本地口令认证,包含明文(simple)和密文(cipher)Scheme:通过RADIUS服务器或本地提供用户名和认证口令配置命令如下:<H3C>system-view[H3C]user-interface aux 0[H3C-ui-aux0]authentication-mode password[H3C-ui-aux0]set authenticaton password simple 123456推出重新登陆,交换机提示用户输入访问口令Login authenticationPassword:用户的命令控制级别设置[H3C-ui-aux0]user privilege level 0[H3C]super password level 1 simple 123456[H3C]super password level 2 simple123456[H3C]super password level 3 simple 123456Telnet配置首先配置交换机的管理IP地址[H3C]interface Vlan-interface 1[H3C-vlan-interface1]ip address10.0.0.1255.255.255.0只用密码的用户认证[H3C]user-interface vty 0 4[H3C-ui-vty0-4]authentication-mode password[H3C-ui-vty0-4]set authentication password simple 123456远程用户缺省的级别都是0级,灯笼裤可修改Telnet用户登录后的用户级别[H3C-ui-vty0-4]user privilege level 3本地用户名和口令的认证[H3C]user-interface vty 0 4[H3C-ui-vty0-4]authentication-mode scheme[H3C]local-userH3C[H3C-ui-vty0-4]password simple huawei[H3C-ui-vty0-4]service-type telnet level 3二、H3C路由器配置Console口和TelnetVRP1.74/1.44CONSOLE和TELNET一样的,只要配置了会同时启作用,且只能是用户名和密码的方式。
h3c交换机密码设置
立即重新启动S2700 设备
执行命令reboot,立刻重新启动S2700 设备
.
入用户名“huawei”,密码“huawei”。
登录后,如果用户超过30 分钟未对交换机进行操作,将断开与交换机的连接。
步骤1 交换机上配置VTY0 的优先级为2,验证方式为aaa,断开连接时间为30 分钟。
<Quidway> system-view
[Quidway] user-interface vty0
[Quidway-ui-vty0] user privilege level 2
[Quidway-ui-vty0] authentication-mode aaa
[Quidway-ui-vty0] idle-timeout 30
[Quidway-ui-vty0] quit
步骤2 配置用户名、密码和用户等级。
配置用户通过Password 方式登录交换机示例
组网需求
PC 机的COM 口与交换机的Console 口相连。
配置VTY0 的优先级为2,对从VTY0 登录的用户进行password 验证,用户登录时需要
输入口令“huawei”。
登录后,如果用户超过30 分钟未对交换机进行操作,将断开与交换机的连接。
步骤1 配置VTY0 的优先级为2。
<Quidway> system-view
[Quidway] user-interface vty0
[Quidway-ui-vty0] user privilege level 2
步骤2 配置明文验证和断开连接的时间。
交换机口令周期
交换机口令周期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 的设备而言的,华为的可以跟据手册来查,配置都是差不多的,这里华子就不多写华为的设备了,了解的也不是很多)switch>enable 进入特权模式switch#config terminal 进入全局配置模式switch(config)#hostname 设置交换机的主机名switch(config)#enable secret xxx 设置特权加密口令switch(config)#enable password xxa 设置特权非密口令使用Telnet远程式管理switch(config)#interface vlan 1 进入vlan 1switch(config-if)#ip address 设置IP地址switch(config-if)#ip default-gateway 设置默认网关switch(config)#line vty 0 4 进入虚拟终端switch(config-line)#login 允许登录switch(config-line)#password xx 设置登录口令switch#exit 返回命令控制台口令switch(config)#line console 0 进入控制台口switch(config-line)#login 允许登录switch(config-line)#password xx 设置登录口令switch#exit 返回命令基本接口配置switch(config)#interface f0/1 进入f0/1接口switch(config-if)#duplex full 配置全双工模式switch(config-if)#speed 100 配置速率switch(config-if)#description to ***** 接口描述switch(config)#ip domain-name ***.com 设置或名服务器switch(config)#mac-address-table aging-time 设置mac表超时时间switch#write 保存配置信息switch#copy running-config startup-config 保存当前配置nvramswitch#erase startup-config 清除配置文件交换机VLAN设置:switch#vlan database 进入VLAN设置switch(vlan)#vlan 2 建VLAN 2switch(vlan)#name 名字建VLAN 2的名称switch(vlan)#no vlan 2 删vlan 2注:删除vlan时原属于此vlan的端口处于非激活状态,直到重新分配为止switch(config)#int f0/1 进入端口1switch(config-if)#switchport mode access 当前端口工作莫试switch(config-if)#switchport access vlan 2 当前端口加入vlan 2switch(config-if)#switchport mode trunk 设置为干线switch(config-if)#switchport trunk encapsulation dot1q 设置vlan 中继协议switch(config-if)#no switchport mode 或(switchport mode access)禁用干线switch(config-if)#switchport trunk allowed vlan add 1,2 ;从Trunk中添加vlans switch(config-if)#switchport trunk allowed vlan remove 1,2 ;从Trunk中删除vlans switch(config-if)#switchport trunk pruning vlan remove 1,2 ;从Trunk中关闭局部修剪以太网通道配置switch(config)#interface range fasternet0/1 - 2 将fasternet0/1和0/2 口捆绑(成双不成单)switch(config-if)#channel-group 1 mode on 配置以太通道模式switch(config-if)#port-channel load-balance {dst-mac | src-mac}在链路间实现负载均衡switch#show etherchannel 1 summary 查看通道信息switch#show etherchannel load-balance 查看通道信息vtp配置switch(config)#vtp domain 设置vtp域名switch(config)#vtp password 设置vtp密码switch(config)#vtp mode server 设置vtp服务器模式switch(config)#vtp mode client 设置vtp客户机模式switch(config)#vtp mode transparent 设置vtp 透明模式switch(config)#vtp version 设置vtp版本switch(config)#vtp pruning 启用vtp修解switch(config)#no vtp pruning 关闭vtp修解注:要想从vtp中减少一台交换机只需将该交换机vtp 名更改生成树stp:switch(config)#spanning-tree vlan 启用stp生成树(基于vlan)switch(config)#spanning-tree vlan root primary 指定根交换机(基于vlan)switch(config)#spanning-tree vlan root secondary 指定备用根交换机(基于vlan)switch(config)#spanning-tree vlan priority 指定交换机优先级(基于vlan)switch(config)#no spanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan)switch(config-if)#spanning-tree vlan cost 指定端口成本(起用trunk的端口模式下)switch(config-if)#spanning-tree vlan port-prioty 指定交换机端口优先级(基于vlan)switch(config-if)#spanning-tree portfast 配置速端口(连接终端设备的端口状态)如pc机switch(config)#spanning-tree uplinkfast 配置上行速端口注:在配置上行速端口前要先将基于vlan上的网桥优先级,网桥成本恢复默认值。
特权口令设置
实验三设置交换机特权口令
实验题目:掌握交换机特权模式密码的配置方法
掌握交换机的命令模式
实验目的:掌握交换机的管理特性,学会配置交换机的基本方法,熟悉各种视图及常用命令。
实验步骤:
1、通过Console口连接交换机;
(1)、搭建实验环境
(2)、在仿真软件上登录超级终端
在PC上点击【桌面】——【终端】
(3)进入命令行接口视图
☞在全局配置模式下更改交换机的名字
Switch> (进入特权模式)
Switch # (进入进入全局配置模式)
Switch(config)# (设置交换机名字
xiaohua)
☞在全局配置模式下配置特权模式的密码
xiaohu> (进入特权模式)
xiaohu # (进入进入全局配置模式)
xiaohu (config)# (设置特权模式的明文密码xiaohua123)
xiaohu (config)# (设置特权模式的密文密码xiaohua456)
☞在特权模式下查看当前配置,并截图
xiaohu (config)# (退回到特权模式)
xiaohu # (在特权模式下查看当前运行配置)
☞关掉交换机,查看是否配置还在?
☞保存交换机的当前配置
xiaohu # (保存当前配置)
☞删除配置
xiaohu # (删除配置)
实验总结:
1.
2.。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
交换机口令设置: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路由协议。
router(config-router)#network <netid> ;配置范围,有的支持all。
router(config-router)#negihbor <ip-address> ;点对点帧中继用。
帧中继命令:router(config)# frame-relay switching ;使能帧中继交换router(config-s0)# encapsulation frame-relay ;使能帧中继router(config-s0)# frame-relay intf-type DCE ;DCE端(需要配虚电路)router(config-s0)# frame-relay local-dlci 20 ;配置虚电路号基本访问控制列表:router(config)#access-list <number> permit|deny <source ip> <wild|any> router(config)#interface <interface> ;default: deny anyrouter(config-if)#ip access-group <number> 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 <number> permit|deny icmp <SourceIP wild> <destinationIP wild>[type]access-list <number> permit|deny tcp <SourceIP wild> <destinationIP wild>[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 Stringsrouter(config) # snmp-server community read-community-string ro router(config) # snmp-server community write-community-string rw在交换机上设置 SNMP Community Stringsswitch(config) # snmp-server community read-community-string ro switch(config) # snmp-server community write-community-string rw在路由器上配置日志信息(Syslog Message Logging)router(config) # logging onrouter(config) # logging server-ip-addressrouter(config) # logging trap severity-level路由器恢复出厂设置erase start-config或write erase或erase NVROM。