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

合集下载

思科模拟器基本操作hao

思科模拟器基本操作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文件。

怎么在思科模拟器上给交换机设置.doc

怎么在思科模拟器上给交换机设置.doc

怎么在思科模拟器上给交换机设置方法步骤1、首先找出一台2811类的路由器和一台2960类的交换机和3台pc,利用直通线使各个设备相互连接起来2、为交换机配置主机名,命令为SwitchenableSwitch#conf terminalEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S13、为交换机配置密码,命令为:S1(config)#enable secret ciscoS1(config)#line vty 0 15S1(config-line)#password ciscoS1(config-line)#login4、配置交换机端口安全,配置命令是:S1(config)#int f0/1S1(config-if)#shutdownS1(config-if)#switch mode accessS1(config-if)#switch port-securitiy5、检查交换机的Mac地址表,命令是:S1#show mac-address-table6、查看端口安全的设置情况,用命令为:show port-security相关阅读:交换机工作原理过程交换机工作于OSI参考模型的第二层,即数据链路层。

交换机内部的CPU会在每个端口成功连接时,通过将MAC 地址和端口对应,形成一张MAC表。

在今后的通讯中,发往该MAC地址的数据包将仅送往其对应的端口,而不是所有的端口。

因此,交换机可用于划分数据链路层广播,即冲突域;但它不能划分网络层广播,即广播域。

交换机拥有一条很高带宽的背部总线和内部交换矩阵。

交换机的所有的端口都挂接在这条背部总线上,控制电路收到数据包以后,处理端口会查找内存中的地址对照表以确定目的MAC(网卡的硬件地址)的NIC(网卡)挂接在哪个端口上,通过内部交换矩阵迅速将数据包传送到目的端口,目的MAC若不存在,广播到所有的端口,接收端口回应后交换机会学习新的MAC地址,并把它添加入内部MAC地址表中。

思科交换机命令

思科交换机命令

思科交换机命令⼀、基本概念 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、ip address:设置接口的IP地质示例:ip address 192.168.1.1 255.255.255:02、no shutdown:启用接口示例:no shutdown3、duplex:设置接口的双工模式示例:duplex auto4、speed:设置接口的速度示例:speed 1005、exit:退出接口配置模式示例:exit二、VLAN命令1、vlan database:进入VLAN数据库模式示例:vlan database2、vlan id name:创建VLAN并设置名称示例:vlan 10 name VLAN-103、vlan id:删除VLAN示例:no vlan 104、show vlan:显示VLAN信息示例:show vlan5、exit:退出VLAN数据库模式示例:exit三、路由命令1、ip route:设置静态路由示例:ip route 192.168.2:0 255.255.255:0 192.168.1.22、router rip:启用RIP路由协议示例:router rip3、network:将网络添加到RIP路由表中示例:network 10:0:0:04、redistribute:将静态路由或其他路由协议添加到RIP路由表中示例:redistribute static5、exit:退出路由配置模式示例:exit四、ACL命令1、access-list:创建标准或扩展ACL示例:access-list 10 permit 192.168.1:0 0:0:0.2552、ip access-group:应用ACL到接口示例:ip access-group 10 in3、show access-lists:显示ACL信息示例:show access-lists4、exit:退出ACL配置模式示例:exit五、SNMP命令1、snmp-server community:设置SNMP团体字符串示例:snmp-server community public RO2、snmp-server enable traps:启用SNMP陷阱示例:snmp-server enable traps3、snmp-server host:配置SNMP陷阱接收主机示例:snmp-server host 192.168.1.1004、exit:退出SNMP配置模式示例:exit六、SSH命令1、ip ssh version:设置SSH协议版本示例:ip ssh version 22、crypto key generate rsa:RSA密钥对示例:crypto key generate rsa3、username:创建新的本地用户示例:username admin privilege 15 password password1234、exit:退出SSH配置模式示例:exit七、其他命令1、show running-config:显示当前配置示例:show running-config2、copy running-config startup-config:将当前配置保存到启动配置中示例:copy running-config startup-config3、reload:重新启动设备示例:reload4、exit:退出CLI命令行模式示例:exit本文档涉及附件:1、无附件本文所涉及的法律名词及注释:1、ACL(Access Control List):访问控制列表,用于控制网络流量的进出。

思科交换机配置命令大全

思科交换机配置命令大全

交换机配置1、基本配置: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 参数还有没总结的,我会抓紧时间完善。

思科交换机命令(vlan相关)

思科交换机命令(vlan相关)

思科交换机命令(vlan相关)交换机命令交换机基本状态:witch:;ROM状态,路由器是rommon>hotname>;用户模式hotname#;特权模式hotname(config)#;全局配置模式hotname(config-if)#;接口状态交换机口令设置:witch>enable;进入特权模式witch#configterminal;进入全局配置模式witch(config)#hotname;设置交换机的主机名witch(config)#enableecret某某某;设置特权加密口令witch(config)#enablepaword某某a;设置特权非密口令witch(config)#lineconole0;进入控制台口witch(config-line)#linevty04;进入虚拟终端witch(config-line)#login;允许登录witch(config-line)#paword某某;设置登录口令某某witch#e某it;返回命令交换机VLAN设置:witch#vlandatabae;进入VLAN设置witch(vlan)#vlan2;建VLAN2witch(vlan)#novlan2;删vlan2witch(config)#intf0/1;进入端口1witch(config-if)#witchportaccevlan2;当前端口加入vlan2witch(config-if)#witchportmodetrunk;设置为干线witch(config-if)#witchporttrunkallowedvlan1,2;设置允许的vlanwitch(config-if)#witchporttrunkencapdot1q;设置vlan中继witch(config)#vtpdomain;设置发vtp域名witch(config)#vtppaword;设置发vtp密码witch(config)#vtpmodeerver;设置发vtp模式witch(config)#vtpmodeclient;设置发vtp模式交换机设置IP地址:witch(config)#interfacevlan1;进入vlan1witch(config-if)#ipaddre;设置IP地址witch(config)#ipdefault-gateway;设置默认网关witch#dirflah:;查看闪存交换机显示命令:witch#write;保存配置信息witch#howvtp;查看vtp配置信息witch#howrun;查看当前配置信息witch#howvlan;查看vlan配置信息witch#howinterface;查看端口信息witch#howintf0/0;查看指定端口信息补充:3层交换机多出的就是路由能力,体现在vlan的互相通信功能和端口的路由能力,下面介绍:开启路由功能:iprouting进入vlan配置网段网关与路由配置接口相同interfacevlan1ip192.168.1.1255.255.255.0路由配置与路由器配置相同只是把接口换为VLAN+VLAN号,开启接口路由功能,进入接口配置:nowichport。

最新整理思科模拟器上给交换机设置基本配置方法教程

最新整理思科模拟器上给交换机设置基本配置方法教程

最新整理思科模拟器上给交换机设置基本配置方法教程思科模拟器上给交换机设置基本配置方法教程交换机的主要功能包括物理编址、网络拓扑结构、错误校验、帧序列以及流控。

交换机还具备了一些新的功能,如对V L A N(虚拟局域网)的支持、对链路汇聚的支持,甚至有的还具有防火墙的功能。

其中交换机是基于收到的数据帧中的源M A C地址和目的M A C地址来进行工作。

那么思科模拟器上给交换机设置基本配置的方法是什么呢?方法步骤1、首先找出一台2811类的路由器和一台2960类的交换机和3台p c,利用直通线使各个设备相互连接起来2、为交换机配置主机名,命令为复制内容到剪贴板S w i t c h e n a b l eS w i t c h#c o n f t e r m i n a lE n t e r c o n f i g u r a t i o n c o m m a n d s, o n e p e r l i n e. E n d w i t h C N T L/Z.S w i t c h(c o n f i g)#h o s t n a m e S13、为交换机配置密码,命令为:复制内容到剪贴板S1(c o n f i g)#e n a b l e s e c r e t c i s c oS1(c o n f i g)#l i n e v t y015S1(c o n f i g-l i n e)#p a s s w o r d c i s c oS1(c o n f i g-l i n e)#l o g i n4、配置交换机端口安全,配置命令是:复制内容到剪贴板S1(c o n f i g)#i n t f0/1S1(c o n f i g-i f)#s h u t d o w nS1(c o n f i g-i f)#s w i t c h m o d e a c c e s sS1(c o n f i g-i f)#s w i t c h p o r t-s e c u r i t i y5、检查交换机的M a c地址表,命令是:S1#s h o wm a c-a d d r e s s-t a b l e,6、查看端口安全的设置情况,用命令为:s h o wp o r t-s e c u r i t y补充:交换机基本使用方法作为基本核心交换机使用,连接多个有线设备使用:网络结构如下图,基本连接参考上面的作为网络隔离使用:对于一些功能好的交换机,可以通过模式选择开关选择网络隔离模式,实现网络隔离的作用,可以只允许普通端口和U P l i n k端口通讯,普通端口之间是相互隔离不可以通讯的除了作为核心交换机(中心交换机)使用,还可以作为扩展交换机(接入交换机)来扩展网络放在路由器上方,扩展网络供应商的网络线路(用于一条线路多个I P的网络),连接之后不同的路由器用不同的I P连接至公网相关阅读:交换机硬件故障常见问题电源故障:由于外部供电不稳定,或者电源线路老化或者雷击等原因导致电源损坏或者风扇停止,从而不能正常工作。

思科交换机基本配置命令

思科交换机基本配置命令

思科交换机基本配置命令思科交换机相关配置⼀、基础操作进⼊交换机界⾯为⼀般⽤户模式 switch>输⼊命令 enable进⼊特权⽤户模式 switch#输⼊命令config terminal进⼊全局配置模式 switch(config)#输⼊命令int xxx可进⼊端⼝或者vlan的全局配置⼦模式switch(config-if)#特权⽤户模式可输⼊show命令查看相关设置,命令后输⼊?可查询帮助可⽤no 命令撤销已经设置的配置⼆、Telnet远程登录设置1.交换机配置IP地址进⼊vlan 1 //int vlan 1启⽤ //no shutdown设置ip地址 ///ip address ip地址⼦⽹掩码2.设置交换机⽤户名和密码useename xxxpassword/secret xxx设置enable密码enable password xxx3.设置访问数量line vty 0 x(x是数量,最⼩为1)password xxxlogin也可以直接调⽤上⾯设置的本地⽤户名密码line vty 0 xlogin local4.console⼝的密码设置也相似line console 0login local三、SSH远程登录1.基础设置与Telnet类似2.设置访问数量line vty 0 x3.选择ssh⽅式transport input ssh4.更改hostnamehostname xxx5.设置域名ip domain-name 6.设置rsa加密密钥crypto key generate rsa[512]:在360-2048中选择即可7.PC端登录命令ssh -l username ip地址四、交换机中划分vlan1.创建vlanvlan x(数字)可以使⽤name命令改名2.进⼊端⼝,分配vlanint f0/1switchport access vlan x3.交换机之间相连需要在连接端⼝做trunk进⼊连接端⼝int f0/24创建trunkswitchport mode trunk五、核⼼交换机中划分vlan1.创建vlanvlan x1vlan x2…2.vlan 中设置⽹关,vlan下的pc终端也要设置相同⽹关int vlan xip address xxx xxx3.三层交换机与交换机相连端⼝做trunk封装dot1q协议switchport trunk encapsulation dot1q创建trunkswitchport mode trunk4.如有需要,可以开启路由功能ip routing六、本地端⼝镜像1.设置源端⼝monitor session 1 source int f0/12.设置⽬的端⼝monitor session 1 destination f0/2七、远程端⼝镜像1.设置远程专⽤vlanvlan 100开启远程端⼝镜像功能remote-span2.被监视交换机中设置源端⼝monitor session 1 source int f0/1设置⽬的端⼝monitor session 1 destination remote vlan 100 reflector-port f0/1 3.另⼀台监视交换机同上,创建vlan,开启远程镜像设置源端⼝monitor session 2 source remote vlan 100设置⽬的端⼝monitor session 2 destination int f0/3⼋、PVST配置,负载均衡1.打开pvst功能spanning-tree mode pvst2.进⼊交换机全局配置模式配置主根spainning-tree vlan x1 priority 4096配置次根spanning- tree vlan x2 priority 81923.进⼊另⼀个交换机配置主根spainning-tree vlan x2 priority 4096配置次根spanning- tree vlan x1 priority 81923.进⼊另⼀个交换机九、链路聚合lacp1.进⼊需要配置的端⼝int range f0/21-242.选择lacp协议channel-protocol lacp2.开启channel-group 1 mode active3.如果链路聚合需要做trunk,可以执⾏以下操作int port- channel 1switchport mode trunk。

最新整理怎么在思科模拟器上给交换机设置

最新整理怎么在思科模拟器上给交换机设置

怎么在思科模拟器上给交换机设置交换机除了能够连接同种类型的网络之外,还可以在不同类型的网络(如以太网和快速以太网)之间起到互连作用。

在思科模拟器上怎么进行交换机的基本配置?交换机是基于收到的数据帧中的源M A C地址和目的M A C 地址来进行工作。

我们今天就来看看交换机的基本配置,需要的朋友可以参考下方法步骤1、首先找出一台2811类的路由器和一台2960类的交换机和3台p c,利用直通线使各个设备相互连接起来2、为交换机配置主机名,命令为S w i t c h e n a b l eS w i t c h#c o n f t e r m i n a lE n t e r c o n f i g u r a t i o n c o m m a n d s, o n e p e r l i n e. E n d w i t h C N T L/Z.S w i t c h(c o n f i g)#h o s t n a m e S13、为交换机配置密码,命令为:S1(c o n f i g)#e n a b l e s e c r e t c i s c oS1(c o n f i g)#l i n e v t y015S1(c o n f i g-l i n e)#p a s s w o r d c i s c oS1(c o n f i g-l i n e)#l o g i n4、配置交换机端口安全,配置命令是:S1(c o n f i g)#i n t f0/1S1(c o n f i g-i f)#s h u t d o w nS1(c o n f i g-i f)#s w i t c h m o d e a c c e s sS1(c o n f i g-i f)#s w i t c h p o r t-s e c u r i t i y5、检查交换机的M a c地址表,命令是:S1#s h o wm a c-a d d r e s s-t a b l e6、查看端口安全的设置情况,用命令为:s h o wp o r t-s e c u r i t y相关阅读:交换机工作原理过程交换机工作于O S I参考模型的第二层,即数据链路层。

全面整理思科交换机命令大全

全面整理思科交换机命令大全

整理思科交换机常用命令大全1.1 用户模式与特权模式用户模式:可以使用一些基本的查询命令特权模式:可以对交换机进行相关的配置进入特权模式命令:Switch>enable退出特权模式命令:Switch#exit启用命令查询:?时间设置:Switch#clock set 时间(自选参数,参数必须符合交换机要求)显示信息命令:Switch#show 可选参数注意:可以用TAB键补齐命令,自选参数为用户自定义参数,可选参数为交换机设定参数查看交换机配置: Switch#show running-config保存交换机配置:Switch#copy running-config startup-configSwitch#wr查看端口信息:Switch#show interface查看MAC地址表:Switch#show mac-address-table查看交换机CPU的状态信息:Switch#show processes1.2 全局配置模式进入全局配置模式:Switch#configure terminal主机名修改:Switch(config)#hostname 主机名(自选参数)特权模式进入密码: Switch(config)#enable secret 密码(自选参数)取消特权模式密码:Switch(config)#no enable secret取消主机名设置: Switch(config)#no hostname退出配置模式: Switch(config)#exit需要特别注意的是在配置模式中无法使用show命令,如果要使用的话show前必须加do和空格,例如:do show *指定根交换机命令:Switch(config)#spanning-tree vlan 自选参数(VLAN号)root primary例如: Switch(config)#spanning-tree vlan 1 root primary需要注意的是:设置根交换机是基于VLAN的关闭生成树协议命令:Switch(config)#no spanning-tree vlan 自选参数(VLAN 号)例如: Switch(config)#no spanning-tree vlan 11.3 接口配置模式进入接口配置模式:Switch(config)#interface 端口名称(可选参数)启用端口:Switch(config-if)#no shutdown停用端口:Switch(config-if)#shutdown进入同种类型多端口配置:Switch(config)# interface range fastethernet 0/1-5进入不同类型多端口配置:Switch(config)#interface range fastethernet 0/1-5,gigabitethernet 0/1-2退出接口配置模式:Switch(config-if)#exit1.4 二层端口的配置端口速率: Switch(config-if)#speed 可选参数双工模式: Switch(config-if)#duplex 可选参数禁用链路协商:Switch(config-if)#no negotiation auto 启用链路协商:Switch(config-if)#negotiation auto1.5 VLAN的配置新建VLAN:Switch(config)#vlan 自选参数(VLAN号)Switch(config-vlan)#name自选参数(VLAN名)例如:Switch(config)#vlan 1Switch(config-vlan)#name lab1Switch(config-vlan)#exit删除VLAN: Switch#vlan databaseSwitch(vlan)#no vlan 自选参数(vlan号)例如:Switch#vlan databaseSwitch(vlan)#no vlan 2将一个接口加入VLAN:Switch(config)#interface 可选参数(接口号)Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 自选参数(VLAN号)Switch(config-if)#no shutdownSwitch(config-if)#exit例如:Switch(config)#interface f0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 1Switch(config-if)#no shutdownSwitch(config-if)#exit将一个接口退出VLAN:Switch(config)#interface 可选参数(接口号)Switch(config-if)#no switchport access vlan 自选参数(VLAN号)例如:Switch(config)#interface f0/1Switch(config-if)#no switchport access vlan 2修改一个接口为端口汇聚模式Switch(config)#interface 可选参数(接口号)Switch(config-if)#switchport mode trunkVLAN的验证命令:Switch#show vlan 显示VLAN列表Switch#show interface switchport 查看具体接口的VLAN成员资格信息1.6 VTP的配置VTP Domain Name(VTP域名)Switch#configure terminalSwitch(config)#vtp domain 自选参数例如: Switch(config)#vtp domain Lab_NetworkVTP mode(VTP模式)Switch(config)#vtp mode 可选参数(Server|Client| Transparent)例如: Switch(config)#vtp mode ServerVTP Pruning(VTP修剪)Switch(config)#vtp pruning注意:有的交换机不支持VTP修剪命令查看VTP的配置命令:Switch#show vtp status显示交换机运行的VTP模式,配置修订号和交换机所属的VTP域Switch#show vtp counters显示VTP消息相关的统计数据1.7 远程登录交换机设置配置管理VLAN:Switch(conf)#interface vlan 1Switch(config-if)#ip address x.x.x.x 255.255.255.0Switch(config-if)#no shutdown注意:IP地址必须与远程连接交换机的PC机地址在同一网段在交换机上指定默认网关:Switch(config)#ip default-gateway x.x.x.x注意:指定的默认网关仅当前交换机有效。

思科模拟器命令

思科模拟器命令

1. 计算机命令:PCA login: root ;使用root用户password: linux ;口令是linux# shutdown -h now ;同init 0 关机# logout# login# ifconfig ;显示IP地址# ifconfig eth0 <ip address> netmask <netmask> ;设置IP地址# ifconfig eht0 <ip address> netmask <netmask> down ;删除IP地址# route add default gw <ip> ;设置网关# route del default gw <ip> ;删除网关# route ;显示网关# ping <ip># telnet <ip>2. 交换机支持的命令:交换机基本状态:switch: ;交换机的ROM状态rommon> ;路由器的ROM状态hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname <hostname> ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain <name> ;设置发vtp域名switch(config)#vtp password <word> ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置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 vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息3. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname <hostname> ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xx router(config)#(Ctrl+z) ;返回特权模式router#exit ;返回命令路由器配置:router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置时钟频率router(config-if)#ip address <ip> <netmask> ;设置IP地址router(config-if)#ip address <ip> <netmask> second ;设置第二个IP router(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address <ip> <netmask> ;设置子接口IP router(config-subif.1)#encapsulation dot1q <n> ;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftp router#copy startup-config tftp ;开机配置存到tftp router#copy tftp flash: ;下传文件到flash router#copy tftp startup-config ;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommon>confreg 0x2142 ;跳过配置文件rommon>confreg 0x2102 ;恢复配置文件rommon>reset ;重新引导rommon>copy xmodem:<sname> flash:<dname> ;从console传输文件rommon>TFTP_FILE=c2600.bin ;指定下载的文件rommon>tftpdnld ;从tftp下载rommon>dir flash: ;查看闪存内容rommon>boot ;引导IOS静态路由:ip route <ip-address> <subnet-mask> <gateway> ;命令格式动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。

思科交换机基本配置命令

思科交换机基本配置命令

思科交换机基本配置命令目录1、基本概念介绍 (2)2、密码、登陆等基本配置 (2)3、CISCO设备端口配置详解 (4)4、VLAN的规划及配置 (6)4.1核心交换机的相关配置 (6)4.2接入交换机的相关配置 (8)5、配置交换机的路由功能 (9)6、配置交换机的DHCP功能 (9)7、常用排错命令 (10)1、基本概念介绍IOS: 互联网操作系统,交换机和路由器常用操作系统VLAN: 虚拟lanVTP: VLAN TRUNK PROTOCOLDHCP: 动态主机配置协议ACL:访问控制列表三层交换机:具有三层路由转发能力的交换机2、密码、登陆等基本配置本节介绍cisco路由器或者交换机的基本配置,本教程用的是cisco的模拟器做的介绍,一些具体的端口显示可能与实际的设备不符,但并不影响基本配置命令的执行。

Router># 显示稳定后,出现最初的提示符,提示符“>”表示目前所处的状态为用户模式。

Router>Router>en# 如果在当前状态下没有重复的命令,可以用“TAB”键来补齐命令Router>enable# 从用户模式(user mode)进入到特权模式(exec mode),提示符变为“#”Router#configure terminal#在特权模式下输入configure terminal进入全局配置模式(global configuration mode),在这之下输入的命令叫做全局命令,一旦输入,将对整个router产生即时影响。

*Mar 1 00:44:26.491: %SYS-5-CONFIG_I: Configured from console by console t # 在输入命令的过程中,IOS会出现一些即时提示。

Enter configuration commands, one per line. End with CNTL/Z.Router(config)#exit # 退出当前模式Router(config)#hostname test# 更改当前设备的名字,主要是为了便于区分设备。

在思科模拟器上怎么进行交换机的基本配置

在思科模拟器上怎么进行交换机的基本配置

在思科模拟器上怎么进行交换机的基本配置在思科模拟器上怎么进行交换机的基本配置在思科模拟器上怎么进行交换机的基本配置 11、首先,打开思科模拟器软件,连接三台交换机的连接线,将所有交换机互相连接起来,一台当服务器,一台当客户机,另外一台当透明模式。

2、把三台交换机的配置清除干净,重启交换机,配置命令为:复制内容到剪贴板S1#flash:vlan.dat S1#erasestartup-config S1#reload配置S1 为VTP server,配置命令为:复制内容到剪贴板 S1(config)#vtpmodeserver3、配置S3 为VTP transparent,配置命令是:复制内容到剪贴板S3#vlandatabase S3(vlan)#vtptransparent S3(vlan)#vtppasswordcisco(配置交换机的密码)SettingdeviceVLANdatabasepasswordtocisco4、配置S2 为VTP client,配置命令是:复制内容到剪贴板S2(config)#vtpmodeclient SettingdevicetoVTPCLIENTmode. S2(config)#vtpdomainVTP-TEST DomainnamealreadysettoVTP-TEST. S2(config)#vtppasswordcisco5、在S1 上创建VLAN,检查S2、S3 上的VLAN 信息,配置命令是:复制内容到剪贴板 S1(config)#vlan2 S1(config)#vlan3查看s1,s2,s3的VLAN配置信息。

命令是:复制内容到剪贴板 S1#showvlan S2#showvlan S3#showvlan6、查看VTP 信息,查看交换机的vtp详细信息和版本等信息:复制内容到剪贴板 S1#showvtpstatus注意事项:1、要成功配置vtp服务器,应确认配置的所有交换机都已设置为默认设置。

思科交换机命令大全共16页文档

思科交换机命令大全共16页文档

思科交换机命令大全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-string 7.设置端口速度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-rangemode{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 [costcost][vlan-list]17.调整端口IDIOS:switch(config-if)#spanning-tree[vlan vlan-list]port-priorityport-priorityCLI:switch(enable)set spantree portpri {mldule/port}priority switch(enable)set spantree portvlanpri {module/port}priority [vlans]18.修改STP时钟IOS:switch(config)# spanning-tree [vlan vlan-list] hello-time seconds switch(config)#spanning-tree [vlan vlan-list] forward-time secondsswitch(config)#spanning-tree [vlan vlan-list] max-age secondsCLI: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-ratepkts-per-second]CLI:switch(enable)set spantree uplinkfast {enable|disable}[rate为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个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-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 fastagingtimepkt_threshold54. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS高速缓存记录: switch(enable) show mls entry56. 用命令show in arp显示ARP高速缓存区的内容。

思科交换机命令大全

思科交换机命令大全

6.端口描述 switch(config-if)#description escription-string switch(enable)set port name module/number description-string
7.设置端口速度 switch(config-if)# speed{10|100|auto} switch(enable) set port speed moudle/number {10|100|auto}
9.配置静态VLAN switch# vlan database
switch(vlan)# vlan vlan-num name vla
switch(vlan)# exit
switch# configure teriminal
switch(config)#interface port module/number
5.查看Cisco邻接设备的CDP通告 switch# show cdp interface [type modle/port]
switch# show cdp neighbors [type module/port] [detail] switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]
思科交换机命令大全
1.设置主机名/系统名 switch(config)# hostname "hostname" switch(enable) set system name name-string
2.设置登录口令 switch(config)# enable password level 1 password switch(enable) set password

思科交换机基本命令

思科交换机基本命令

en 进入配置模式说明:不进入配置模式就没有办法对交换机或路由器等设备进行配置,没进入配置模式前显示的是符号“>”,进入后显示的是符号“#”示例:Switch>enSwitch#vlan data 进入vlan建立模式示例:Switch#vlan datavlan 10 name bgs10 建立一个ID为10的VLAN,说明:ID为大于1的整数,一个VLAN代表一个不同的网段示例:Switch(vlan)#vlan 10 name bgs10exit 返回上一级示例:Switch(vlan)#exitSwitch#Conf t 进入交换机端口配置模式示例:Switch#conf t //进入交换机端口配置模式Switch(config)#Int fa0/1 进入到fa0/1号端口,进入后可对该端口进行配置示例:Switch(config)#int fa0/1 //进入fa0/1端口Switch(config-if)#Int range fa0/1-fa0/10 进入到fa0/1到fa0/10这十个连续的端口,此时可对这十个端口进行配置示例:Switch(config)#int range fa0/1-fa0/10Switch(config-if-range)#No shut 激活端口示例:Switch(config-if-range)#no shutSwit mode access 设置端口为access模式端口Swit access vlan 10 将指定端口划分到ID为10的VLAN中示例:Switch(config)#int range fa0/1-fa0/10 //进入到fa0/1到fa0/10这十个连续的端口Switch(config-if-range)#no shut //激活这十个连续的端口Switch(config-if-range)#swit mode access //设置端口为access模式端口Switch(config-if-range)#swit access vlan 10 //将该端口划分到ID为10的VLAN中Swit mode trunk 设置端口为trunk模式端口,trunk 模式端口允许多个vlan的数据通过。

思科路由模拟器命令大全

思科路由模拟器命令大全

命令要在一行内打完,窗体可以自动拉大。

Aux口这个版本暂不支持。

支持三级Switch网络,需要路由时支持两级Switch。

设置的主机名中不要含有空格。

F2、F3键清屏(为了方便而加)Ctrl+P 历史命令,建议使用方向键。

Ctrl+z 回根,建议使用end命令Ctrl+Break 路由器进入ROM监控状态。

交换机清除特权密码。

双击设备进入终端操作单击设备的接口可以实现画线单击画有线的接口可以删除连线在指定的设备按下鼠标右键可以删除设备。

在指定的设备按下鼠标左键可以实现移动。

按Tab键,可以得到命令全称。

键入"?"可以得到当前状态下的命令帮助。

接收的作业名固定为当前目录下的sim.txt。

系统的配置文件是:sim.ini。

计算测验得分中,ping PCA->PCB;5 表示ping通得5分,SWAf6=2;5表示交换机SwitchA的f0/6在vlan 2时得5分。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~PCA login:root;使用root用户password:linux;口令是linux# shutdown -hnow ;同init 0 关机# logout# login#ifconfig;显示IP地址# ifconfig eth0 <ip address> netmask <netmask> ;设置IP地址# ifconfig eht0 <ip address> netmask <netmask> down ;删除IP地址# route add 0.0.0.0 gw <ip># route del 0.0.0.0 gw <ip># route add default gw <ip> ;# route del default gw <ip> ;删除网关#route;显示网关# ping <ip># telnet <ip>交换机基本状态:switch:;交换机的ROM状态rommon>;路由器的ROM状态hostname>;用户模式hostname#;特权模式hostname(config)#;全局配置模式hostname(config-if)#;接口状态交换机口令设置:switch>enable;进入特权模式switch#configterminal ;进入全局配置模式switch(config)#hostname <hostname> ;设置交换机的主机名switch(config)#enable secretxxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 04 ;进入虚拟终端switch(config-line)#login;允许登录switch(config-line)#passwordxx ;设置登录口令xxswitch#exit;返回命令交换机VLAN设置:switch#vlandatabase;进入VLAN设置switch(vlan)#vlan2 ;建VLAN 2switch(vlan)#no vlan2 ;删vlan 2 switch(config)#intf0/1 ;进入端口1 switch(config-if)#switchport access vlan 2 ;当前端口加入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> ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置IP地址:switch(config)#interface vlan1 ;进入vlan 1switch(config-if)#ip address <IP> <mask> ;设置IP 地址switch(config)#ip default-gateway <IP> ;设置默认网关switch#dirflash: ;查看闪存交换机显示命令:switch#write;保存配置信息switch#showvtp;查看vtp配置信息switch#showrun;查看当前配置信息switch#showvlan;查看vlan配置信息switch#showinterface ;查看端口信息switch#show intf0/0 ;查看指定端口信息路由器显示命令:router#showrun;显示配置信息router#showinterface ;显示接口信息router#show iproute ;显示路由信息router#show cdpnei ;显示邻居信息router#reload;重新起动路由器口令设置:router>enable;进入特权模式router#configterminal ;进入全局配置模式router(config)#hostname <hostname> ;设置交换机的主机名router(config)#enable secretxxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 04 ;进入虚拟终端router(config-line)#login;要求口令验证router(config-line)#passwordxx ;设置登录口令xxrouter(config)#(Ctrl+z);返回特权模式router#exit;返回命令路由器配置:router(config)#ints0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address <ip> <netmask> ;设置IP地址router(config-if)#ip address <ip> <netmask> second ;设置第二个IP router(config-if)#intf0/0.1 ;进入子接口router(config-subif.1)#ip address <ip> <netmask> ;设置子接口IP router(config-subif.1)#encapsulation dot1q <n> ;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload;重新引导路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-configtftp ;保存配置到tftprouter#copy startup-configtftp ;开机配置存到tftprouter#copy tftpflash: ;下传文件到flashrouter#copy tftpstartup-config ;下载配置文件ROM状态:Ctrl+Break;进入ROM监控状态rommon>confreg0x2142 ;跳过配置文件rommon>confreg0x2102 ;恢复配置文件rommon>reset;重新引导rommon>copy xmodem:<sname> flash:<dname> ;从console 传输文件rommon>IP_ADDRESS=10.65.1.2;设置路由器IPrommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码rommon>TFTP_SERVER=10.65.1.1;指定TFTP服务器IPrommon>TFTP_FILE=c2600.bin;指定下载的文件rommon>tftpdnld;从tftp下载rommon>dirflash: ;查看闪存内容rommon>boot;引导IOS静态路由:ip route <ip-address> <subnet-mask> <gateway> ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例动态路由:router(config)#iprouting ;启动路由转发router(config)#routerrip ;启动RIP路由协。

100个思科交换机命令大全

100个思科交换机命令大全

100个思科交换机命令大全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-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高速缓存区的内容。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 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。

相关文档
最新文档