Cisco 2960 Switch Configuration

Source: Internet
Author: User
Tags switches password protection cisco switch

Cisco 2960 Switch Configuration

1. Cisco Working mode classification and function

#用户模式仅答应基本的监测命令, the configuration of the router cannot be changed in this mode.

Switch> #用户模式

#允许用户执行所有的测试, view, save and other commands, this mode can not be modified router configuration, generally this mode is recommended to set password protection.

Switch>enable #进入特权模式

switch#

#允许用户配置路由器.

switch#Configure terminal #进入全局模式

Switch (config) #

#允许用户配置fastEthernet 0/1 interface.

Switch (config) #interface fastethernet 0/1 #进入配置fa 0/1 interface mode

Switch (config-if) #

2. Basic Operation

#全局模式下修改交换机名称

Switch (config) #hostname test01 ( switch name)

#全局模式下设置登陆特权加密密码

Switch (config) #enable secret 123456

#全局模式下设置登陆特权非加密密码

Switch (config) #enable password 123456

#特权模式下查看Vlan信息

switch#Show VLAN

#特权模式下查看端口信息

switch#Show Interfaces FA0/1

#特权模式下查看交换机系统版本, model, boot time, etc.

switch#Show Version

3. Set switch Time

Annotations: normal Cisco switches typically do not have battery storage time, the clock will revert to the initialization time after the switch restarts, we recommend configuring the NTP service.

#特权模式下显示交换机时间

switch#Show Clock

#特权模式下修改交换机时间

switch#Clock Set 17:42:00

4. Configure VLAN

#特权模式下进入Vlan子模式

switch#VLAN Database

#创建vlan并命名为test01

Switch (VLAN) #VLAN ten name test01

#退出Vlan配置模式

Switch (VLAN) #Exit

#返回到特权模式下查看Vlan创建情况

switch#Show VLAN

4 , delete VLANs

#特权模式下进入Vlan子模式

switch#VLAN Database

#删除已创建好的Vlan

Switch (VLAN) #no VLAN ten

#返回到特权模式下查看指定的Vlan创建情况

switch#show VLAN ID ten

5. to delimit a port into a specified VLAN

#全局模式下进入fa/01-Port mode

Switch (config) #interface fastethernet 0/1

#将fa0/1 ports divided into VLAN 10

Switch (config-if) #switchport access VLAN

#fa0/1 set to static VLAN access mode

Switch (config-if) #switchport mode access

#激活fa0/1 interface

Switch (config-if) #no shutdown

#全局模式下进入fa/02 Ports to FA0/10 Port mode

Switch (config) #interface range FastEthernet 0/2-10

#将入fa/02 Ports to FA0/10 ports divided into Vlan10

Switch (config-if-range) #switchport access VLAN

# fa/02 Port to FA0/10 Port set to static VLAN access mode

Switch (config-if-range) #switchport mode access

# Activate FA/02 port to FA0/10 Port

Switch (config-if-range) #no shutdown

#返回到特权模式下查看指定的Vlan创建情况

switch#show VLAN ID ten

#特权模式下保存配置

switch#Write

6 , delimits a port to a specified VLAN

#全局模式下进入fa/01-Port mode

Switch (config) #interface fastethernet 0/1

#将fa0/1 port from VLAN 10 (remove FA0/1 port from Vlan10)

Switch (config-if) #no switchport access VLAN

#全局模式下进入fa/02 Ports to FA0/10 Port mode

Switch (config) #interface range FastEthernet 0/2-10

#把fa0/2 ports and FA/10 from VLAN 10 (remove FA0/1 port from Vlan10)

Switch (config-if-range) #no switchport access VLAN

#特权模式下保存配置

switch#Write

7. set switch port operating mode

Callout: Cisco switch port three modes of operation

Access An Access port can only belong to one VLAN, and can only forward this VLAN data, mainly for access to terminal equipment, such as PC, server, print server, etc.

Trunk A trunk port belongs to multiple VLANs and can forward multiple VLAN data, primarily for connecting other switches to host multiple VLANs on the line

Dynamic Positive mode, active peer-to-peer negotiation, that is, the usual trunk mode takes precedence. Use trunk mode when you can negotiate the trunk mode with the peer, not the access mode.

#全局模式下进入fa/01 Mode

Switch (config) #interface fastethernet 0/1

#查看交换机支持哪些端口工作模式

Switch (config-if) #switchport mode?

Access Set trunking mode to ACCESS unconditionally

Dynamic Set trunking mode to dynamically negotiate access or trunk mode

Trunk Set trunking mode to TRUNK unconditionally

#将fa0/1 Port set to access mode

Switch (config-if) #switchport mode access

#将fa0/1 port set to trunk mode

Switch (config-if) #switchport mode dynamic

#将fa0/1 port set to trunk mode

Switch (config-if) #switchport mode trunk

#特权模式下查看端口工作模式

switch#Show Interfaces fastethernet 0/1 Switchport

Name:fa0/1

Switchport:enabled

Administrative Mode:trunk

Operational Mode:down

#特权模式下保存配置

switch#Write

8. Duplex Mode Settings

#全局模式下进入fa0/1 ports

Switch (config) #interface fastethernet 0/1

#自行选择, full-duplex mode, half half-duplex mode, auto Auto-select mode

Switch (config-if) #Duplex Full

#查看fa0/1-Port Duplex mode

switch#Show Interfaces fastethernet 0/1

Encapsulation ARPA, loopback not set

Keepalive Set (SEC)

full-duplex, 100mb/s

#保存配置

switch#Write

9 , configure IP addresses and gateways for VLANs

#全局模式下进入指定vlan 10

Switch (config) #interface VLAN

#配置vlan 10 IP address and subnet mask

Switch (config-if) #IP address 192.168.10.1 255.255.255.0

#全局模式下设置交换机所连域的域名test. com

Switch (config) #IP domain-name test.com

#激活端口

Switch (config-if) #no shutdown

#全局模式下设置网关地址

Switch (config) #IP default-gateway 192.168.10.254

#特权模式下查看vlan及接口状态

switch#show ip interface Brief

#特权模式下查看交换机网关地址

switch#Show Running-config

#特权模式下保存配置

switch#Write

Ten , configuring Telnet telnet

#全局模式下设置登陆特权加密密码, Telnet telnet requires a privileged login password to be set first

Switch (config) #enable secret 123456

#全局模式下进入虚拟线程配置模式, 0 to 4 means that up to 5 users of 0,1,2,3,4 are allowed remote Telnet login

Switch (config) # linevty 0 4

#设置登录口令 (remote telnet login switch password)

Switch (config-line) #password 654321

#设置远程telnet需要口令验证

Switch (config-line) #Login

#特权模式下查看telnet配置情况

switch#Show Running-config

Line vty 0 4

Password 654321

Login

#特权模式下保存配置

switch#Write

One , restore the Switch factory settings

#特权模式下执行出厂恢复设置, pop-up prompt press ENTER to confirm

switch#Write Erase

#特权模式下重启交换机, pop-up prompt press ENTER to confirm

switch#Reload

12. Switch Configuration Trunk port (trunk allows multiple VLANs through, Access allows only one VLAN through)

Callout: three layer switch with two layer switch to set the level of connection, three switch port default Dyna Auto,dyna Auto Port can synchronize subordinate switch port working mode trunk,

Layer three switches are automatically adapted to trunk, so just configure the two-layer switch port as trunk.

#全局模式下进入fa0/24 Port configuration

Switch (config) #interface fastethernet 0/24

#设置trunk口, allowing multiple VLANs to pass, typically to trunk ports on a three-layer switch

Switch (config-if) #switchport mode trunk

#激活端口

Switch (config-if) #no shutdown

#特权模式下保存配置

switch#Write

#查看fa0/24 Interface No trunk

switch#Show Interfaces fastethernet 0/24 Switchport

Name:fa0/24

Switchport:enabled

Administrative Mode: trunk

Cisco 2960 Switch Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.