导航:首页 > 程序命令 > 思科交换机常用命令

思科交换机常用命令

发布时间:2022-06-10 20:03:42

A. 10个常见cisco交换机的操作命令,并介绍其作用

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 ;设置登录口令xxswitch#exit ;返回命令

交换机VLAN设置:

switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(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 1switch(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 ;查看指定端口信息

2. 路由器支持的命令:

路由器显示命令:

router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动

路由器口令设置:

router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xxrouter(config)#(Ctrl+z) ; 返回特权模式router#exit ;返回命令

路由器配置:

router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置同步时钟router(config-if)#ip address ;设置IP地址router(config-if)#ip address second ;设置第二个IProuter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address ;设置子接口IProuter(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导

路由器文件操作:

router# running-config startup-config ;保存配置router# running-config tftp ;保存配置到tftprouter# startup-config tftp ;开机配置存到tftprouter# tftp flash: ;下传文件到flashrouter# tftp startup-config;下载配置文件ROM状态:

Ctrl+Break ;进入ROM监控状态

rommon>confreg 0x2142 ;跳过配置文件

rommon>confreg 0x2102 ;恢复配置文件

rommon>reset ;重新引导

rommon> xmodem: flash: ;从console传输文件

rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP

rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码

rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP

rommon>TFTP_FILE=c2600.bin ;指定下载的文件

rommon>tftpdnld ;从tftp下载

rommon>dir flash: ;查看闪存内容

rommon>boot ;引导IOS

静态路由:

ip route ;命令格式router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例

动态路由:

router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。router(config-router)#network ;设置发布路由router(config-router)#negihbor ;点对点帧中继用。

B. 思科三层交换机配置命令

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 ;查看指定端口信息
补充 :
3层交换机多出的就是路由能力,体现在vlan的互相通信功能和端口的路由能力,下面介绍:
开启路由功能:ip routing
进入vlan 配置网段网关与路由配置接口相同
interface vlan 1
ip 192.168.1.1 255.255.255.0
路由配置与路由器配置相同只是把接口换为VLAN+VLAN号,开启接口路由功能,进入接口配置:no swichport

C. 思科交换机配置命令

CISCO 3550交换机配置DHCP命令及步骤如下:

CISCO 3550交换机配置DHCP第一步:创建VLAN:

Switch>Vlan Database

Switch(Vlan)>Vlan 2 Name server

Switch(Vlan)>Vlan 3 Name work01

Switch(vlan)>Vlan 4 Name work02

CISCO 3550交换机配置DHCP第二步:启用DHCP中继代理:

/*关键一步,若缺少以下两条命令,在VLAN中使用“IP HELPER-ADDRESS DHCP服务器地址”指定DHCP服务器,客户机仍然不能获得IP地址*/

Switch>Enable

Switch#Config t

Switch(Config)Service Dhcp

Switch(Config)Ip Dhcp Relay Information Option

CISCO 3550交换机配置DHCP第三步:设置VLAN IP地址:

Switch(Config)>Int Vlan 2

Switch(Config-vlan)Ip Address 192.168.2.1 255.255.255.0

Switch(Config-vlan)No Shut

Switch(Config-vlan)>Int Vlan 3

Switch(Config-vlan)Ip Address 192.168.3.1 255.255.255.0

Switch(Config-vlan)No Shut

Switch(Config-vlan)>Int Vlan 4

Switch(Config-vlan)Ip Address 192.168.4.1 255.255.255.0

Switch(Config-vlan)No Shut

Switch(Config-vlan)Exit

D. 思科交换机的命令解释

3560_1(config)#interface range g1/1-2 ///进入接口组 g1和g2(千兆接口)
3560_1(config-if)#switch trunk enc dot1q ////(g1和g2)接口封装模式设置为802.1q
3560_1(config-if)#switch mode trunk ////(g1和g2)接口模式设置为干道模式(与交换机互联)
3560_1(config-if)#channel-group 2 mode on ////绑定以太网通道(把两条物理链路绑定为一条逻辑的链路,从而增加带宽,两条千兆接口的链路绑定后就为一条2千兆的链路),组号为2
3560_1(config)#spanning-tree vlan 50 root primary ////设置交换机为vlan50的生成树主根(PVST+协议)
3560_1(config)#spanning-tree vlan 51 root secondary ////设置交换机为vlan51的生成树次根(PVST+协议)
3560_1(config)#int vlan 50 ////进入vlan50的SVI(虚接口)
3560_1(config-if)#ip add 182.168.50.2 255.255.255.0 ////配置IP(这个不用说了吧)
3560_1(config-if)#standby 3 ip 182.168.50.1 //G3的虚地址 (配置vlan50的HSRP热备份路由的虚拟网关地址)
3560_1(config-if)#standby 3 pri 150 //设置优先级,默认为100 (很明显这台三层交换机是vlan50的活跃路由,只要是vlan50的数据包,都是由这台三层交换机来转发的)
3560_1(config-if)#standby 3 preempt //配置抢占(这个也不用说吧,不配的话,它不会抢)
3560_1(config-if)#standby 3 track g0/48 90 //跟踪上联链路,down后,优先级降90
3560_1(config)#int vlan 51 ////进入vlan50的SVI(虚接口)
3560_1(config-if)#ip add 182.168.51.3 255.255.255.0
3560_1(config-if)#standby 4 ip 182.168.51.1 (配置vlan51的HSRP热备份路由的虚拟网关地址)
3560_1(config-if)#standby 4 preempt //////配置占先权(这台交换机为vlan51的网关备份路由设备)
3560_1(config)#udld aggsive //开启udld,并设置为aggsive模式,产生单通就down
3560_1(config)#interface range g1/1-2
3560_1(config-if)#udld port aggsive //接口开启udld
这是一个非常经典的解决方案,希望你要理解每条命令的作用,还有协议的工作机制

E. 思科交换机的配置保存命令

1、首先打开思科交换CLI,从特权模式进入全局配置模式,如下图所示。

F. 思科2950交换机常用命令有哪些

交换机配置命令
类别 命令格式 命令含义
基本配置 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 进入虚拟终端
S(config-line)# password telnet_password 接上一条命令,设置Telnet口令
S(config-line)# login 允许Telnet登录
S(config)# enable password|secret privilege_password 配置特权口令(加密或不加密)
S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进入接口子配置模式
S(config-if)# [no] shutdown 关闭或启用该接口(默认启用)
S(config)# ip address IP_address sunbet_mask 指定IP地址
S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认网关
S# show running-config 查看当前的配置
S# running-config startup-config 将RAM中的当前配置保存到NVRAM中
S> show interface [type slot_#/port_#] 查看所有或指定接口的信息
S> show ip 显示交换机的IP配置(只在1900系列上可用)
S> show version 查看设备信息
S# show ip interface brief 验证IP配置
S(config-if)# speed 10|100|auto 设置接口速率
S(config-if)# plex auto|full|half 设置接口双工模式
S> show mac-address-table 查看CAM表
S# clear mac-address-table 清除CAM表中的动态条目
1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM表中创建静态条目
2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中创建静态条目
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 设置粘性学习特性能够学到的地址数量(默认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-address MAC_address 指定允许与此接口相关的确切的MAC地址

G. 思科交换机详细配置方法和命令

思科交换机的基本配置命令学习
一、交换机口令设置:

switch>enable ;进入特权模式
switch#config terminal ;进入全局配置模式

switch(config)#hostname csico ;设置交换机的主机名
switch(config)#enable secret
csico1 ;设置特权加密口令
switch(config)#enable password csico8 ;设置特权非密口令

switch(config)#line console 0 ;进入控制台口
switch(config-line)#line vty 0 4
;进入虚拟终端
switch(config-line)#login ;虚拟终端允许登录
switch(config-line)#password
csico6 ;设置虚拟终端登录口令csico6
switch#exit ;返回命令

二、交换机显示命令:
switch#write ;保存配置信息

switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show
vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0
;查看指定端口信息
switch#show int f0/0 status;查看指定端口状态
switch#dir flash: ;查看闪存

Cisco路由器配置命令大全网络 2010-06-26 06:43:44 阅读657 评论0 字号:大中小 订阅 .

(1)模式转换命令
用户模式----特权模式,使用命令"enable"
特权模式----全局配置模式,使用命令"config
t"
全局配置模式----接口模式,使用命令"interface+接口类型+接口号"

全局配置模式----线控模式,使用命令"line+接口类型+接口号"
注:
用户模式:查看初始化的信息.

特权模式:查看所有信息、调试、保存配置信息
全局模式:配置所有信息、针对整个路由器或交换机的所有接口
接口模式:针对某一个接口的配置

线控模式:对路由器进行控制的接口配置
(2)配置命令
show running config 显示所有的配置
show
versin 显示版本号和寄存器值
shut down 关闭接口
no shutdown 打开接口
ip add +ip地址
配置IP地址
secondary+IP地址 为接口配置第二个IP地址
show interface+接口类型+接口号 查看接口管理性

show controllers interface 查看接口是否有DCE电缆
show history 查看历史记录
show
terminal 查看终端记录大小
hostname+主机名 配置路由器或交换机的标识
config memory
修改保存在NVRAM中的启动配置
exec timeout 0 0 设置控制台会话超时为0
service password-encryptin
手工加密所有密码
enable password +密码 配置明文密码
ena sec +密码 配置密文密码
line vty 0
4/15 进入telnet接口
password +密码 配置telnet密码
line aux 0 进入AUX接口
password
+密码 配置密码
line con 0 进入CON接口
password +密码 配置密码
bandwidth+数字 配置带宽

no ip address 删除已配置的IP地址
show startup config 查看NVRAM中的配置信息

run-config atartup config 保存信息到NVRAM
write 保存信息到NVRAM
erase
startup-config 清除NVRAM中的配置信息
show ip interface brief 查看接口的谪要信息
banner
motd # +信息 + # 配置路由器或交换机的描素信息
description+信息 配置接口听描素信息
vlan database
进入VLAN数据库模式
vlan +vlan号+ 名称 创建VLAN
switchport access vlan +vlan号
为VLAN为配接口
interface vlan +vlan号 进入VLAN接口模式
ip add +ip地址 为VLAN配置管理IP地址

vtp+service/tracsparent/client 配置SW的VTP工作模式
vtp +domain+域名 配置SW的VTP域名

vtp +password +密码 配置SW的密码
switchport mode trunk 启用中继
no vlan +vlan号
删除VLAN
show spamming-tree vlan +vlan号 查看VLA怕生成树议

三. 路由器配置命令
ip
route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由
show ip route 查看路由表
show protocols
显示出所有的被动路由协议和接口上哪些协议被设置
show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用

的定时器
等信息
router rip 激活RIP协议
network +直连网段 发布直连网段

interface lookback 0 激活逻辑接口
passive-interface +接口类型+接口号 配置接口为被动模式

debug ip +协议 动态查看路由更新信息
undebug all 关闭所有DEBUG信息
router eigrp +as号
激活EIGRP路由协议
network +网段+子网掩码 发布直连网段
show ip eigrp neighbors 查看邻居表

show ip eigrp topology 查看拓扑表
show ip eigrp traffic 查看发送包数量
router
ospf +process-ID 激活OSPF协议
network+直连网段+area+区域号 发布直连网段
show ip ospf
显示OSPF的进程号和ROUTER-ID
encapsulation+封装格式 更改封装格式
no ip admain-lookup
关闭路由器的域名查找
ip routing 在三层交换机上启用路由功能
show user 查看SW的在线用户
clear line
+线路号 清除线路

四. 三层交换机配置命令
配置一组二层端口
configure terminal 进入配置状态

nterface range {port-range} 进入组配置状态
配置三层端口
configure terminal 进入配置状态

interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} |
{port-

channel port-channel-number} 进入端口配置状态
no switchport
把物理端口变成三层口
ip address ip_address subnet_mask 配置IP地址和掩码
no shutdown 激活端口

例:
Switch(config)# interface gigabitethernet0/2
Switch(config-if)#
no switchport
Switch(config-if)# ip address 192.20.135.21 255.255.255.0

Switch(config-if)# no shutdown
配置VLAN
configure terminal 进入配置状态

vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改

H. 交换机的常用配置命令

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

思科交换机常用命令——创建并划分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)

思科交换机常用命令——调试命令

a、显示所有配置命令:Switch#show run

b、显示所有接口状态:Switch#show ip int brief

c、显示所有VLAN的信息:Switch#show vlan brief

cisco交换机还是比较常用的,于是我研究了一下Cisco交换机命令的大总结,在这里拿出来和大家分享一下,希望对大家有用。我所针对的都是Cisco的设备而言的,华为的可以跟据手册来查,配置都是差不多的,这里华子就不多写华为的设备了,了解的也不是很多。

Cisco交换机命令之使用Telnet远程式管理

switch(config)#interface vlan 1 进入vlan 1

switch(config-if)#ip address 设置IP地址

switch(config-if)#ip default-gateway 设置默认网关

switch(config)#line vty 0 4 进入虚拟终端

switch(config-line)#login 允许登录

switch(config-line)#password xx 设置登录口令

switch#exit 返回命令

Cisco交换机命令之控制台口令

switch(config)#line console 0 进入控制台口

switch(config-line)#login 允许登录

switch(config-line)#password xx 设置登录口令

switch#exit 返回命令

Cisco交换机命令之基本接口配置

switch(config)#interface f0/1 进入f0/1接口

switch(config-if)#plex full 配置全双工模式

switch(config-if)#speed 100 配置速率

switch(config-if)#description to ***** 接口描述

switch(config)#ip domain-name ***.com 设置或名服务器

switch(config)#mac-address-table aging-time 设置mac表超时时间

switch#write 保存配置信息

switch# running-config startup-config 保存当前配置nvram

switch#erase startup-config 清除配置文件

Cisco交换机命令之交换机VLAN设置:

switch#vlan database 进入VLAN设置

switch(vlan)#vlan 2 建VLAN 2

switch(vlan)#name 名字 建VLAN 2的名称

switch(vlan)#no vlan 2 删vlan 2

注:删除vlan时原属于此vlan的端口处于非激活状态,直到重新分配为止。

switch(config)#int f0/1 进入端口1

switch(config-if)#switchport mode access 当前端口工作莫试

switch(config-if)#switchport access vlan 2 当前端口加入vlan 2

switch(config-if)#switchport mode trunk 设置为干线

switch(config-if)#switchport trunk encapsulation dot1q 设置vlan 中继协议

switch(config-if)#no switchport mode 或 ( switchport mode access) 禁用干线

switch(config-if)#switchport trunk allowed vlan add 1,2 ; 从Trunk中添加vlans

switch(config-if)#switchport trunk allowed vlan remove 1,2 ;从Trunk中删除vlans

switch(config-if)#switchport trunk pruning vlan remove 1,2 ;从Trunk中关闭局部修剪

Cisco交换机命令之以太网通道配置

switch(config)#interface range fasternet0/1 - 2 将fasternet0/1和0/2 口捆绑

switch(config-if)#channel-group 1 mode on 配置以太通道模式

switch(config-if)#port-channel load-balance {dst-mac | src-mac}在链路间实现负载均衡

switch#show etherchannel 1 summary 查看通道信息

switch#show etherchannel load-balance 查看通道信息

Cisco交换机命令之vtp配置

switch(config)#vtp domain 设置vtp域名

switch(config)#vtp password 设置vtp密码

switch(config)#vtp mode server 设置vtp服务器模式

switch(config)#vtp mode client 设置vtp客户机模式

switch(config)#vtp mode transparent 设置vtp 透明模式

switch(config)#vtp version 设置vtp版本

switch(config)#vtp pruning 启用vtp修解

switch(config)#no vtp pruning 关闭vtp修解

注:要想从vtp中减少一台交换机只需将该交换机vtp 名更改

Cisco交换机命令之生成树stp:

switch(config)#spanning-tree vlan 启用stp生成树(基于vlan)

switch(config)#spanning-tree vlan root primary 指定根交换机(基于vlan)

switch(config)#spanning-tree vlan root secondary 指定备用根交换机(基于vlan)

switch(config)#spanning-tree vlan priority 指定交换机优先级(基于vlan)

switch(config)#no spanning-tree vlan priority 将交换机的优先级恢复默认值(基于vlan)

switch(config-if)#spanning-tree vlan cost 指定端口成本(起用trunk的端口模式下)

switch(config-if)#spanning-tree vlan port-prioty 指定交换机端口优先级(基于vlan)

switch(config-if)#spanning-tree portfast 配置速端口(连接终端设备的端口状态)如pc机

switch(config)#spanning-tree uplinkfast 配置上行速端口

switch(config)#spanning-tree vlan hello-time 配置交换机hello时间(基于vlan)

switch(config)#spanning-tree vlan forward-time 修改转发延迟计时器(基于vlan)

switch(config)#spanning-tree vlan max-time 修改最大老化时间(基于vlan)

switch#show spanning-tree summery 检测vlan生成树配置

switch#show spanning-tree vlan detail 浏览详细生成树配置信息

switch#show spanning-tree interface detail 浏览详细生成树端口配置信息

Cisco交换机命令之交换机显示命令:

switch#show vtp status 查看vtp配置信息

switch#show running-config 查看当前配置信息

switch#show vlan 查看vlan配置信息

switch#show interface 查看端口信息

switch#show int f0/0 查看指定端口信息

switch#dir flash: 查看闪存

switch#show version 查看当前版本信息

switch#show mac-address-table aging-time 查看mac超时时间

switch#show cdp cisco设备发现协议 (可以查看聆接设备)

switch#show cdp traffic 杳看接收和发送的cdp包统计信息

switch#show cdp neighbors 查看与该设备相邻的cisco设备

switch#show interface f0/1 switchport 查看有关switchport的配置

switch#show cdp neighbors 查看与该设备相邻的cisco设备

I. 思科2960交换机配置命令都有哪些

思科2960交换机配置命令如下:

1、access: 主要用来接入终端设备,如PC机、服务器、打印服务器等。

2、trunk: 主要用在连接其它交换机,以便在线路上承载多个vlan。

3、multi: 在一个线路中承载多个vlan,但不像trunk,它不对承载的数据打标签。主要用于接入支持多vlan的服务器或者一些网络分析设备。现在基本不使用此类接口,在cisco的网络设备中,也基本不支持此类接口了。


(9)思科交换机常用命令扩展阅读:

交换机口令设置:

1、switch>enable;进入特权模式、switch#configterminal;进入全局配置模式、switch(config)#hostname;设置交换机的主机名。

2、switch(config)#enablesecretxxx;设置特权加密口令、switch(config)#enablepasswordxxa;设置特权非密口令。

3、switch(config)#lineconsole0;进入控制台口、switch(config-line)#linevty04;进入虚拟终端。

4、switch(config-line)#login;允许登录、switch(config-line)#passwordxx;设置登录口令xx、switch#exit;返回命令。

J. 思科交换机关闭端口命令

思科交换机关闭端口命令是shut down。

思科shutdown是关闭接口,接口状态会变为DOWN,no shutdown是激活接口,状态变为UP。

多数Cisco交换机默认具有处于非连接状态的端口。这表示端口当前没有连接到任何设备,但如果将其连接到其他正常运行的设备,它将可以建立连接。



Cisco的工作模式

Cisco设备有常用模式为:用户模式、特权模式、全局模式、端口模式。它们之间呈现出递进关系:用户模式->特权模式->全局模式->端口模式。

1、用户模式

交换机启动完成后按下Enter键,首先进入的就是用户模式,在些用户模式下用户将受到极大的限制,只能用来查看一些统计信息。

Switch>

2、特权模式

在用户模式下输入enable(可简写为en(命令就可以进入特权模式,用户在该模式下可以查看并修改Cisco设备的配置。

Switch>en

Switch#

3、全局配置模式在特权模式下输入config terminal(可简写conf t)命令即可,用户在该模式下可修改交换机的全局配置。如修改主机名。

Switch#conf t

Switch(config)#

4、接口模式

在全局配置模式下输入interface fastethernet 0/1(可简写int f0/1)就可以进入到接口模式,在这个模式下所做的配置都是针对f0/1这个接口所设定的。如设定IP等

Switch(config)#int f0/1

Switch(config-if)#

退回到上一模式用exit命令

阅读全文

与思科交换机常用命令相关的资料

热点内容
卖木材用什么app好 浏览:897
年卡app哪个好用 浏览:683
x21微信如何设置加密 浏览:601
安卓开机音乐压缩包名字是什么 浏览:228
压缩气体气压怎么算 浏览:587
手机怎样建造文件夹 浏览:850
websocket编程 浏览:677
全球十大加密货币友好国家 浏览:427
咸鱼app什么卖的最好 浏览:305
51单片机c语言proteus 浏览:827
电视看pdf文件 浏览:534
网盘文件夹能锁吗 浏览:544
云服务器断开鼠标不消失 浏览:549
javattl 浏览:403
服务器为什么配置价格不一样 浏览:42
javareplaceall正则表达式 浏览:261
编译器本身使用包 浏览:231
加盟什么项目前景好app 浏览:305
河源数据加密电话 浏览:627
邮件服务器怎么清洗 浏览:862