Cisco 2950基本配置命令
3、3、Catalyst 2950交换机常用命令

3、3、Catalyst 2950交换机常用命令Catalyst 2950系列交换机Catalyst 2950系列交换机是Cisco公司生产的以太网交换机,它主要用于10M以太网或100M 快速以太网,通常作为接入层交换机使用。
Catalyst 2950系列有4种型号:① Catalyst 2950-24:有24个10/100M自适应端口。
② Catalyst 2950-12:有12个10/100M自适应端口。
③ Catalyst 2950T-24:有24个10/100M自适应端口,2个10/100/1000M BaseT上行链路端口。
④ Catalyst 2950C-24:有24个10/100M自适应端口,2个100M BaseFX(多模光纤)上行链路端口。
下图为Catalyst 2950-12交换机的主要接口:1~12均为10/100M自适应端口,表示为 FastEthernet 0/1 ~ FastEthernet 0/12,通常简写为 fa0/1~fa0/12。
1、常用命令行模式①用户模式:提示符>②特权模式:提示符#③全局配置模式:提示符(config)#④接口配置模式:提示符(config-if)#⑤VLAN配置模式:提示符(vlan)#⑥线路配置模式:提示符(config-line)#每一种模式下有一组命令集,在使用一条命令时必须先进入相应的模式。
交换机命令的格式是:提示符命令[参数表]。
① 交换机命令是键盘命令,对大小写不敏感。
② 交换机命令支持缩写,不用输入完整的命令和关键字,只要键入的命令所包含的字符长到足以与其它命令区别就足够了。
例如,可将“show configure”命令缩写为“sh conf”。
在命令提示符的前面是交换机的名字,这在有多台交换机时可方便我们进行识别。
2、基本命令3、VLAN配置命令4、接口配置命令。
最新思科cisco2950交换机配置手册(中文)

2950交换机简明配置维护手册目录第1章说明 (3)第2章产品特性 (3)第3章配置端口 (3)3.1配置一组端口 (3)3.2配置二层端口 (5)3.2.1配置端口速率及双工模式 (6)3.2.2端口描述 (7)3.3监控及维护端口 (8)3.3.1监控端口和控制器的状态 (8)3.3.2刷新、重置端口及计数器 (10)3.3.3关闭和打开端口 (10)第4章配置VLAN (11)4.1理解VLAN (11)4.2可支持的VLAN (12)4.3配置正常范围的VLAN (12)4.3.1生成、修改以太网VLAN (13)4.3.2删除VLAN (15)4.3.3将端口分配给一个VLAN (15)4.4配置VLAN Trunks (16)4.4.2使用STP实现负载均衡 (19)第5章配置Cluster (23)第1章说明本手册只包括日常使用的有关命令及特性,其它未涉及的命令及特性请参考英文的详细配置手册。
第2章产品特性2950是只支持二层的交换机支持VLAN•到250 个VLAN•支持VLAN ID从1到4094(IEEE 802.1Q 标准)•支持ISL及IEEE 802.1Q封装安全•支持IOS标准的密码保护•支持标准及扩展的访问列表来定义安全策略•支持基于VLAN的访问列表监视•交换机LED指示端口状态•SPAN及远端SPAN (RSPAN) 可以监视任何端口或VLAN的流量•内置支持四组的RMON监控功能(历史、统计、告警及事件)第3章配置端口3.1 配置一组端口当使用interface range命令时有如下的规则:•有效的组范围:o vlan从1 到4094o fastethernet槽位/{first port} - {last port}, 槽位为0o gigabitethernet槽位/{first port} - {last port},槽位为0o port-channel port-channel-number - port-channel-number, port-channel号从1到64•端口号之间需要加入空格,如:interface range fastethernet 0/1 –5是有效的,而interface range fastethernet 0/1-5是无效的.•interface range命令只能配置已经存在的interface vlan•所有在同一组的端口必须是相同类别的。
cisco2950交换机常用命令

domain Set the name of the VTP administrative domain.
client Set the device to client mode.
server Set the device to server mode.
2950#clear mac-address-table restricted static (清除限制性MAC址表)
四、 VTP的配置
2950#vlan database (进入VLAN配置模式)
2950(vlan)#vtp ? (查看VTP的子命令)
2950#vlan database (进入VLAN配置模式)
2950(vlan)#vlan 2 (创建VLAN 2)
VLAN 2 added:
Name:VLAN0002 (系统默认名)
2950(vlan)#vtp domain wqs (设置域名)
2950(vlan)#vtp pruning (启动修剪模式)
2950#show vtp status (查看VTP设置信息)
五、配置VLAN TRUNK端口
2950(config)#int f0/11 (进入F端口)
2950(config)#ip name-server 192.168.1.1 (设置域名服务器)
2950(config)#ip domain-name (设置域名)
二、端口配置
2950(config)#int f0/1 (进入接口)
2950(config-if)#spanning-tree vlan 2 port-priority 10 (将VLAN2的端口权值设spanning-tree vlan 2 cost 30 (设置VLAN2生成树路径值为30)
思科交换机配置命令

思科交换机配置命令思科交换机配置命令大全美国思科公司,凭借它的IOS,Cisco公司在多协议路由器市场上处于绝对领先的地位。
目前,在Internet中,有近80%的路由器来自Cisco。
下面给大家介绍思科交换机配置命令大全,一起来了解一下吧! 思科交换机配置命令大全一、基本配置命令switch> 用户模式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 的密码恢复拔下交换机电源线。
路由与交换配置命令汇总

Cisco路由与交换配置命令汇总一、Cisco2950交换机的基本配置:Switch> //用户模式Switch>enable //进入特权模式Switch# //特权模式Switch#configure terminal //进入全局模式Switch(config)# //全局模式Switch(config)#host C2950 //配置主机名C2950(config)#C2950(config)#enable password cisco //设置进入特权模式的普通口令C2950(config)#enable secret class //设置进入特权模式的加密口令C2950(config)#line console 0 //设置进入控制台0的口令C2950(config-line)#password S1C2950(config-line)#loginC2950(config-line)#exitC2950(config)#line vty 0 4 //设置远程登陆口令C2950(config-line)#password S2C2950(config-line)#loginC2950(config-line)#exitC2950(config)#二、交换机端口的设置C2950#config terminalC2950(config)#interface fa0/1 //进入接口fa0/1配置模式C2950(config-if)#description SalesPrinter //配置描述信息C2950(config-if)#duplex full //配置全双工C2950(config-if)#speed 100 //配置接口带宽C2950(config-if)#endC2950#show interface //查看验证接口配置C2950#show running-config //查看验证全部配置C2950#copy running startup //将运行配置复制到启动配置三、交换机的远程配置C2950(config)#interface vlan 1 //进入VLAN 1接口配置模式C2950(config-if)#ip address 192.168.1.10 255.255.255.0//配置交换机的管理IP地址C2950(config-if)#exitC2950(config)#C2950(config)#line vty 0 4 //配置交换机远程登录口令C2950(config-line)#password classC2950(config-line)#loginC2950(config-line)#exitC2950(config)#enable password cisco //设置进入特权模式的口令C2950(config)#在PC机命令行中利用Telnet来登录连接交换机,也可在登录一台交换机后,再利用Telnet命令,登录连接另一台交换机。
CISCO交换机基础配置命令大全

CISCO交换机配置命令大全switch> 用户模式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.1255.255.255.0 配置交换机端口ip和子网掩码aptech2950(conf-if)#noshut 是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway192.168.254 设置网关地址7:进入交换机某一端口 interface fastehernet0/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 fastehernet0/17 以17端口为例aptech2950(conf-if)#duplexfull/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的密码恢复拔下交换机电源线。
思科交换机2950
2950目录说明 (1)产品特性 (1)配置端口 (2)配置一组端口 (2)配置二层端口 (4)配置端口速率及双工模式 (4)端口描述 (5)监控及维护端口 (6)监控端口和控制器的状态 (6)刷新、重置端口及计数器 (8)关闭和打开端口 (8)配置VLAN (9)理解VLAN (9)可支持的VLAN (10)配置正常范围的VLAN (10)生成、修改以太网VLAN (11)删除VLAN (12)将端口分配给一个VLAN (13)配置VLAN Trunks (14)使用STP实现负载均衡 (17)配置Cluster (21)说明本手册只包括日常使用的有关命令及特性,其它未涉及的命令及特性请参考英文的详细配置手册。
产品特性2950是只支持二层的交换机支持VLAN∙到250 个VLAN∙支持VLAN ID从1到4094(IEEE 802.1Q 标准)∙支持ISL及IEEE 802.1Q封装安全∙支持IOS标准的密码保护∙支持标准及扩展的访问列表来定义安全策略∙支持基于VLAN的访问列表监视∙交换机LED指示端口状态∙SPAN及远端SPAN (RSPAN) 可以监视任何端口或VLAN的流量∙内置支持四组的RMON监控功能(历史、统计、告警及事件)配置端口配置一组端口命令目的Step 1 configure terminal进入配置状态Step 2 interface range {port-range} 进入组配置状态Step 3 可以使用平时的端口配置命令进行配置Step 4 end退回Step 5 show interfaces[interface-id] 验证配置Step 6 copy running-config保存startup-config当使用interface range命令时有如下的规则:∙有效的组范围:o vlan从1 到4094o fastethernet槽位/{first port} - {last port}, 槽位为0o gigabitethernet槽位/{first port} - {last port},槽位为0o port-channel port-channel-number - port-channel-number, port-channel号从1到64∙端口号之间需要加入空格,如:interface range fastethernet 0/1 – 5是有效的,而interface range fastethernet 0/1-5是无效的.∙interface range命令只能配置已经存在的interface vlan∙所有在同一组的端口必须是相同类别的。
cisco2950交换机简单配置2950是只支持二层的交换机支持VLAN第1步
cisco2950交换机简单配置2950是只支持二层的交换机支持VLAN第1步cisco2950 交换机简单配置2950 是只支持二层的交换机支持VLAN 第1 步:单击“开始”按钮,在“程序”菜单的“附件”选项中单击“超级终端” 第2 步:在“名称”文本框中键入“Cisco” 第3 步:在“连接时使用”下拉列表框中选择与交换机相连的计算机的串口。
台式机为“com 1”,笔记本为“com 3 或者com 5”。
第4 步:在“波特率”下拉列表框中选择“9600”-确定. 如果通信正常的话就会出现类似于如下所示的主配置界面,并会在这个窗口中就会显示交换机的初始配置情况。
enter enter enter no!1)配置交换机姓名switch>ena switch#configure enter switch#configure terminal (进入配置状态) Switch(config)#hostname 配置的交换机姓名如:30FLoor-2960-1 30FLoor-2960-1(config)#end 30FLoor-2960-1# 2)配置交换机的ip 30FLoor-2960-1#configure terminal (进入配置状态) 30FLoor-2960-1(config)#interface vlan 1 30FLoor-2960-1(config)#ip address ip 地址子网掩码例如:30FLoor-2960-1(config)#ip address 10.11.90.10 255.255.255.0 30FLoor-2960-1(config)#no shutdown 30FLoor-2960-1(config)#end 30FLoor-2960-1# 30FLoor-2960-1# 3)配置交换机的默认网关30FLoor-2960-1(config)#ip default-gateway 网关ip 例如:30FLoor-2960-1(config)#ip default-gateway 10.11.90.254 4)设置路由30FLoor-2960-1(config)#ip route 0.0.0.0 X.X.X.X 5)设置console 口密码30FLoor-2960-1(config)#line console 0 30FLoor-2960-1(config-line)#password 输入密码30FLoor-2960-1(config-line)#login 30FLoor-2960-1(config-line)#end 6)设置telnet 的密码30FLoor-2960-1(config)#line vty 0 10 30FLoor-2960-1(config-line)#password 输入密码(yuxuan)30FLoor-2960-1(config-line)#login 30FLoor-2960-1(config-line)#end7)设置交换机的enable 密码30FLoor-2960-1(config)#enablepassword 输入密码(xuan)30FLoor-2960-1(config)#enable secret 输入密码(yuxuan)30FLoor-2960-1(config)#end 8)将当前配置信息保存到闪存中30FLoor-2960-1(config)#write 9)查看交换机信息30FLoor-2960-1# show version 查看交换机版本信息show ip interfaces 查看交换机的ip 地址show interface vlan 1 验证管理ip 地址已经配置并开启show ip redirect 查看交换机的网关show running-configure 查看交换机当前的配置信息show configure 查看交换机保存的配置信息switch#write ;保存配置信息switch#show vtp ;查看vtp 配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan 配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息10)交换机基本配置步骤1.登陆到交换机2.进入特权模式命令:enable 3.进入全局配置模式命令:configure terminal 4.进入相应的配置子模式如:接口子模式命令:interface vlan 1 交换机基本状态:switch: ;ROM 状态,路由器是rommon> hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xx switch#exit ;返回命令交换机VLAN 设置:switch#vlan database ;进入VLAN 设置switch(vlan)#vlan 2 ;建VLAN 2 switch(vlan)#no vlan 2 ;删vlan 2 switch(config)#int f0/1 ;进入端口 1 switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2 switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp 域名switch(config)#vtp password ;设置发vtp 密码switch(config)#vtp mode server ;设置发vtp 模式switch(config)#vtp mode client ;设置发vtp 模式交换机设置IP 地址:switch(config)#interface vlan 1 ;进入vlan 1 switch(config-if)#ip address ;设置IP 地址switch(config)#ip default-gateway ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp 配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan 配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息思科2950 交换机VLAN 划分cisco 首先配置一下交换机SC-2950> SC-2950>en SC-2950#conf t Enter configuration commands, one per line. End with CNTL/Z. SC-2950(config)#config-register 0x2102 SC-2950(config)#end 添加三个VLAN SC-2950#vlan data SC-2950(vlan)#vlan 10 name v1 VLAN 10 added: Name: v1 SC-2950(vlan)#vlan 20 name v2 VLAN 20 added: Name: v2 SC-2950(vlan)#vlan 30 name v3 VLAN 30 added: Name: v3 SC-2950(vlan)#exitAPPLY completed. Exiting.... SC-2950# 划分接口到各个VLAN SC-2950#conf t Enter configuration commands, one per line. End with CNTL/Z. SC-2950(config)#int fa0/1 //留给管理员SC-2950(config-if)#switchport mode access SC-2950(config-if)#sw acc vlan 10 SC-2950(config-if)#no shutdown SC-2950(config-if)#exit SC-2950(config)#int range f0/2 - 15 SC-2950(config-if-range)#sw mode acc SC-2950(config-if-range)#sw acc vlan 20 SC-2950(config-if-range)#no sh SC-2950(config-if-range)#exit SC-2950(config)#int range f0/16 - 24 SC-2950(config-if-range)#sw mode acc SC-2950(config-if-range)#sw acc vlan 30 SC-2950(config-if-range)#no sh SC-2950(config-if-range)#exit 激活VLAN,并且给VLAN 10 加个IP 以便管理SC-2950(config)#int vlan 10 SC-2950(config-if)#ip add 192.168.1.1 255.255.255.0 SC-2950(config-if)#no sh SC-2950(config-if)#exit SC-2950(config)#int vlan 20 SC-2950(config-if)#no sh SC-2950(config-if)#exit SC-2950(config)#int vlan 30 SC-2950(config-if)#no sh SC-2950(config-if)#exit 将交换机指向网关SC-2950(config)#ip default-gateway 192.168.1.254 SC-2950(config)#end SC-2950# 检测配置SC-2950#sh vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------1 default active 10 v1 active Fa0/1 20 v2 active Fa0/2, Fa0/3, Fa0/4,Fa0/5 Fa0/6, Fa0/7, Fa0/8,Fa0/9 Fa0/10, Fa0/11, Fa0/12,Fa0/13 Fa0/14, Fa0/1530v3activeFa0/16, Fa0/17, Fa0/18, Fa0/19 Fa0/20, Fa0/21, Fa0/22, Fa0/23 Fa0/24 Prot down down down up up downSC-2950#sh ip int b Interface IP-Address ocol FastEthernet0/23 unassigned FastEthernet0/24 unassigned Vlan1 unassigned Vlan10 192.168.1.1 Vlan20 unassigned Vlan30 unassigned SC-2950#sh run Building configuration... Current configuration : 1482 bytes ... ! interface FastEthernet0/24 switchport access vlan 30 ! interface Vlan1 no ip address ! interface Vlan10 ip address 192.168.1.1 255.255.255.0 ! interface Vlan20 no ip address ! interface Vlan30 no ip address ! ip default-gateway 192.168.1.254 ip http server ! ... 保存配置SC-2950#write Building configuration... [OK] cisco 2960 交换机安装配置基础新设备配置内容:1. interface vlan 1 的ip,gateway conf t int vlan 1 ip address xx.xx.xx.xx 255.255.255.0OK? Method Status YES unset up YES unset up YES unset up YES manual up YES unset up YES unset upip default-gateway ip-address no shutdown exit 2.en 的密码3.line vty 0-4 telnet 的密码4.wr 存盘show interface vlan 1 show run 将F0/1-10 端口加入到VLAN20 中,对应以下命令interface range f0/1 -10 switchport mode acccess switchport access vlan 20 注意,f0/1 后面有个空格,然后才是-10 cisco 2950 常用配置命令产品相关命令1、配置IP 地址交换机要能够被网管,必须给它标识一个管理IP 地址,默认情况下CISCO 交换机的VLAN 1 为管理VLAN,为该VLAN 配上IP 地址,交换机就可以被网管了。
思科2950-24参考命令
思科2950-24参考命令思科2950-24参考命令一,进入交换机switch>enable //进入特权模式Switch#configure terminal //进入全局配置模式Switch(config)#hostname CS2950 //设置交换机的主机名为CS2950CS2950(config)#enable password xxx //设置特权非密口令CS2950(config)#enable secret xxx //设置特权加密口令CS2950(config)#line console 0 //进入控制台口CS2950(config)#line vty 0 4 //进入虚拟终端CS2950(config)#login //允许登录CS2950(config)#password xx //设置登录口令xxCS2950(config)#exit //退出全局配置模式CS2950#write //保存设置二,创建vlan(1)特权模式下创建vlanCS2950>enable //进入特权模式CS2950#vlan database //进入vlan设置CS2950(vlan)#vlan 2 //创建vlan 2CS2950(vlan)#exit //退出vlan设置CS2950#write //保存设置(2)全局模式下创建vlanCS2950>enable //进入特权模式CS2950#configure terminal //进入全局配置模式CS2950(config)#vlan 3 //创建vlan 3CS2950(config-vlan)#exit //退出CS2950(config)#exit //退出CS2950#write //保存设置三,删除vlanCS2950>enable //进入特权模式CS2950#vlan database //进入vlan设置CS2950(vlan)#no vlan 2 //删除vlan 2CS2950(vlan)#exit //退出vlan设置CS2950#write //保存设置四,加入vlan(1)单个端口添加到指定vlanCS2950>enable //进入特权模式CS2950#config terminal //进入全局配置模式CS2950(config-if)#interface f0/2 //进入交换机第二个口CS2950(config-if)#no shutdown //启用交换机第二个口CS2950(config-if)#switchport access vlan 2 //将第二个口加入到vlan2 (CS2950(config-if)#no switchport access vlan 2 //将端口2从vlan2中删除) CS2950(config-if)#exit //退出CS2950(config)#exit //退出CS2950#write //保存设置(2)多个端口同时添加到指定vlanCS2950>enable //进入特权模式CS2950#config terminal //进入全局配置模式CS2950(config)#interface range f0/6 - 8 //进入端口6、7、8CS2950(config-if-range)#switchport mode access //使6、7、8端口成为永久性的非中继模式CS2950(config-if-range)#switchport access vlan 3 //将6、7、8端口添加到vlan3 CS2950(config-if-range)#no shutdown //启用6、7、8端口CS2950(config-if)#exit //退出CS2950(config)#exit //退出CS2950#write //保存设置(3)连续添加端口CS2950>enable //进入特权模式CS2950#config terminal //进入全局配置模式CS2950(config)#interface f0/1 //进入交换机第一个口CS2950(config-if)#switchport mode trunk //将第一个口设置为干线(即设为中继模式)CS2950(config-if)#interface f0/2 //进入交换机第二个口CS2950(config-if)#no shutdown //启用第二个口(交换机第二个口)CS2950(config-if)#switchport access vlan 2 //将第二个口加入到vlan2CS2950(config-if)#interface f0/3 //进入交换机第三个口CS2950(config-if)#switchport access vlan 2 //将第三个口加入到vlan2CS2950(config-if)#interface f0/4 //进入交换机第四个口CS2950(config-if)#switchport access vlan 2 //将第四个口加入到vlan2CS2950(config-if)#interface f0/5 //进入交换机第五个口CS2950(config-if)#switchport access vlan 3 //将第五个口加入到vlan3CS2950(config-if)#exit //退出CS2950(config)#exit //退出CS2950#write //保存设置五,交换机设置IP地址CS2950>enable //进入特权模式CS2950#config terminal //进入全局配置模式CS2950(config)#interface vlan 2 //进入vlan2CS2950(config-if)#ip address 10.10.2.1 255.255.255.0 //为vlan2设置IP地址CS2950(config-if)#ip default-gateway 10.10.0.1 //设置网关CS2950(config)#exit //退出CS2950#copy running-config startup-config //保存设置六,进入交换机指定端口CS2950>enable //进入特权模式CS2950#config terminal //进入全局配置模式CS2950(config)#interface f0/3 //进入交换机第一个口CS2950(config-if)#switchport access vlan 2 //当前端口加入vlan 2CS2950(config-if)#switchport mode trunk //设置为干线(使接口成为永久的中继模式)CS2950(config-if)#switchport trunk allowed vlan 1,2 //设置中继(trunk口)允许的vlanCS2950(config-if)#switchport trunk allowed vlan all //允许所有vlanCS2950(config-if)#switchport trunk allowed vlan remove 1-2 //从中继(trunk口)中删除vlanCS2950(config-if)#switchport trunk encap dot1q //设置vlan 中继七,交换机显示命令:CS2950#write //保存配置信息CS2950#show version //查看版本信息CS2950#show mac-address-table //查看交换机的MAC地址表CS2950#show vtp //查看vtp配置信息CS2950#show running-config //查看当前配置信息CS2950#show vlan //查看vlan配置信息CS2950#show vlan brief //验证vlanCS2950#show interface //查看端口信息CS2950#show int f0/0 //查看指定端口信息CS2950#reload //重启交换机。
思科2950交换机配置说明
0 watchdog, 0 multicast, 0 pause input
0 input packets with dribble condition detected
1 packets output, 64 bytes, 0 underruns
2,从配置模式下创建VLAN,如图:
我们可以看到,从配置模式创建VLAN时只要直接输入vlan命令加VLAN号就可以创建VLAN
上图为成功创建VLAN后的下一个界面,用“?”号同样可以查询到在此VLAN配置模式下可以使用的所有命令。
2.2.3
不同交换机相同VLAN间如需要互访,需要将交换机相连端口设置为中继模式,并且各接口封装模式要相同(在2950上只支持802.1q封装,端口配置为中继后自动开启802.1q协议),否则中继将不起作用。
在配置模式下可以给交换机命名、配置VLAN、STP、VTP、VLAN中继、访问控制列表、以太通道(端口绑定)、SNMP、AAA认证等高级特性,从而达到满足不同用户不同需求的目的。
举例如下:
1,给交换机命名
使用命令“hostname“加欲命名的名字,就能够修改交换机的名字。
如图:
输入“hostname2950_test”命令回车后,交换机的名字立刻由原来的“cisco2950”变为“2950_test”。
1 default active
2 VLAN2 active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5
3 VLAN3 active Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Cisco 2950基本配置命令
switch>
switch>enable
switch#
switch#vlan database(进入vlan维护模式)
switch(vlan)#vlan 2 name vlan2(给vlan 2命名为vlan2)
switch(vlan)#vlan 4 name vlan4(给vlan 4命名为vlan4)
switch(vlan)#exit(这里要注意一下,要打入exit退出才有效,不能用ctrl+z或end直接退出,因为这么不能使配置生效!)
switch#show vlan(查看vlan的配置,默认有vlan1)
switch#configure terminal(进入全局配置模式)
switch(config)#interface f0/1(进入fastethernet0/1接口配置模式)
switch(config-if)#switchport mode access(这步可以省略)
switch(config-if)#switchport access vlan 2(把该接口划分到vlan2,记得vlan2之间有空格) switch(config-if)#no shutdown(激活端口)
switch(config-if)#exit
switch(config)#interface f0/2
switch(config-if)#switchport mode access
switch(config-if)#switchport access vlan 4
switch(config-if)#no shutdown
switch(config-if)#exit
switch(config)#interface f0/3
switch(config-if)#switchport mode trunk(设置此口为中继模式)
switch(config-if)#no shutdown
witch(config-if)#exit(这里可以直接用ctrl+z或end直接退出到特权模式)
二.在路由器Cisco2611上的配置(!!!单臂路由!!!)
router#configure terminal
router(config)#interface f0/0.1(进入子接口模式)
router(config-subif)#encapsulation dot1q 2(设置封装类型为dot1q,它是思科特有的。
此外还有isl封装,要看该设备支不支持。
数字2是vlan号)
router(config-subif)#ip address 192.168.1.1 255.255.255.0
router(config-subif)#exit
router(config)#interface f0/0.2
router(config-subif)#encapsulation dot1q 4
router(config-subif)#ip address 192.168.3.1 255.255.255.0
router(config-subif)#exit
router(config)#interface f0/0
router(config-if)#no shutdown
router(config-if)#^z
router#show running-config
router#copy running-config startup-config
三.给PC1,PC2设置好IP地址,然后用ping命名令测试!
--------------------------------------------------------------------------------------------------------
1、配置IP地址
交换机要能够被网管,必须给它标识一个管理IP地址,默认情况下CISCO交换机的VLAN 1为管理VLAN,为该VLAN配上IP 地址,交换机就可以被网管了。
命令如下:
a、进入全局模式: Switch#configure terminal
b、进入VLAN 1接口模式:Switch(config)#interface vlan 1
c、配置管理IP地址:Switch(config-if) # ip address [A.B.C.D] [mask]
如果当前VLAN 不是管理VLAN ,只需要将上面第b处命令的vlan的号码换成管理VLAN的号码即可。
2、打开SNMP协议
a、进入全局模式: Switch#configure terminal
b、配置只读的Community,产品默认的只读Community名为public
Switch(config)#snmp-server community public ro
d、配置可写的Community,产品默认的可写Community名为private
Switch(config)#snmp-server community private rw
3、更改SNMP的Community密码
a、将设备分组,并使能支持的各种SNMP版本
Switch(config)#snmp-server group qycx123 v1
Switch(config)#snmp-server group qycx 123 v2c
Switch(config)#snmp-server group qycx123 v3 noauth
b、分别配置只读和可写community 如:
Switch(config)#snmp-server community qycx123 ro
Switch(config)#snmp-server community qycx123 rw
4、保存交换机配置
Switch#copy run start
常用命令
1、设置交换机密码
a、更改远程TELNNET密码
Switch#configure terminal
Switch(config)#line vty 0 4
Switch(config-line)#password qycx123
Switch(config-line)#login
Switch(config-line)#exit
b、更改进入全局配置模式时的密码
Switch#configure terminal
Switch(config)#enable secret qycx123
2、创建并划分VLAN
a、创建VLAN
Switch#vlan database
Switch(vlan)#vlan 99 name office
(创建vlan 99 并命名为office)
b、将端口划分至vlan
Switch(config)#interface fastEthernet 0/8
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 99
(将8号快速以太口划分至vlan 99)
3、常用调试命令
a、显示所有配置命令:Switch#show run
b、显示所有接口状态:Switch#show ip int brief
c、显示所有VLAN的信息:Switch#show vlan brief。