交换机命令行基本配置
3.1 问题
修改及查看交换机配置
1)修改交换机主机名
2)查看交换机配置信息
3)查看IOS名称以及版本信息
3.2 方案
在Packet Tracer程序主窗口中,添加一台Cisco 2960交换机,进入交换机,输入相关命令进行配置和查看交换机
3.3 步骤
步骤一:修改交换机主机名
进入全局配置模式后,使用hostname指令可以为交换机设置主机名。例如,以下操作可以将主机名设置为s1:
Switch(config)# hostname s1 //配置主机名
s1(config)#
步骤二:查看交换机配置信息
查看交换机当前的运行配置:
- 查看交换机当前的运行配置(或write terminal):
- s1# show running-config //查看当前的运行配置
- Building configuration...
- Current configuration : 1052 bytes
- !
- version 12.2
- no service timestamps log datetime msec
- no service timestamps debug datetime msec
- no service password-encryption
- !
- hostname sw1 //已配置主机名
- !
- !
- !
- !
- spanning-tree mode pvst
- !
- interface FastEthernet0/1
- !
- 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
- !
- interface FastEthernet0/11
- !
- interface FastEthernet0/12
- !
- interface FastEthernet0/13
- !
- interface FastEthernet0/14
- !
- 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 Vlan1
- no ip address
- shutdown
- !
- !
- line con 0
- !
- line vty 0 4
- login
- line vty 5 15
- login
- !
- !
- end
- sw1#
步骤三:查看IOS名称以及版本信息
查看ios名称及版本信息
- s1#show version
- Cisco Internetwork Operating System Software
- IOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA4, RELEASE SOFTWARE(fc1)
- Copyright (c) 1986-2005 by cisco Systems, Inc.
- Compiled Wed 18-May-05 22:31 by jharirba
- Image text-base: 0x80010000, data-base: 0x80562000
- ROM: Bootstrap program is is C2950 boot loader
- Switch uptime is 1 minutes, 39 seconds
- System returned to ROM by power-on
- Cisco WS-C2950-24 (RC32300) processor (revision C0) with 21039K bytes of memory.
- Processor board ID FHK0610Z0WC
- Last reset from system-reset
- Running Standard Image
- 24 FastEthernet/IEEE 802.3 interface(s)
- 63488K bytes of flash-simulated non-volatile configuration memory.
- Base ethernet MAC Address: 00E0.B026.B88C
- Motherboard assembly number: 73-5781-09
- Power supply part number: 34-0965-01
- Motherboard serial number: FOC061004SZ
- Power supply serial number: DAB0609127D
- Model revision number: C0
- Motherboard revision number: A0
- Model number: WS-C2950-24
- System serial number: FHK0610Z0WC
- Configuration register is 0xF