导航:首页 > 程序命令 > 思科交换机基础命令

思科交换机基础命令

发布时间:2025-02-05 14:13:47

1. cisco基本配置命令

Cisco 的交换机产品以“Catalyst ”为商标,包含1900 、2800 、2900 、3500 、4000 、5000 、5500 、6000 、8500 等十多个系列。

基本配置命令如下:

1、Switch>enable 进入特权模式

2、Switch #config terminal 进入全局配置模式

3、Switch(config)#hostname 设置交换机的主机名

4、Switch(config)#enable password 进入特权模式的密码(明文形式保存)

5、Switch(config)#enablesecret 加密密码(加密形式保存) (优先)

6、Switch(config)#ipdefault-gateway 配置交换机网关

7、Switch(config)#showmac-address-table 查看MAC地址

8、Switch(config)loggingsynchronous 阻止控制台信息覆盖命令行上的输入

9、Switch(config)no ipdomain-lookup 关闭DNS查找功能

10、Switch(config)exec-timeout 00 阻止会话退出

(1)思科交换机基础命令扩展阅读

cisco常用配置命令:

一、使用Telnet远程式管理

1、Switch(config)#line vty 0 4 进入虚拟终端

2、Switch (config-line)# password 设置登录口令

3、Switch(config-line)# login 要求口令验证

二、控制台口令

1、switch(config)#lineconsole 0 进入控制台口

2、switch(config-line)# password xx

3、switch(config-line)#设置登录口令login 允许登录

三、恢复出厂配置

Switch(config)#erasestartup-config

Switch(config)delete vlan.dat

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

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

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号或旧的来进行修改

3. 思科交换机常用命令及配置

1.设置主机名/系统名 switch(config)# hostname “hostname” switch(enable) set system name name-string
2.设置登录口令 switch(config)# enable password level 1 password switch(enable) set password
switch(enable) set enalbepass
3.设置远程访问 switch(config)# inte***ce vlan 1
switch(config-if)# ip address ip-address netmask
switch(config-if)# ip default-gateway ip-address switch(enable) set inte***ce sc0 ip-address netmask broadcast-address
switch(enable) set inte***ce sc0 vlan
switch(enable) set ip route default gateway
4.启用和浏览CDP信息 switch(config-if)# cdp enable
switch(config-if)# no cdp enable switch(enable) set cdp {enable|disable} mole/port
5、给交换机配置使能密码,进入特权模式时需要输入密码才能进入,避免设备可以被其他人员使用。cisco-sw1(config)#enable secret ciscoswitchps:secret表示密码用的密文
6、交换机配置VLAN,并给将端口加入到该VLAN:cisco-sw1(config)#vlan 2cisco-sw1(config-vlan)#name testcisco-sw1(config-vlan)#exitcisco-sw1(config)#interface fastEthernet 0/1cisco-sw1(config-if)#switchport mode accesscisco-sw1(config-if)#switchport access vlan 2
7、进入交换机某一端口switch enableswitch#configure terminalswitch(conf)# interface fastehernet 0/1switch(conf-if)#
8、show:查看命令,交换机的所有配置和其它相关信息都需要通过show命令查看。switch enableswitch# show version 察看系统中的所有版本信息switch#show vlan id 1 查看交换机有关vlan配置信息switch#show running-configure 查看交换机当前起作用的配置信息switch#show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息switch#show mac-address-table 查看mac地址转发表
9、交换机恢复出厂switch enableswitch# erase startup-configureswitch# reload
10、telnet 远程登录设置:switchenswitch#configure terminalswich(conf)#enable password cisco 以cisco 为特权模式密码swich(conf)#interface vlan 1 以vlan 1端口作为远程登录的接口,其他端口亦可swich(conf-if)#ip address 192.168.1.1 255.255.255.0swich(conf-if)#no shutswich(conf-if)#exitswich(conf)line vty 0 4 设置0-4 个用户可以telnet 远程登陆swich(conf-line)#password 123456swich(conf-line)#login
11、SSH远程登录设置:Switch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname cisco-sw1
交换机重新命名cisco-sw1(config)#ip domain-name cisco.com
配置域名cisco-sw1(config)#line vty 0 4cisco-sw1(config-line)#transport input ssh
登录方式为SSHcisco-sw1(config-line)#exitcisco-sw1(config)#crypto key generate rsa
配置秘钥The name for the keys will be: cisco-sw1.cisco.comChoose the size of the key molus in the range of 360 to 2048 for yourGeneral Purpose Keys. Choosing a key molus greater than 512 may takea few minutes.How many bits in the molus [512]: 1024
思科推荐使用1024% Generating 1024 bit RSA keys, keys will be non-exportable

阅读全文

与思科交换机基础命令相关的资料

热点内容
皓强工具解压步骤 浏览:688
部队抗洪抢险命令范文 浏览:886
欧姆龙plc编程软件使用教程 浏览:592
ai文件pdf 浏览:911
腾讯云服务器挂载混合云 浏览:758
智能小车用什么单片机 浏览:463
java怎么给窗口关闭 浏览:940
列举51单片机的寻址方式 浏览:706
剪辑app怎么写长篇文字 浏览:400
app专属流量过月租怎么不更新 浏览:654
王者程序员都有谁 浏览:76
给牛换脚掌解压 浏览:387
围棋有多少种算法 浏览:602
unity资源包在哪个文件夹 浏览:704
阿里云服务器远程链接不成功 浏览:482
文件系统pdf 浏览:766
原神安卓区服什么意思 浏览:37
贝壳app怎么线上发布 浏览:161
如何挑选安卓系统机顶盒 浏览:54
安卓快充使用有什么注意事项 浏览:910