cisco交换机配置简单教程
cisco交换机配置实例教程.doc

cisco交换机配置实例教程cisco交换机配置实例教程1、在交换机上启动QOSSwitch(config)#mls qos //在交换机上启动QOS2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //控制pc1下行流量Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量class-map mach-all {name}match access-group 110policy-mapclass二、详细配置过程注:每个接口每个方向只支持一个策略;一个策略可以用于多个接口。
因此所有PC的下载速率的限制都应该定义在同一个策略(在本例子当中为policy-map user-down),而PC不同速率的区分是在Class-map 分别定义。
1、在交换机上启动QOSSwitch(config)#mls qos //在交换机上启动QOS2、分别定义PC1(10.10.1.1)和PC2(10.10.2.1)访问控制列表Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //控制pc1上行流量Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //控制pc1下行流量Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //控制pc2上行流量Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //控制pc2下行流量3、定义类,并和上面定义的访问控制列表绑定Switch(config)# class-map user1-up //定义PC1上行的类,并绑定访问列表10Switch(config-cmap)# match access-group 10Switch(config-cmap)# exitSwitch(config)# class-map user2-upSwitch(config-cmap)# match access-group 11 //定义PC2上行的类,并绑定访问列表10Switch(config-cmap)# exitSwitch(config)# class-map user1-downSwitch(config-cmap)# match access-group 100 //定义PC1下行的类,并绑定访问列表100Switch(config-cmap)# exitSwitch(config)# class-map user2-downSwitch(config-cmap)# match access-group 111 //定义PC2下行的类,并绑定访问列表111Switch(config-cmap)# exit4、定义策略,把上面定义的类绑定到该策略Switch(config)# policy-map user1-up //定义PC1上行的速率为1MSwitch(config-pmap)# class user1-upSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 1024000 1024000 exceed-action dropSwitch(config)# policy-map user2-up //定义PC2上行的速率为2MSwitch(config-pmap)# class user2-upSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 2048000 1024000 exceed-action dropSwitch(config)# policy-map user-downSwitch(config-pmap)# class user1-downSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 1024000 1024000 exceed-action dropSwitch(config-pmap-c)# exitSwitch(config-pmap)# class user2-downSwitch(config-pmap-c)# trust dscpSwitch(config-pmap-c)# police 2048000 1024000 exceed-action dropSwitch(config-pmap-c)# exit5、在接口上运用策略Switch(config)# interface f0/1Switch(config-if)# service-policy input user1-upSwitch(config)# interface f0/2Switch(config-if)# service-policy input user2-upSwitch(config)# interface g0/1Switch(config-if)# service-policy input user-down看了cisco交换机配置实例教程还想看:1.思科交换机基本配置实例讲解2.CISCO交换机配置操作学习教程3.思科交换机配置教程详解4.cisco交换机qos配置实例教程5.思科路由器、交换机的基本管理教程6.Cisco 2960交换机的基础安装配置教程Cisco交换机入门配置的方法Cisco交换机入门配置的方法:机型:Cisco 3750想对交换机警醒配置。
思科交换机配置教程

思科交换机配置教程首先,我们需要登录到交换机的控制台界面。
可以通过串口连接,或者通过网络连接,例如通过SSH协议进行连接。
登录后,我们进入到交换机的命令行界面。
接下来,我们需要进行基本的配置。
思科交换机的配置是通过命令行界面进行的,配置的命令是不同的,但是有一些通用的配置信息,我们可以先进行配置。
首先,我们要为交换机设置一个主机名。
可以使用如下命令进行配置:```Switch(config)# hostname Switch1```这样就为交换机设置了一个名字为"Switch1"的主机名。
接下来,我们可以配置交换机的管理IP地址。
可以使用如下命令进行配置:```Switch(config)# interface vlan 1Switch(config-if)# ip address 192.168.1.1 255.255.255.0Switch(config-if)# no shutdown```这样就为交换机的VLAN1接口配置了一个IP地址为192.168.1.1,子网掩码为255.255.255.0,并且启用了这个接口。
除了基本配置信息,我们还需要进行一些其他的配置,例如VLAN的配置。
VLAN是虚拟局域网的意思,可以将交换机的端口划分到不同的VLAN中,实现不同VLAN之间的隔离。
可以使用如下命令进行VLAN的配置:```Switch(config)# vlan 10Switch(config-vlan)# name VLAN10Switch(config-vlan)# exitSwitch(config)# interface fastEthernet 0/1Switch(config-if)# switchport access vlan 10Switch(config-if)# exit```这样就创建了一个编号为10的VLAN,名称为"VLAN10"。
cisco模拟器交换机配置教程

1、进入用户模式,像这样有个大于符号的2、输入enable进入特权模式,像这样有个#号的3、输入configure terminal进入全局配置模式4、在全局配置模式下可以先设置特权密码,输入enablepassword 1235、接下来对vlan1的接口进行配置。
首先进入接口配置模式,输入interface vlan 16、现在开始配置vlan 1 的管理ip 和子网掩码。
输入ipaddress 192.168.1.1 255.255.255.07、将vlan1 设置为活跃状态。
输入no shut8、退出当前模式进入全局配置模式。
输入exit9、接下来是设置远程登录密码。
首先进入line配置模式,输入line vty 0 4(PS:这里VTY(Virtual Type Terminal)是虚拟终端的意思,line vty 0 4表示设置0到4号5个端口为远程登录端口,设置为0 3,0 2,0 1完全是可以的)10、然后设置密码。
输入password jfb11、输入了密码当然要保存!在上一步的基础上输入login12、然后输入end返回特权模式,再输入show running查看我们对交换机的配置情况13、设置正确。
14、现在就是对pc配置ip 和子网掩码(192.168.1.2255.255.255.0)15、连接一根直通双绞线。
16、接下来激动人心的时刻到来了,在命令提示符中输入ping192.168.1.1,是不是通了,如果没有可多试几次!17、更激动人心的时刻是在下面。
输入telnet 192.168.1.118、输入远程登录密码jfb,看看是不是远程登录成功了19、输入enable ,提示输入密码,该密码为特权密码,前面设置的123看看是不是进入特权模式了!20、现在你就可以对交换机进行配置了MY GOD``````。
Cisco思科光纤交换机配置说明及常用命令

Cisco思科光纤交换机配置说明及常⽤命令你还在为不知道Cisco思科光纤交换机配置说明⽽烦恼么?下⾯⼩编为⼤家收集的Cisco思科光纤交换机配置说明教程,希望能帮到⼤家,⼀起来看看吧!Cisco思科光纤交换机配置说明的⽅法1. 初始化信息⾸次设置,必须通过console进⾏连接(需要U⼝转DB9针的接⼝线,专门卖接⼝线的有卖⼤约30元),然后进⾏初始化设计,以后设定IP后可通过LAN进⾏登陆具体步骤:(红⾊字体部分着重注意,需要进⾏设置,⼤部分按照默认设置即可,⽽且设置的部分进⼊管理⼯具软件可以更改)---- System Admin Account Setup ----Enter the password for "admin": passwordConfirm the password for "admin": password--- Basic System Configuration Dialog ---This setup utility will guide you through the basic configuration of the system. Setup configures only enough connectivity for management of the system.Press Enter at any time to skip any dialog. Use ctrl-c at anytime to skip the remaining dialogs.Would you like to enter the basic configuration dialog (yes/no): yCreate another login account (yes/no) [n]:Configure read-only SNMP community string (yes/no) [n]:Configure read-write SNMP community string (yes/no) [n]:Enter the switch name: Pxx-MDS-x (where xx is your pod number and x is the switch number; for example:P01-MDS-1) Continue with Out-of-band (mgmt0) management configuration? (yes/no) [y]:Mgmt0 IPv4 address : <10.0.x.y> (where x is your pod number and y is 5 for MDS-1 and 3 for MDS-2)(客户)0.16Mgmt0 IPv4 netmask : 255.255.255.0Configure the default gateway? (yes/no) [y]:IPv4 address of the default gateway : 10.0.x.254 (where x is your pod number)Configure advanced IP options? (yes/no) [n]:Enable the telnet service? (yes/no) [y]:Enable the ssh service? (yes/no) [n]:Configure the ntp server? (yes/no) [n]:Configure default switchport interface state (shut/noshut) [shut]: (注意⼀下)noshutConfigure default switchport trunk mode (on/off/auto) [on]:Configure default zone policy (permit/deny) [deny]:Enable full zoneset distribution (yes/no) [n]:NOTE:初始设定的配置对新的VSAN起作⽤,即原始VSAN1⽆这些配置解决办法:1 zone default-zone permit VSAN2 新建 NEW VSAN2 将port转移VSAN2⾥⾯。
CISCO交换机配置操作学习教程

CISCO交换机配置操作学习教程1.注意事项1.交换机启动需要大约4-5分钟;2.网线插入交换机接口从黄变为绿需要大约1-2分钟,即进入正常工作模式;3.建议使用XP系统进行操作,2003默认没有安装超级终端,需要使用安装光盘添加该工具才有;4.请严格按照以下步骤进行,背景灰色字体为交换机显示信息,蓝色字体为配置命令。
2.准备工作先保持交换机断电状态;使用调试串口线连接笔记本电脑的串口与交换机背面的CONSOLE 接口;打开超级终端:开始-所有程序-附件-超级终端;配置超级终端:名称-cisco选择com1或com2(请依照实际情况进行选择)修改每秒位数为9600应用-确定-回车;3.初始配置给交换机通电;片刻后会看到交换机的启动信息,直到出现以下配置选项:Wouldyouliketoterminateautoinstall?[yes]:noWouldyouliketoentertheinitialconfigurationdialog?[yes/no ]:noWouldyouliketoterminateautoinstall?[yes]:no4.出现命令窗口Switch>5.备份出厂配置Switch>en进入特权模式Switch#copyrunning-configsfbak-configDestinationfilename[sfbak-config]?回车片刻后会出现:1204bytescopiedin0.529secs(2276bytes/sec)表示文件备份成功。
6.配置账号密码Switch#configureterminal进入配置子模式Switch(config)#enablepasswordcisco设置PASSWORD密码为ciscoSwitch(config)#enablesecretcisco设置SECRET密码为ciscoSwitch(config)#exit片刻后会出现:00:11:26:%SYS-5-CONFIG_I:Configuredfromconsolebyconsole表示将配置保存到了内存中,在后面的配置过程中会出现类似的信息,属于正常现象。
思科交换机的基本配置

思科交换机的基本配置随着Internet的高速发展,网络规模不断膨胀,对于从事网络专业的学生熟练掌握路由器和交换机的配置已显得十分重要。
接下来是小编为大家收集的思科交换机的基本配置方法,希望能帮到大家。
思科交换机的基本配置的方法一、交换机的基本配置Author:chenchao in ZJNU从本篇文章开始,将连载大概8-9篇自己学习交换与路由的实验报告,但是怕自己能力不行,会出现错误,所以,先载两篇文章,依次为:交换机的基本配置;路由器基本配置。
本篇为交换机的基本配置,使用的仿真软件是Cisco的一款免费软件:Cisco Packet Tracer。
想学习的可以在百度自行下载。
下面开始附上实验过程:实验环境:Cisco 2950交换机1台,Console电缆1根,PC机一台,网线1根。
连接如下图所示:实验步骤:一、交换机的带外配置;1、在用户模式、特权模式、全局模式、接口模式之间转换;Switch>enableSwitch#configure terminalEnter configuration commands, one perline. End with CNTL/Z.Switch(config)#interface FastEthernet 0/1Switch(config-if)#exitSwitch(config)#exitSwitch#%SYS-5-CONFIG_I: Configured from console byconsoleSwitch#exitSwitch con0 is now availablePress RETURN to get started.Switch>2、将交换机的名称改为“student”;Switch(config)#hostname studentstudent(config)#3、为交换机各个模式设置密码“cisco”;特权模式下的密码保护student#enablestudent#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#enable password ciscostudent(config)#enable secret cisco1远程登录口令设置student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#line console 0student(config-line)#line vty 0 4student(config-line)#password cisco2student(config-line)#loginstudent(config-line)#student#4、为交换机制定一个IP地址10.10.10.X/24;student#configConfiguring from terminal, memory, ornetwork [terminal]?Enter configuration commands, one perline. End with CNTL/Z.student(config)#interface vlan 1student(config-if)#ip address 10.10.10.1255.0.0.05、开启交换机的Telnet服务功能,建立Telnet用户admin,口令cisco,并制定只能从10.10.10.y/24登录Telnet服务器;student#student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#user admin password 0 ciscostudent(config)#6、查看配置情况;student>enablePassword:student#show running-cBuilding configuration...hostname student!enable secret 5$1$mERr$q.MA2tj.WFptzvbifq/1i.enable password cisco!!username admin password 0 ciscointerface Vlan1ipaddress 10.10.10.1 255.0.0.0!!line con 0!line vty 0 4password cisco2loginline vty 5 15login!!End二、交换机的端口配置:1、配置接口的描述、关闭借口、启动接口、配置接口的速度为100Mbps、配置接口工作模式为全双工、配置接口的流程控制;student#configure terminalEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface FastEthernet0/1student(config-if)#shutdown%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to administratively down%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to downstudent(config-if)#student(config-if)#exitstudent(config)#interface FastEthernet0/1student(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to up%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to upstudent(config-if)#speed 100student(config-if)#duplex full%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to downstudent(config-if)#2、配置接口FastEthernet0/10为Access口;student#student#configure terminalEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface FastEthernet0/10student(config-if)#switchport mode accessstudent(config-if)#3、配置接口FastEthernet0/12为Trunk口;student#student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface fastethernet0/12student(config-if)#switchport mode Trunkstudent(config-if)#end4、查看配置情况;!interface FastEthernet0/1duplex fullspeed100!!interface FastEthernet0/9!interface FastEthernet0/10switchport mode access!interface FastEthernet0/11!interface FastEthernet0/12switchport mode trunk!student#show running-cBuilding configuration...Current configuration : 1275 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msec no service password-encryption!hostname student!enable secret 5$1$mERr$q.MA2tj.WFptzvbifq/1i. enable password cisco!!username admin password 0 cisco!!duplex fullspeed 100!interface FastEthernet0/2 !interface FastEthernet0/3 !interface FastEthernet0/4 !interface FastEthernet0/5 !interface FastEthernet0/6 !interface FastEthernet0/7 !interface FastEthernet0/8 !interface FastEthernet0/9 !interface FastEthernet0/10 switchport mode access !interface FastEthernet0/11 !interface FastEthernet0/12 switchport mode trunk!interface FastEthernet0/13 !!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface GigabitEthernet1/1 !interface GigabitEthernet1/2 !interface Vlan1ipaddress 10.10.10.1 255.0.0.0 !!line con 0!line vty 0 4password cisco2loginline vty 5 15login!!end看了“思科交换机的基本配置”还想看:。
CISCO交换机基本配置和使用概述

CISCO交换机基本配置和使用概述CISCO交换机是一种常用的网络设备,用于构建局域网(Local Area Network,LAN)。
它可以通过物理线路的连接,将多台计算机或其他网络设备连接到同一个网络中,实现数据的传输和共享。
CISCO交换机的基本配置包括IP地址的配置、VLAN的配置、端口配置、安全性配置等。
接下来,我们将对这些配置进行详细说明。
首先,IP地址的配置是CISCO交换机的基本操作之一。
通过配置IP地址,我们可以对交换机进行管理和监控。
具体的配置步骤如下:1. 进入交换机的配置模式。
在命令行界面输入"enable"命令,进入特权模式。
2. 进入全局配置模式。
在特权模式下输入"configure terminal"命令,进入全局配置模式。
3. 配置交换机的IP地址。
在全局配置模式下输入"interfacevlan 1"命令,进入虚拟局域网1的接口配置模式。
然后输入"ip address 192.168.1.1 255.255.255.0"命令,配置交换机的IP地址和子网掩码。
4. 保存配置并退出。
在接口配置模式下输入"exit"命令,返回到全局配置模式。
然后输入"exit"命令,返回到特权模式。
最后输入"copy running-config startup-config"命令,保存配置到闪存中。
其次,VLAN的配置是CISCO交换机的关键配置之一。
通过配置VLAN,我们可以将交换机的端口划分为不同的虚拟局域网,实现数据的隔离和安全。
1. 进入交换机的配置模式。
同样,在特权模式下输入"configure terminal"命令,进入全局配置模式。
2. 创建VLAN。
在全局配置模式下输入"vlan 10"命令,创建一个编号为10的VLAN。
思科Cisco交换机配置手册配置教程

配置接口特性这一章详细说明交换机上的接口和描述怎么配置他们。
这章有以下这些内容:●理解接口类型●使用接口命令●配置二层接口●监控和维护第二层接口●配置第三从接口注意:需要完整的有关该章的语法和应用信息,请参考Catalyst 3550 Multilayer Switch Command Reference和Cisco IOS Interface Command Referencefor Release 12.1.理解接口类型这个部分描述了不同的接口类型,以及其它章节所包括的详细配置这些接口的一些参考内容。
其他章节描述了物理接口特性的配置过程。
这部分包括:•基于端口的VLAN (Port-Based VLANs)•交换端口(Switch Ports)•以太网通道端口组(EtherChannel Port Groups)•交换虚拟接口(Switch Virtual Interfaces)•被路由端口(Routed Ports)•连接接口(Connecting Interfaces)基于端口的VLAN (Port-based Vlans)一个Vlan是一个按功能、组、或者应用被逻辑分段的交换网络,并不考虑使用者的物理位置。
要更多关于Vlan的信息请看“Configuring VLANS”。
一个端口上接受到的包被发往属于同一个Vlan的接收端口。
没有一个第三层的设备路由Vlan间的流量,不同Vlan的网络设备无法通讯。
为了配置普通范围(Normal-range) Vlan(Vlan IDs 1-1005),使用命令:config-vlan模式(global) vlan vlan-id或vlan-configuration模式(exec) vlan database针对Vlan ID 1-1005的vlan-configration模式被保存在vlan数据库中。
为配置扩展范围(extended-range) Vlans (Vlan ID 1006-4094),你必须使用config-vlan模式,并把VTP的模式设为transparent透明模式。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一、标识交换机二、设置口令及用户三、配置VTP(Vlan中继协议)四、配置中继线(Trunk)五、创建、描述Vlan及设置Vlan IP六、划分、描述及设置Vlan端口七、配置STP(生成树协议)八、启用Vlan间Router九、配置ACL十、配置DHCP中继代理十一、配置DHCP服务器十二、配置HSRP(热备路由协议)十三、保存配置附1:命令行编辑键附2:SHOW命令附7:ACL例子一、标识交换机Switch#configure terminal 进入配置状态Switch(config)#hostname “hostname”设置Switch名称Switch (config)#no hostname 取消Switch名称Switch(config)#end 结束本次配置二、设置口令及用户Switch#configure terminal 进入配置状态Switch(config)#enable secret “password”设置特权模式口令Switch(config)#no enable secret 取消特权模式口令Switch(config)#enable password “password”设置EXEC模式口令Switch(config)#no enable password 取消EXEC模式口令witch(config)#username “username”privilege “num”secret “password”建立本地用户及口令Switch(config)#no username “username”删除本地用户Switch(config)#service password-encryption 加密所有明文口令Switch(config)#no password-encryption 拒绝加密所有明文口令Switch(config)#end 结束本次配置1、配置console用户用口令Switch#configure terminal 进入配置状态Switch(config)#line console 0 进入console口配置状态Switch(config-line)#login local 设置登录模式为本地用户验证模式Switch(config-line)#no login local 取消本地用户验证模式Switch(config-line)#end 结束本次配置或Switch#configure terminal 进入配置状态Switch(config)#line console 0 进入console口配置状态Switch(config-line)#login 设置登录模式为线性登录模式Switch(config-line)#password “password”设置线性登录模式口令Switch(config-line)#no login 取消线性登录模式Switch(config-line)#end 结束本次配置2、配置tenlnet(vty)用户及口令Switch#configure terminal 进入配置状态Switch(config)#line vty 0 15 进入vty配置状态Switch(config-line)#login local 设置登录模式为本地用户验证模式Switch(config-line)#no login local 取消本地用户验证模式Switch(config-line)#end 结束本次配置或Switch#configure terminal 进入配置状态Switch(config)#line vty 0 15 进入vty配置状态Switch(config-line)#login 设置登录模式为线性登录模式Switch(config-line)#password “password”设置线性登录模式口令Switch(config-line)#no login 取消线性登录模式Switch(config-line)#end 结束本次配置三、配置VTP(Vlan中继协议)Switch#vlan database 进入vlan数据库配置状态Switch(vlan)#vtp domain “domainname”设置vtp域名称Switch(vlan)#vtp server|client| transparent 设置vtp模式Switch(vlan)#vtp password “password”设置vtp口令Switch(vlan)#no vtp password 取消vtp口令Switch(vlan)#exit 退出vlan数据库配置状态四、配置trunk(中继线)Switch#configure terminal 进入配置状态Switch(config)#interface “interface mod/port”进入端口配置状态Switch(config-if)#switchport trunk encapsulation dot1q|isl| negotiate 设置干道封装模式Switch(config-if)#switchport mode trunk 设置端口为干道模式Switch(config-if)#no shutdown 启用端口Switch(config-if)#end 结束本次配置或Switch#configure terminal 进入配置状态Switch(config)#interface range “interface mod/port -port”进入端口组配置状态Switch(config-if-range)#switchport trunk encapsulation dot1q|isl| negotiate 设置干道封装模式Switch(config-if-range)#switchport mode trunk 设置端口为干道模式Switch(config-if-range)#no shutdown 启用端口Switch(config-if-range)#end 结束本次配置五、创建、描述Vlan及设置Vlan IPSwitch#vlan database 进入vlan数据库配置状态Switch(vlan)#vlan “vlan-num”name “vlan-name”建立vlan及名称Switch(vlan)#no vlan “vlan-num”删除vlanSwitch(vlan)#exit 退出vlan数据库配置状态Switch#configure terminal 进入配置状态Switch(config)#interface vlan “vlan-num”进入vlan配置状态Switch(config-if)#description “description”描述vlanSwitch(config-if)#no description 取消描述Switch(config-if)#ip address “ip-address subnet-mask”设置vlan 网关的ip 地址Switch(config-if)#no shutdown 启用vlanSwitch(config-if)#end 结束本次配置六、划分、描述及设置Vlan端口Switch#configure terminal 进入配置状态Switch(config)#interface “interface mod/port”进入端口配置状态Switch(config-if)#description “description”描述端口Switch(config-if)#speed auto|100|10 设置端口速率模式Switch(config-if)#duplex auto|full|half 设置端口双工模式Switch(config-if)#switchport mode access 设置端口为访问模式Switch(config-if)#switchport access vlan “vlan-num”设置端口所属Vlan Switch(config-if)#no shutdown 启用端口Switch(config-if)#end 结束本次配置或Switch#configure terminal 进入配置状态Switch(config)#interface range “interface mod/port -port”进入端口组配置状态Switch(config-if-range)#description “description”描述端口Switch(config-if-range)#speed auto|100|10 设置端口速率模式Switch(config-if-range)#duplex auto|full|half 设置端口双工模式Switch(config-if-range)#switchport mode access 设置端口为访问模式Switch(config-if-range)#switchport access vlan “vlan-num”设置端口所属Vlan Switch(config-if-range)#no shutdown 启用端口Switch(config-if-range)#end 结束本次配置七、配置STP(生成树协议)Switch#configure terminal 进入配置状态Switch(config)#spanning-tree portfast default 设置所有访问端口为快速模式Switch(config)#no spanning-tree portfast default 取消所有访问端口为快速模式Switch(config)#spanning-tree uplinkfast 设置上行端口为快速模式Switch(config)#no spanning-tree uplinkfast 取消上行端口为快速模式Switch(config)#end 结束本次配置或Switch#configure terminal 进入配置状态Switch(config)#interface “interface mod/port”进入端口配置状态Switch(config-if)#spanning-tree portfast 设置端口为快速模式Switch(config-if)#no shutdown 启用端口Switch(config-if)#end 结束本次配置或Switch#configure terminal 进入配置状态Switch(config)#interface range “interface mod/port -port”进入端口组配置状态Switch(config-if-range)# spanning-tree portfast 设置端口为快速模式Switch(config-if-range)#no shutdown 启用端口Switch(config-if-range)#end 结束本次配置八、启用Vlan间RouterSwitch#configure terminal 进入配置状态Switch(config)#ip routing 启用ip 路由Switch(config)#ip route “Destination-prefix Destination-prefix-mask Forwarding-router’s-address”Switch(config)#end 结束本次配置九、配置ACLSwitch#configure terminal 进入配置状态Switch(config)#access-list “standard-acl-num”permit|deny “source-address source-wildcard”设置标准aclSwitch(config)#access-list “extend-acl-num”permit|deny ip “source-add source-wildcard Destination-add Destination-wildcard”设置扩展aclSwitch(config)#end 结束本次配置Switch#configure terminal 进入配置状态Switch(config)#interface vlan “vlan-num”进入vlan配置状态Switch(config-if)#ip access-group “acl-num”in|out 应用acl到vlanSwitch(config-if)#end 结束本次配置Switch#configure terminal 进入配置状态Switch(config)#line vty 0 15 进入vty配置状态Switch(config-line)#access-class “acl-num”in|out 应用acl到vtySwitch(config-if)#end 结束本次配置例:Switch(config)#access-list 101 deny ip host 192.168.2.11 host 192.168.10.21Switch(config)#access-list 102 deny ip host 192.168.2.13 192.168.10.0 0.0.0.255Switch(config)#access-list 103 deny ip 192.168.2.0 0.0.0.255 192.168.10.0 0.0.0.255Switch(config)# access-list 104 deny ip 192.168.2.0 0.0.0.255 host 192.168.10.25十、配置DHCP中继代理Switch#configure terminal 进入配置状态Switch(config)#service dhcp 启用dhcp服务Switch(config)#ip dhcp relay information option 启用dhcp代理服务Switch(config)#interface vlan “vlan-num”进入vlan配置状态Switch(config-if)#ip helper-address “ip-address”启用dhcp代理服务器ip地址Switch(config-if)#end 结束本次配置十一、配置DHCP服务器Switch#configure terminal 进入配置状态Switch (config)#ip dhcp pool “Pool-name”设置dhcp地址池名称Switch (dhcp-config)#network “Network-num Network-mask”设置dhcp地址池ip围Switch (dhcp-config)# dns-server “ip-address”为客户机分配DNS服务器ip地址Switch (dhcp-config)#netbios-name-server “ip-address”为客户机分配WINS服务器ip地址Switch (dhcp-config)#default-router “ip-address”为客户机分配默认网关ip地址Switch(config-if)#end 结束本次配置Switch#configure terminal 进入配置状态Switch(config)#service dhcp 启用dhcp服务wyz(config)#ip dhcp excluded-address “Low-ip-address High-ip-address”设置保留ip地址Switch(config-if)#end 结束本次配置十二、配置HSRP(热备路由协议)Switch#configure terminal 进入配置状态Switch(config)#interface vlan “vlan-num”进入vlan配置状态Switch(config-if)#ip address “ip-address subnet-mask”设置vlan 物理ip 地址Switch(config-if)#standby “group-num”ip “virtual-ip-address”设置vlan 虚拟ip 地址Switch(config-if)#standby priority “Priority-value”设置路由器优先等级Switch(config-if)#standby preempt 设置hsrp抢占功能Switch(config-if)#standby timers “Hello-interval-in-seconds Hold-time-in-seconds”设置hello 信息Switch(config-if)#end 结束本次配置十三、保存配置Switch#write memory或Switch#copy running-config startup-config附1:命令行编辑键TAB 补全命令?查看可用命令Ctrl + P 粘贴历史命令Ctrl + E 将光标移至命令末尾Ctrl + F 将光标向前移动Ctrl + B 将光标向后移动Ctrl + Z 返回#命令模式Ctrl + U Clear Line and Put in BufferCtrl + W Delete Word Backwards and Put in BufferCtrl + Y Paste Buffer ContentsCtrl + X Clear Line to the Left and Put in BufferCtrl + T Flip Last 2 CharactersCtrl + J ReturnCtrl + L Refresh LineCtrl + I Refresh Line and Goto EndCtrl + K Delete everything on the Right of cursorCtrl + V Allows to type control characterCtrl + M ReturnCtrl + H Backspace Character to the LeftCtrl + R 刷新行附2:SHOW命令Switch#show version 显示版本信息Switch #show arp | include “ip-address”显示ip地址对应的mac地址信息Switch#show mac-address-table 显示mac地址信息Switch#show mac-address-table | include “mac-address”格式:xxxx.xxxx.xxxx.xxxx Switch #show mac-address-table dynamic address “mac-address”显示mac地址对应的端口信息Switch#show mac-address-table dynamic interface “interface mod/port”显示端口对应的mac 地址信息Switch#show tech-support 显示技术支持信息Switch#show interfaces 显示接口信息Switch#show vlan 显示vlan信息Switch#show startup-config 显示启用配置文件Switch#show running-config 显示运行配置文件Switch#show ip route 显示ip路由状态Switch#clear counters interface “interface mod/port”清除端口计数器Switch(config)#default interface “interface mod/port”恢复端口出厂设置Switch#clear interface “interface mod/port”重置端口的硬件逻辑keyada#show cdp neighbors “interface mod/port”detail附7:ACL例子VLAN1需实现以下效果:1、VLAN1主机192.168.1.240可以访问所有网段;2、VLAN1其余主机可以访问除VLAN2、VLAN3及VLAN4外所有网段。