-
交换机配置命令
类别
命令格式
命令含义
进入特权模式
S>
enable
进入全局配置模式
S#
configure terminal
改变交换机名称
S(config)#
hostname
name
S(config)#
enable password level
level_# password
设置用户口令(
level_#=1)
或特权口令(
level_#=15)
进入控制台接口
S(config)#
line console
0
接上一条命令,设置控制台口令
S(config-line)#
password
console_password
进入虚拟终端
S(config)#
line vty 0 15
接上一
条命令,设置
Telnet
口令
S(config-line)#
password
telnet_password
允
许
Telnet
登录
S(config-line)#
login
S(config)#
enable
password|secret
配置特权口令(加密或不加密)
privilege_password
S(config)#
interface
进入接口子配置模式
etherne
t|fastethernet|gigabitethernet
slot_#/port_#
关闭或启用该接口(默认启用)
S(config-if)#
[no]
shutdown
指定
IP
地址
S(config)#
ip
address
IP_address
sunbet_mask
S(config)#
ip default-
gateway
router's_IP_address
指定哪台路由器地址为默认网关
查看当前的配置
S#
show running-
config
将
RAM
中的当前配置保存到
NVRAM
中
< br>
S#
copy running-config
startup-config
查看所有或指定接口的信息
S>
show interface
[type slot_#/port_#]
显示交换机的
IP
配置(只在
1900
系列上可用)
S>
show ip
查看设备信息
S>
show version
验证
IP
配置
基
本
配
S#
show ip interface brief
设置接口速率
置
S(config-
if)#
speed 10|100|auto
设置接口双工模式
S(config-if)#
duplex
auto|full|half
查看
CAM
表
S>
show mac-address-
table
清除
CAM
表中的动态条目
S#
clear mac-address-table
1900(config)#
mac-address-
table
permanent
在
CAM
表中创建静态条目
MAC_address type
[slot_#/]port_#
2950(config)#
mac-address-
table
static
在
CAM
表中创建静态条目
MAC_address
vlan
VLAN_#
interface
type [slot_#/]
port_#
1900(config)#
mac-address-
table
restricted
static
设置静态端口安全措施
MAC_address source_port
list_of_allowed_interface
启用粘性学习
1900(config-if)#
port
secure
1900(config-if)#
port secure max-mac-count
value
设置粘性学习特性能够学到的地址数量(默认
p>
132
,取值
范围是
1-132
)
1900(config)#
address-
violation
改变安全选项
suspend|ignore|disable
验证端口安全措施
1900>
show mac-address-table
security
定义接口为主机端口而不是中继端口
2950(config)#
switchport
mode access
启用端口安全措施
2950(config)#
switchport
port-security
2950(config)#
switchport
port-security
maximum
指定可与此接口相关的设备的最大数量
value
2950(config)#
switchport
port-security
violation
指定出现安全违规时应该发生的事
protect|restrict|shutdown
2950(config)#
switchport
port-security
指定允许与此接口相关的确切的
MAC
地址
mac-address
MAC_address
2950(config)#
switchport
port-security
启用粘性学习特性
mac-
address sticky
2950(config)#
show
port
interface
type
[slot_#/]
验证接口配置
port_#
设置接口描述信息
2950(config-if)
description
name
查看系统缓存的大小
2950#
show buffers
1900#
copy
nvram
tftp://
将配置文件备份到<
/p>
TFTP
服务器上
IP_address_of_TFTP_server/
file_name
1900#
copy
tftp://
IP_address_of_TFTP_server/
从
TFTP
服务器上恢复配置到
NVRA
M
file_name
nvram
删除配置文件
1900#
delete nvram
删除配置文件
2950#
erase startup-config
查看
TCAM
剩余容量
3550#
show tcam
qos
TCAM_ID
statistics
进入特权模式
4000>
enable
设置用户模式密码
4000>(enable)
set
password
设置授权密码
4000>(enable)
set
enablepass
4000>(enable)
set interface
sc0
IP_address
mask
配置
IP
地址
4000>(enable)
set port
enable|disable
slot_#/port_#
启用<
/p>
/
禁用接口
显示接口信息
4000>(enable)
show
port
[slot_#/port_#]
4000>(enable)
set port
name
slot_#/port_#
name
设置交换机接口描述信息
4000>(enable)
set
port
speed
slot_#/port_#
设置交换机接口速率
4|10|16|100|auto
设
置交换机接口双工模式
4000>(enable)
set port
duplex
slot_#/port_#
full|half
删除
NVRAM
中的配置信息
4000>(enable)
clear config
all
删除
FLASH
中的内容
4000>(enable)
erase all
显示
FLASH
中的内容
4000>(enable)
show
flash
4000>(enable)
show
cam
[count]
显示
CAM
表
dynamic|static|permanent|system
< br>
[vlan_#]
定义交换机域名
1900(config)#
vtp
domain
VTP_domain_name
定义交换机
VTP
模式(默认服务器)
1900(config)#
vtp
server|client|transparent
配置
VTP
口令
1900(config)#
vtp
password
VTP_password
启用
p>
/
禁用修剪(默认启用)
1900(config)#
vtp pruning
enable|disable
启用
SNMP
陷阱(默认启用)
1900(config)#
vtp trap
enable
验证
VTP
配置
1900#
show vtp
VLAN
2950#
vtp database
访问
p>
VLAN
和
VTP
配置
(以下均是在
IOS12.1
前用
,
12.1
后全是在全局配置模式下)
定义交换机域名
定义交换机
VTP
模式(默认服务器)
< br>配置
VTP
口令
启用
/
禁用修剪(默认启用)
启用
SNMP
陷阱(默认启用)<
/p>
检查
VTP
配
置
2950(vlan)#
vtp
domain
VTP_domain_name
2950(vlan)#
vtp
server|client|transparent
2950(vlan)#
vtp
password
VTP_password
2950(vlan)#
vtp
pruning
2950(config)#
snmp-server
enable traps vtp
2950#
show vtp status
显示与
VTP
消息发送与接收相关的
VTP
统计信息
2950#
show vtp
counters
指定中继类型
1900(config-if)#
trunk
on|off|desirable|auto
验证接口中继
(
A
是
fa0/26
< br>,
B
是
fa0/27
)
1900#
show trunk A|B
2950(config-if)#
switchport
mode
trunk|dynamic
指定中继类型
(
默认自动协商)
desirable|dynamic
auto|nonegotiate
2950(config-if)#
switchport
trunk
配置中继
native|allowed|pruning vlan
VLAN_#
2950(config-if)#
switchport
trunk
pruning
vlan
清除不希望消减的
VLAN
remove
VLAN_#
2950#
show
interfaces
[type
0/port_#]
验证接口中继
switchport|trunk
1900(config)#
vlan
VLAN_#
[
name
VLAN_name
]
创建
VLAN
1900(config-if)#
vlan-
membership static
VLAN_#
将该接口静态地分配给一个
VLAN
验证
VLAN
1900#
show vlan
<
/p>
查看
VLAN
成员关系
< br>
1900#
show vlan-
membership
查看
VLAN
的
STP
信息
1900#
show
spantree
[VLAN_#]
进入
VLAN
数据库(
ISO12.1
前用)
2950#
vlan
database
创建
VLAN
2950(vlan)#
vlan
VLAN_#
[
name
VLAN_name
]
进入
VLAN
数据库(
IS
O12.1
后用)
2950(config)#
vlan
VLAN_#
创建
VLAN
2950(config-vlan)#
name
VLAN_name
指定连接是接入链路连接
2950(config-if)#
switchport
mode access
2950(config-if)#
switchport access vlan
VLAN_#
指定
< br>VLAN
是接入链路连接
4000>(enable)
set
vlan
VLAN_#
name
VLAN_name
配置
VLAN
为
VLAN
分配端口
4000>(enable)
set
vlan
VLAN_#
slot_#/port_#-port_#
4000>(enable)
set
trunk
slot_#/port_#
p>
[on|off|desirable|auto|nonegotiate]
[VLAN_#]
配置中继
[isl|dot1q|dot10|lane|negotiate]
4000>(enable) clear trunk slot_#/port_#
VLAN_#
删除
VLAN
验证中继端口
4000>(enable)
show
trunk
slot_#/port_#
配置
VTPv2
4000>(enable)
set vtp v2
enable
4000>(enable)
set
vtp
[
domain
name
]
[
mode
设置
VTP
client|server|transparent
]
[
passwd
password
]
[
pruning
enable|disable
] [
v2
enable|disable
]
验
证
VTP
域的信息
4000>(enable)
show vtp
domain
显示发出或收到的
VT
P
通告信息的摘要内容
4000>(enable)
show vtp
statistics
设置
VTP<
/p>
消减
4000>(enable)
set vtp pruneeligible
VLAN_#
清除不希望消减的
VLAN
4000>(enable)
clear vtp
pruneeligible
VLAN_#
4000>(enable)
set spantree
enable|disable
VLAN_#
2950(config)#
[no] spanning-
tree vlan
VLAN_#
4000>(enable)
show
spantree
[VLAN_#]
2950#
show spanning-
tree
启用
/
禁用
STP
(默认启用)
启用
/
禁用
STP<
/p>
(默认启用)
STP
验
证
STP
状态
-
-
-
-
-
-
-
-
-
上一篇:挠性印制电路板(FPC)自动化生产线技术升级项目环评报告
下一篇:餐饮英语大全