Catalyst2960交换机基本配置
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
连接配置模式 全局配置模式输入 line vty或line console 命令 vlan配置模式 全局配置模式输入 vlan database命令 Switch(configline)# Switch(vlan)#
输入exit 、end 或ctrl+z命令
输入exit命令
输入exit命令
2
Copyright Hoare Lecture. All rights reserved.
?vlan从1到4094?fastethernet槽位firstportlastport槽位为0?gigabitethernet槽位firstportlastport槽位为0?portchannelportchannelnumberportchannelnumberportchannel号从1到64端口号之间需要加入空格?如
Copyright Hoare Lecture. All rights reserved.
11
配置一组端口
Switch# configure terminal Switch(config)# interface range fastethernet0/1 - 3, gigabitethernet0/1 - 2 Switch(config-if-range)# no shutdown Switch(config-if-range)# *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet0/2, changed state to up *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to up *Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/ 1, changed state to up *Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up *Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
配置端口
Copyright Hoare Lecture. All rights reserved.
配置一组端口
Step 1
Step 2 Step 3 Step 4 Step 5 Step 6 end show interfaces [interface-id] copy running-config startup-config 命令 configure terminal interface range {portrange} 目的 进入配置状态 进入组配置状态 可以使用平时的端口配置 命令进行配置 退回 验证配置 保存
Copyright Hoare Lecture. All rights reserved. 10
配置一组端口
Switch# configure terminal Switch(config)# interface range fastethernet0/1 - 5 Switch(config-if-range)# no shutdown Switch(config-if-range)# *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/2, changed state to up *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to up *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to up *Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up *Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up *Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up
Copyright Hoare Lecture. All rights reserved.
5
设置IP地址
switch#config term switch(config)# interface vlan 1 switch(config-if)# ip address 192.168.1.2 255.255.255.0 switch(config)# ip default-gateway 192.168.1.1 switch(config)# no shutdown switch(config)# end switch#copy running-config startup-config
Copyright Hoare Lecture. All rights reserved.
3
设置口令
switch>enable Password: switch(config)#enable password cisco switch(config)#enable secret switch switch(config)#service password-encryption switch#config term Enter configuration commands, one per line. End with CNTL/Z. switch(config)#line console 0 switch(config-line)#login switch(config-line)#password conpass switch(config)#line vty 0 15 switch(config-line)#login switch(config-line)#password vtypass switch(config-line)#end switch#copy running-config startup-config
– 端口号之间需要加入空格
• 如:interface range fastethernet 0/1 – 5 是有效的,而interface range fastethernet 0/1-5 是无效的.
– interface range 命令只能配置已经存在的interface vlan – 所有在同一组的端口必须是相同类别的。
Cisco Catopyright Hoare Lecture. All rights reserved.
基于IOS交换机的配置模式
模式 用户模式 访问方式 提示符 退出方式 输入logout或 quit 在交换机上启动一个 Switch> 会话
特权模式
Copyright Hoare Lecture. All rights reserved. 9
配置一组端口
• 使用interface range命令时的规则:
– 有效的组范围:
• • • • vlan从1 到4094 fastethernet 槽位/{first port} - {last port}, 槽位为0 gigabitethernet槽位/{first port} - {last port},槽位为0 port-channel port-channel-number - port-channel-number, portchannel号从1到64
通常情况下,二层交换机的端口不设置IP地址,路 由器的接口设置IP地址,三层交换机(实际上有路 由功能)的接口可以设置也可以不设置,具体情况 具体分析。 不跨网段管理可不设默认网关。
Copyright Hoare Lecture. All rights reserved. 6
Cisco Catalyst 2960系列交换机
Copyright Hoare Lecture. All rights reserved.
8
interface-id
• Physical interface instance. Naming notation is rack/slot/module/port and a slash between values is required as part of the notation.
在用户模式下输入 enable命令
Switch#
Switch(config)#
输入disable或 exit命令
输入exit、 end 或ctrl+z命令
全局配置模式 在特权模式输入 config term命令
接口配置模式 在全局配置模式输入 Switch(config-if)# interface命令
– rack: Chassis number of the rack. – slot: Physical slot number of the line card. – module: Module number. A physical layer interface module (PLIM) is always 0. Shared port adapters (SPAs) are referenced by their subslot number. – port: Physical port number of the interface.
查看并保存配置
switch#show startup-config switch#show running-config switch#erase startup-config Erasing the nvram filesystem will remove all configuration files! Continue? [co][ok]Erase of nvram :complete switch#show startup-config %% non-volatile configuration memory is not present switch#copy running-config startup-config Destination filename [startup-config]?Building pressed configuration from 6015 bytes to 2238 bytes[OK] switch#copy nvram tftp://192.168.1.101/wgswd.cfg %% Configuration upload is successfully completed switch#copy tftp://192.168.1.101/wgswd.cfg nvram %% TFTP successfully downloaded configuration file
Copyright Hoare Lecture. All rights reserved. 4
设置主机名
switch#config term Enter configuration commands, one per line. End with CNTL/Z. switch(config)#hostname switch switch(config)#end switch#copy running-config startup-config Building configuration... Compressed configuration from 5984 bytes to 2218 bytes[OK]
输入exit 、end 或ctrl+z命令
输入exit命令
输入exit命令
2
Copyright Hoare Lecture. All rights reserved.
?vlan从1到4094?fastethernet槽位firstportlastport槽位为0?gigabitethernet槽位firstportlastport槽位为0?portchannelportchannelnumberportchannelnumberportchannel号从1到64端口号之间需要加入空格?如
Copyright Hoare Lecture. All rights reserved.
11
配置一组端口
Switch# configure terminal Switch(config)# interface range fastethernet0/1 - 3, gigabitethernet0/1 - 2 Switch(config-if-range)# no shutdown Switch(config-if-range)# *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet0/2, changed state to up *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up *Oct 6 08:29:28: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to up *Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/ 1, changed state to up *Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up *Oct 6 08:29:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
配置端口
Copyright Hoare Lecture. All rights reserved.
配置一组端口
Step 1
Step 2 Step 3 Step 4 Step 5 Step 6 end show interfaces [interface-id] copy running-config startup-config 命令 configure terminal interface range {portrange} 目的 进入配置状态 进入组配置状态 可以使用平时的端口配置 命令进行配置 退回 验证配置 保存
Copyright Hoare Lecture. All rights reserved. 10
配置一组端口
Switch# configure terminal Switch(config)# interface range fastethernet0/1 - 5 Switch(config-if-range)# no shutdown Switch(config-if-range)# *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/2, changed state to up *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to up *Oct 6 08:24:35: %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to up *Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to up *Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up *Oct 6 08:24:36: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to up
Copyright Hoare Lecture. All rights reserved.
5
设置IP地址
switch#config term switch(config)# interface vlan 1 switch(config-if)# ip address 192.168.1.2 255.255.255.0 switch(config)# ip default-gateway 192.168.1.1 switch(config)# no shutdown switch(config)# end switch#copy running-config startup-config
Copyright Hoare Lecture. All rights reserved.
3
设置口令
switch>enable Password: switch(config)#enable password cisco switch(config)#enable secret switch switch(config)#service password-encryption switch#config term Enter configuration commands, one per line. End with CNTL/Z. switch(config)#line console 0 switch(config-line)#login switch(config-line)#password conpass switch(config)#line vty 0 15 switch(config-line)#login switch(config-line)#password vtypass switch(config-line)#end switch#copy running-config startup-config
– 端口号之间需要加入空格
• 如:interface range fastethernet 0/1 – 5 是有效的,而interface range fastethernet 0/1-5 是无效的.
– interface range 命令只能配置已经存在的interface vlan – 所有在同一组的端口必须是相同类别的。
Cisco Catopyright Hoare Lecture. All rights reserved.
基于IOS交换机的配置模式
模式 用户模式 访问方式 提示符 退出方式 输入logout或 quit 在交换机上启动一个 Switch> 会话
特权模式
Copyright Hoare Lecture. All rights reserved. 9
配置一组端口
• 使用interface range命令时的规则:
– 有效的组范围:
• • • • vlan从1 到4094 fastethernet 槽位/{first port} - {last port}, 槽位为0 gigabitethernet槽位/{first port} - {last port},槽位为0 port-channel port-channel-number - port-channel-number, portchannel号从1到64
通常情况下,二层交换机的端口不设置IP地址,路 由器的接口设置IP地址,三层交换机(实际上有路 由功能)的接口可以设置也可以不设置,具体情况 具体分析。 不跨网段管理可不设默认网关。
Copyright Hoare Lecture. All rights reserved. 6
Cisco Catalyst 2960系列交换机
Copyright Hoare Lecture. All rights reserved.
8
interface-id
• Physical interface instance. Naming notation is rack/slot/module/port and a slash between values is required as part of the notation.
在用户模式下输入 enable命令
Switch#
Switch(config)#
输入disable或 exit命令
输入exit、 end 或ctrl+z命令
全局配置模式 在特权模式输入 config term命令
接口配置模式 在全局配置模式输入 Switch(config-if)# interface命令
– rack: Chassis number of the rack. – slot: Physical slot number of the line card. – module: Module number. A physical layer interface module (PLIM) is always 0. Shared port adapters (SPAs) are referenced by their subslot number. – port: Physical port number of the interface.
查看并保存配置
switch#show startup-config switch#show running-config switch#erase startup-config Erasing the nvram filesystem will remove all configuration files! Continue? [co][ok]Erase of nvram :complete switch#show startup-config %% non-volatile configuration memory is not present switch#copy running-config startup-config Destination filename [startup-config]?Building pressed configuration from 6015 bytes to 2238 bytes[OK] switch#copy nvram tftp://192.168.1.101/wgswd.cfg %% Configuration upload is successfully completed switch#copy tftp://192.168.1.101/wgswd.cfg nvram %% TFTP successfully downloaded configuration file
Copyright Hoare Lecture. All rights reserved. 4
设置主机名
switch#config term Enter configuration commands, one per line. End with CNTL/Z. switch(config)#hostname switch switch(config)#end switch#copy running-config startup-config Building configuration... Compressed configuration from 5984 bytes to 2218 bytes[OK]