思科模拟器基本命令(交换机)
思科模拟器基本操作hao

三层交换机基日常本操作和维护1、设置系统名称ZXR10>-----普通用户模式ZXR10#------特权模式ZXR10(config)#--------全局模式ZXR10(config)#interface fastethernet 0/1 //进入交换机fei_0/1口 ZXR10(config-if)#-------------子接口模式ZXR10>enable //进入特权模式ZXR10#configure terminal //进入全局配置模式ZXR10(config)#hostname ZTE //对系统性命名为ZTEZTE(config) #exit //退出用exit命令2、设置系统日期和时间ZXR10#clock set 15:52:35 apr 18 2011 //特权模式下验证方法:-----注:思科模拟器上没有月份显示,用???代替ZXR10#show clock-------显示设备当前的系统时间3、设置设备特权模式密码ZXR10(config)#enable secret zte //密文enable密码ZXR10(config)#enable password zte //明文验证方法:ZXR10(config)#exitZXR10#exit按回车键ZXR10>输入enablePassword:输入你的enable 密码。
4、设置登录标志banner motd c //Set Message of the Day bannerEnter TEXT message. End with the character 'c'.Hello world!!c)验证:ZXR10(config)#exitZXR10#exit按回车键出现:Hello world!!--------欢迎语ZXR10>5、设置telnet登陆模拟器交换路由设备拓扑图switch(config-line)可以设置通过console端口连接设备及Telnet 远程登录时所需的密码;1.switch>enable ;进入特权模式2.switch#config terminal ;进入全局配置模式3.switch(config)#hostname ZTE ;设置交换机的主机名4.ZTE(config)#enable secret ZTE;设置特权加密口令5.ZTE (config)#enable password ZTE1 ;设置特权非密口令6.ZTE (config)#line console 0 ;进入控制台口7.ZTE(config-line)#password zte设置控制台登录口令8.ZTE(config-line)#login 控制台允许登录9.ZTE (config)#line vty 0 4 ;进入虚拟终端10.ZTE (config-line)#password ZTE ;设置虚拟终端登录口令11.ZTE (config-line)#login ;虚拟终端允许登录12.ZTE#exit ;返回命令13.设置端口IP地址ZTE (config)#interface fastethernet 0/0ZTE (config)#no shutdownZTE (config-if)#ip add 1.1.1.1 255.0.0.014.电脑IP设置:15.telnet登录模拟器设备6、显示当前运行配置文件ZXR10# show running-config7、保存配置文件ZXR10#write8、显示启动配置文件ZXR10# show startup-configZXR10(config)#do show startup-config9、要查看交换机的日志,可执行如下操作:ZXR10#show logging //显示连接登录用户信息10、备份和恢复配置文件拓扑图:思科语句:Router#copy running-config tftp:Address or name of remote host []? 192.168.1.2Destination filename [router-confg]? 111.txt将系统FLASH下的running-config文件采用tftp方式下载到tftp服务器上,重新命名文件为111.txt验证:Router#copy tftp: running-configAddress or name of remote host []? 192.168.1.2Source filename []? qqqq.txtDestination filename [running-config]? running-config将tftp服务器上的qqqq.txt文件采用tftp方式下载到FLASH下的成为系统的running-config文件。
思科交换机命令

思科交换机命令⼀、基本概念 1.交换机基于数据的源MAC地址进⾏学习 2.基于数据的⽬的MAC地址根据MAC地址表进⾏转发 3.对于数据的⽬的mac地址没有学习过,也就是没有MAC地址表项,会执⾏泛洪。
4.交换机的接⼝可以学习多个MAC地址 5.⼀个MAC地址只能被⼀个交换机接⼝学习 6.对于⼴播和组播的数据,交换机⼀律采取泛洪的措施Switch> ⽤户模式Switch>enable 进⼊特权模式Switch# 特权模式 Switch#configure terminal 进⼊全局配置模式Switch(config)# 全局配置模式ctrl +v shift ? 控制台输⼊?⼆、基本命令Switch(config)#hostname SW1 配置路由器名称Switch(config)#no hostname 取消设置的⽤户名SW1(config)#enable password 123456 配置登录密码SW1(config)#enable secret 1234567 配置使⽤加密密码SW1(config)#interface Ethernet 0/0进⼊e0/0端⼝SW1(config-if)#interface e0/0.10进⼊e0/0.10⼦接⼝SW1(config-if)#no shutdown 启⽤端⼝SW1(config-if)#shutdown 关闭端⼝SW1(config-if)#exit 退出接⼝SW1(config)#end 退出全局配置模式SW1#write 保存设置 SW1#disable 退出特权模式三、查看命令SW1#show version 查看系统中的所有版本信息SW1#show running interface e0/0查看接⼝配置的信息SW1#show ip route 查看路由器的路由表SW1#show log 查看路由器的log信息SW1#show ip arp 查看设别学习到的arp信息SW1#show arp detail 查看设别具体从哪个端⼝上学习到的SW1#show ip interface brief 查看路由器IP地址信息SW1#show int e0/0查看端⼝详细SW1#show cdp neighbors detail ⽤于搜集吡邻信息SW1#show interfaces description 查看接⼝链接的描述信息SW1#show cdp 查看设备的cdp全局配置信息SW1#show cdp interface e0/0查看设备的e0/0端⼝的cdp配置信息SW1#show cdp traffic 查看有关cdp包统计信息四、基本设置RO1(config)#int e0/0进⼊e0/0端⼝RO1(config-if)#description miaoshu 对端⼝设置描述RO1#sh run int e0/0显⽰端⼝详细描述RO1(config-if)#no shutdown 启⽤端⼝RO1(config)#line console 0 进⼊控制台⼝RO1(config-line)#logging synchronous 开启信息同步RO1(config-line)#exec-time 55设置超时操作时间(分钟,秒)RO1(config-line)#no exec-timeout <0-35791> 关闭会话超时RO1(config-line)#line vty 0 4 设置允许0-4个⽤户可以远程登录RO1(config-line)#login 要求⼝令验证RO1(config-line)#password 123456设置登录⼝令xxRO1#copy running-config startup-config 保存配置RO1#copy running-config tftp 保存配置tftpRO1#copy startup-config tftp 开机配置存到tftpRO1#copy tftp startup-config 下载配置⽂件到tftpRO1(config)#clock timezone GMT +8设置时间时区RO1#show clock 查看时区RO1#sh cdp neighbors 查看各个接⼝链接,思科私有的RO1#clock set21:46:3013 jun 2019设置时间RO1(config)#banner motd #*************************************************weclome to alan*************************************************# 为登录设置标语最后以#结束五、VLAN基本命令 1.概念:虚拟的局域⽹络,⼯作于OSI参考模型的第⼆层。
思科模拟器基本命令(交换机)

知识归纳思科模拟器命令:设置交换机名字为yzhSwitch> 进入超级终端控制台Switch>enable 进入交换机特权模式Switch#Switch#configure terminal 进入交换机全局配置模式Switch(configure)#hostname yzh 改变名字为XXXyzh(configure)# 显示改名成功yzh(configure)#exit 退回上级操作模式,即返回特权模式yzh#yzh#exit 返回到用户模式yzh>参看交换机有关信息yzh#yzh#configure terminal 进入交换机全局配置模式yzh#show version 查看交换机的版本信息yzh#show vlan 查看交换机的VLAN信息,默认情况下所有借口均属于VLAN yzh#show running-config 查看交换机当前生效的配置信息配置交换机接口f0/2yzh>yzh>enableyzh#yzh#configure terminal 进入交换机配置模式yzh(config)#interface fastEthernet 0/2 进入交换机接口fa0/2yzh(config-if)# 进入接口配置模式yzh(config-if)#speed 100 设置接口F0/2速率为100Myzh(config-if)#duplex half 配置接口的双工模式是半双工yzh(config-if)#no shutdown 开启接口,使得处于工作状态,等待转发数据。
yzh(config-if)#exit 输入exit返回全局模式yzh(config)#exit 返回特权模式yzh# 位于特权模式yzh#show interfaces fastEthernet 0/2 查看刚才对接口f0/2配置情况设置交换机Enable特权密码为adminyzh> 进入超级终端控制台yzh>enable 进入交换机特权模式yzh#configure terminal 进入交换机配置模式yzh(config)#enable secret admin 设置Enable密码为admin注:验证密码自己思考。
思科命令大全(完整版)

思科交换机命令大全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):访问控制列表,用于控制网络流量的进出。
思科交换机常用的100个命令

思科交换机常用的100个命令思科交换机常用的100个命令在思科交换机上的命令有哪些?哪些命令最实用,你知道吗?下面yjbys店铺为大家分享最常用的思科交换机基本命令,希望能帮助到大家!1:进入特权模式enableswitch> enableswitch#2:进入全局配置模式configure terminalswitch> enableswitch#c onfigure terminalswitch(conf)#3:交换机命名hostname aptech2950 以aptech2950 为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使能口令enable password cisco 以cisco 为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco5:配置使能密码enable secret ciscolab 以cicsolab 为例switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscolab6:设置虚拟局域网vlan 1 interface vlan 1switch> enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway 192.168.254 设置网关地址7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例switch> enableswitch#c onfigure 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#c onfigure 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(config)#in f0/15
switch(config)#interface f0/15
switch(config-if)#sw t a v ad 3
switch(config-if)#switchport trunk allowed vlan add 3
删除VLAN
switch(vlan)#n vl 20
switch(vlan)#no vlan 20
Deleting VLAN 2...
Deleting VLAN 2...
switch(vlan)#e
switch(vlan)#exit
简写命令
完整命令
23
将端口加入到VLAN
将端口加入到VLAN
switch(config)#in f0/2
switch(config)#interface f0/2
switch(config-if)#sw a v 30
switch(config-if)#switchport access vlan 30
24
验证VLAN配置信息
验证VLAN配置信息
switch#sh vlan b
switch#show vlan brief
switch(config-if)#switchport trunk allowed vlan remove 3
switch(config-if)#end
switch(config-if)#end
30
验证接口模式(检查中断端口允许的VLAN列表)
验证接口模式(检查中断端口允许的VLAN列表)
switch#sh int f0/15 switchp
思科交换机配置命令大全

交换机配置1、基本配置:Switch >enable /进入特权模式Switch#conf t /进入全局配置模式Switch (conf-if)#duplex full/half/auto /有full , half, auto 三个可选switch# erase startup-configure / 恢复出场配置switch# reload / 重启交换机远程登录和con口还有接口配置和路由器配置命令一样,不再下面总结。
2配置VLAN和TRUNKSwitch(config)# vlan xxx /创建一个VLANSwitch(config-vlan)# name xxx /给VLAN命名或Switch# vlan database /进入保存VLAN配置的配置文件Switch(vlan)# vlan 20 name test20 /创建VLAN并给它命名Switch(config-if)# switchport mode access /配置端口模式是accessSwitch(config-if)# switchport access vlan xxx / 把接口划入一个VLAN Switch(config-if)#switchport trunk encapsulation {isl | dot1q | negotiate} /配置trunk封装ISL 或 802.1Q 或自动协商Switch(config-if)#switchport mode {dynamic {auto | desirable} | trunk} /配置二层trunk模式。
Switch(config-if)#switchport trunk allowed vlan {add | all | except | remove} vlan-list可选) / 配置trunk允许的VLAN3查看命令switch#show version /察看系统中的所有版本信息switch#show interface vlan xxx /查看交换机有关ip 协议的配置信息switch#show running-configure /查看交换机当前起作用的配置信息switch#show interface fastethernet xxx /察看交换机xxx接口具体配置和统计信息switch#show mac-address-table /查看mac 地址表switch#show mac-address-table aging-time / 查看mac 地址表自动老化时间4 cdp 相关命令switch#show cdp / 查看设备的cdp 全局配置信息switch#show cdp interface fastethernet xxx /查看xxx 端口的cdp 配置信息switch#show cdp traffic / 查看有关cdp 包的统计信息switch#show cdp nerghbors / 列出与设备相连的cisco 设备VTP配置switch# vlan databaseswitch(vlan)# vtp domain xxx / 配置VTP名字Switch(vlan)#vtp server / 配置VTP模式为serverSwitch(vlan)#vtp client / 配置VTP模式为clientSwitch(vlan)#vtp password xxx / 配置VTP密码switch(vlan)# vtp pruning / 开启VTP剪裁switch#show vtp domain /显示管理域的VTP 参数还有没总结的,我会抓紧时间完善。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
知识归纳思科模拟器命令:设置交换机名字为yzhSwitch> 进入超级终端控制台Switch>enable 进入交换机特权模式Switch#Switch#configure terminal 进入交换机全局配置模式Switch(configure)#hostname yzh 改变名字为XXXyzh(configure)# 显示改名成功yzh(configure)#exit 退回上级操作模式,即返回特权模式yzh#yzh#exit 返回到用户模式yzh>参看交换机有关信息yzh#yzh#configure terminal 进入交换机全局配置模式yzh#show version 查看交换机的版本信息yzh#show vlan 查看交换机的VLAN信息,默认情况下所有借口均属于VLAN yzh#show running-config 查看交换机当前生效的配置信息配置交换机接口f0/2yzh>yzh>enableyzh#yzh#configure terminal 进入交换机配置模式yzh(config)#interface fastEthernet 0/2 进入交换机接口fa0/2yzh(config-if)# 进入接口配置模式yzh(config-if)#speed 100 设置接口F0/2速率为100Myzh(config-if)#duplex half 配置接口的双工模式是半双工yzh(config-if)#no shutdown 开启接口,使得处于工作状态,等待转发数据。
yzh(config-if)#exit 输入exit返回全局模式yzh(config)#exit 返回特权模式yzh# 位于特权模式yzh#show interfaces fastEthernet 0/2 查看刚才对接口f0/2配置情况设置交换机Enable特权密码为adminyzh> 进入超级终端控制台yzh>enable 进入交换机特权模式yzh#configure terminal 进入交换机配置模式yzh(config)#enable secret admin 设置Enable密码为admin注:验证密码自己思考。
查看设备配置信息yzh#show running-config保存配置信息yzh#write 保存设置配置,把配置指令写入对到系统文件夹中yzh#dir 查看系统文件删除配置,恢复初始配置yzh#yzh#dir 查看系统文件yzh#delete? 输入“?”号,获得帮助yzh#delete flash:config.txt 删除配置文件系统就恢复了出厂配置三层交换机与二层交换机的大多数都相同。
配置三层交换机的名称为SW3,enable密码为admin,并且配置与远程登陆相关的选项。
Switch>enable 进入交换机特权模式Switch#configure terminal 进入交换机全局模式Swirch(config)#hostname yzh 修改交换机名称Yzh(config)#enable password admin 设置交换机enable密码为adminYzh(config)#interface vlan1 进入vlan1Yzh(config-if-VLAN1)#ip address 192.168.1.1 255.255.255.0 配置IP地址yzh(config-if-VLAN1)#exit 退出配置vlan1yzh(config)#username admin password admin 配置登陆交换机的用户名与密码yzh(config)#line vty 0 4 进入vty端口配置yzh(config-line)#login local 配置vty端口使用本地数据库验证yzh(config-line)#exit 退出vty端口配置yzh(config)# 配置OK保存三层交换机配置。
SW3#write配置三层交换机名称与VLANyzh>enable 进入交换机特权模式yzh#configure terminal 进入交换机全局模式yzh(config)#hostname YZH 修改交换机名称为YZHYZH(config)#vlan10 创建vlan10YZH(config-vlan)#vlan20 创建vlan20YZH(config-vlan)#exitYZH(config)#interface range fastEthernet 0/1-10 进入fa/1-10端口YZH(config-if-range)#switchport access vlan10 划分fa/1-10端口为vlan10 YZH(config-if-range)exitYZH(config)#interface range fastEthernet 0/11-20 进入fa/11-20端口YZH(config-if-range)#switchport access vlan20 划分fa/11-20端口为vlan20 YZH(config-if-range)#exit查看vlan配置信息YZH(config)#exitYZH#show vlan 查看交换机vlan信息配置vlan10与vlan20的IP地址,使vlan10与vlan20之间能相互通讯。
YZH(config)#interface vlan10 进入vlan10YZH(config-vlan10)#ip address 192.168.1.1 255.255.255.0 配置vlan10的IP地址YZH(config-vlan10)#exitYZH(config)#interface vlan20 进入vlan20YZH(config-vlan20)#ip address 192.168.2.1 255.255.255.0 配置vlan20的IP地址YZH(config)#exitYZH#show running-config 查看交换机配置信息在三层交换机上配置vlan10与20的IP地址后,PC1与PC2可以相互通讯YZH>enable 进入特权模式YZH#configure terminal 进入全局模式YZH(config)#hostname yzh 修改名称yzh(config)#interface range fasrEthernet 0/1-2 进入fa0/1、fa0/2端口yzh(config-if-range)#port-group 1 把fa0/1、fa0/2端口聚合为端口组1 yzh(config-if-range)#exityzh(config)#exit 注:验证测试:查看交换机配置yzh#show running-config配置三层交换机SW1的生成树协议yzh>enableyzh#configureyzh(config)#hostname YZHYZH(config)#spanning-tree 配置生成树YZH(config)#exit验证配置:YZH#show vlan 查看VLAN划分信息配置二层交换机SWB的VLAN划分YZH>enableYZH #configure terminalYZH(config)#hostname SWB 配置交换机名称YZH (config)#vlan20 创建VLAN20YZH (config-vlan)#exitYZH (config)#int fa0/1YZH (config-if)#switYZH (config-if)#switchport access vlan20 将端口Fa0/1划分为VLAN20YZH (config-if)#exitYZH (config)#int fa0/24YZH (config-if)#switchport access vlan20 将端口Fa0/24划分为VLAN20YZH (config-if)#exit配置三层交换机SW1不同VLAN之间的通信YZH>enableYZH #configure terminalYZH (config)#hostname yzh !配置交换机名称yzh (config)#vlan10 !创建VLAN10yzh (config-vlan)#vlan20 !创建VLAN20yzh (config-vlan)#vlan 30 !创建VLAN30yzh (config-vlan)#exityzh (config)#interface vlan10 !配置VLAN10的IP地址yzh (config-VLAN10)#ip address 192.168.1.1 255.255.255.0yzh (config-VLAN10)#exityzh config)#interface vlan20 !配置VLAN20的IP地址yzh (config-VLAN20)#ip address 192.168.2.1 255.255.255.0yzh config-VLAN20)#exityzh (config)#interface vlan 30 !配置VLAN30的IP地址yzh (config-VLAN 30)#ip address 192.168.3.1 255.255.255.0yzh (config-VLAN 30)#exityzh (config)#interface range fastEthernet 0/1-7yzh (config-if-range)#switchport access vlan10 !划分VLAN10yzh (config-if-range)#exityzh (config)#interface range fastEthernet 0/8-14yzh (config-if-range)#switchport access vlan20 !划分VLAN20yzh (config-if-range)#exityzh (config)#interface range fastEthernet 0/15-21yzh (config-if-range)#switchport access vlan 30 !划分VLAN30yzh (config-if-range)#exit配置风暴控制。
在交换机配置F0/1端口(连接PC1 的端口)对广播报文进行风暴控制,限制其端口收到的报文速率(pps)yzh#configureyzh(config)#interface fastEthernet 0/1yzh(config-if)#storm-control broadcast pps 100 配置报文速率阈每秒100个报文yzh(config-if)#exit配置交换机端口安全的最大连接数和端口违背模式,绑定PC机IP地址和MAC地址到端口上yzh>enableyzh#configureyzh(config)#interface fastEthernet 0/1yzh(config-FastEthernet 0/1)#switchport port-security 打开端口安全功能yzh(config-FastEthernet 0/1)#switchport port-security mac address 0023.7d51.72adip-addreess 192.168.1.1yzh(config-if-range)#switchport port-security violation shutdown 配置安全违背关闭模式验证交换机端口的最大连接数和端口违背模式yzh(config)#show port-secruity验证端口绑定的MAC地址和IP地址yzh(config)#show port-security验证端口绑定的MAC地址和IP地址yzh(config)#show port-security address配置镜像源端口0/1-2的进出流量映射到目的端口F0/20yzh>enableyzh#configureyzh(config)#monitor session 1 source interface fasrEthernet 0/1-2 bothyzh(config)#monitor session 1 destination interface fastEthernet 0/20yzh(config)#exit查看配置信息yzh(config)#show monitor session 1交换机地址绑定(address-bind)功能yzh>yzh>enableyzh#configure terminalyzh(config)#address-bind install 使用address-bind功能yzh(config)#address-bind 192.168.1.1 0016.d390.6cc5绑定IP地址为192.168.1.1 MAC地址为0016.d390.6cc5的主机让其使用网络yzh(config)#address-bind 192.168.1.2 0016.d390.6cc4绑定IP地址为192.168.1.2 MAC地址为0016.d390.6cc4的主机让其使用网络yzh(config)#address-bind iplink GigabitEthernet 0/24设置F0/24为例外端口,对于绑定地址策略不生效!查看配置信息yzh#show address-bind创建ACL,定义需要限速的主机范围yzh>enableyzh#configureyzh(config)#ip access-list standard gc 创建标准访问控制列表gcyzh(config-std-ipacl)#permit host 192.168.1.0 定义限速的数据流yzh(config)#ip access-list standard yg 创建标准访问控制列表ygyzh(config-std-ipacl)#permit host 192.168.2.0 定义限速的数据流定义分类表Yzh(config)#class-map yg 创建名为yg的分类表yzh(config-cmap)#match access-group yg 关联匹配的列表地址yzh(config-cmap)#exityzh(config)#class-map gc 创建名为yg的分类表yzh(config-cmap)#match access-group gc 关联匹配的列表地址yzh(config-cmap)#exit创建策略列表,关联对应的分类表,配置限速大小yzh(config)#policy-map qos1 创建名为qos1的策略列表yzh(config-pmap)#class yg 关联分类表ygyzh(config-pmap-c)#police 20000 2000 exceed-action drop将满足yg分类规则的报文的带宽设置为20M比特/秒,突发值为2M字节,超出此带宽的报文一律丢弃yzh(config-pmap)#class gc 关联分类表gcyzh(config-pmap-c)#bandwidth 20 percent 设置cg占取20%带宽yzh(config-pmap-c)#exit将带宽限制策略应用到相应的端口yzh#configureyzh(config)#interface range fastEthernet 0/1-2 进入端口1-2yzh(config-if)#service-policy input qos1 应用策略列表小贴士验证分类表和策略列表的配置命令Switch#show class-mapSwitch#show policy-mapyzh#configyzh(config)#time-range schooltime 创建时间表schooltimeyzh(config-time-range)#periodic Daily 23:00 to 23:59定义时间范围为23:00到23:59yzh(config-time-range)#periodic Daily 0:00 to 7:00定义时间范围为0:00 到 7:00yzh(config)#exit:创建扩展ACL并命名为schoolACl,配置禁止172.20.83.0该网段在每天晚上23:00至凌晨7:00禁止访问外网IP地址172.20.82.100。