前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >思科交换机-常用命令及配置[通俗易懂]

思科交换机-常用命令及配置[通俗易懂]

作者头像
全栈程序员站长
发布2022-07-23 10:07:57
1.8K0
发布2022-07-23 10:07:57
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

switch> 用户模式

1:进入特权模式enable

switch> enable

switch#

2:进入全局配置模式configure terminal

switch> enable

switch#configure terminal

switch(conf)#

3:交换机命名hostname name 以cisco001 为例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname cisco001

cisco001(conf)#

4:配置使能口令(未加密)enable password cisco 以cisco 为例

switch> enable

switch#configure terminal

cisco001(conf)# enable password cisco

5:配置使能密码(加密)enable secret ciscolab 以cicsolab 为例

switch> enable

switch#configure terminal

switch(conf)# enable secret ciscolab

6:设置虚拟局域网vlan 1 interface vlan 1

switch> enable

switch#configure terminal

switch(conf)# interface vlan 1

switch(conf)# ip address 192.168.1.1 255.255.255.0 配置交换机端口ip 和子网掩码

switch (conf-if)#no shut 激活端口

switch (conf-if)#exit

switch (conf)#ip default-gateway 192.168.254 设置网关地址

7:进入交换机某一端口interface fastehernet 0/17 以17 端口为例

switch> enable

switch#configure terminal

switch(conf)# interface fastehernet 0/17

switch(conf-if)#

8:查看命令show

switch> enable

switch# show version 察看系统中的所有版本信息

show interface vlan 1 查看交换机有关ip 协议的配置信息

show running-configure 查看交换机当前起作用的配置信息

show interface fastethernet 0/1 察看交换机1 接口具体配置和统计信息

show mac-address-table 查看mac 地址表

9:交换机恢复出厂默认恢复命令

switch> enable

switch# erase startup-configure

switch# reload

10:交换机的密码恢复

拔下交换机电源线。

用手按着交换机的MODE 键,插上电源线

在switch:后执行flash_ini 命令:switch: flash_ini

查看flash 中的文件: switch: dir flash:

把“config.text”文件改名为“config.old”: switch: rename flash: config.text flash: config.old

执行boot: switch: boot

交换机进入是否进入配置的对话,执行no :

进入特权模式察看flash 里的文件: show flash :

把“config.old”文件改名为“config.text”: switch: rename flash: config.old flash: config.text

把“ config.text ” 拷入系统的“ running-configure ”: copy flash: config.text system :

running-configure

重新设置密码并保存。

11.交换机telnet 远程登录设置:

switch>en

switch#configure terminal

swich(conf)#enable password cisco 以cisco 为特权模式密码

swich(conf)#interface vlan 1 以vlan 1端口作为远程登录的接口,其他端口亦可

swich(conf-if)#ip address 192.168.1.1 255.255.255.0

swich(conf-if)#no shut

swich(conf-if)#exit

swich(conf)line vty 0 4 设置0-4 个用户可以telnet 远程登陆

swich(conf-line)#login

swich(conf-line)#password 123456

12.交换机ssh远程登录设置:

a.设定一个非默认的hostname

Switch(config)#hostname cisco

b.配置域名:

cisco(config)#ip domain-name test

c.指定加密长度:

cisco(config)#crypto key generate rsa

How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable…[OK]

d.将vty线路下的登录方式改为 ssh

cisco(config)#line vty 0 4

cisco(config-line)#transport in ssh

13.配置vtp同步

说明:VTP(VLAN Trunking Protocol):是VLAN中继协议,它是思科私有协议。作用是同步各个交换机之间的VLAN信息。

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/126176.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年4月7,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档