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

switch>用户模式1:进入特权模式enableswitch>enableswitch# 2:进入全局配置模式configureterminalswitch>enableswitch#configureterminalswitch(conf)# 3:交换机命名hostnamename以cisco001为例switch>enable

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

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.net/126176.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Ubuntu命令行下树莓派连接WiFi操作方法

    Ubuntu命令行下树莓派连接WiFi操作方法第一种方法:通过配置/etc/network/interfaces文件实现终端输入sudovim/etc/network/interfaces修改后文件内容如下:autoloifaceloinetloopbackifaceeth0inetdhcpautowlan0allow-hotplugwlan0ifacewlan0inetdhcpwpa-ssid”你的wifi名称”wpa-p

    2022年6月10日
    66
  • docker 镜像导入导出_镜像导出

    docker 镜像导入导出_镜像导出Docker镜像的导入导出本文介绍Docker镜像的导入导出,用于迁移、备份、升级等场景,准备环境如下:CentOS7.0Docker1.18导入导出命令介绍涉及的命令有export、import、save、loadsave命令dockersave[options]images[images…]示例dockersave-…

    2025年12月5日
    4
  • laravel 定时任务通过队列发送邮件[通俗易懂]

    laravel 定时任务通过队列发送邮件

    2022年2月15日
    45
  • 如何用公式编辑器打求和符号?

    如何用公式编辑器打求和符号?作为使用最广泛的公式编辑器,MathType中所包含的很多符号能够满足我们一般的学习工作需要,利用它能够毫不费力地编辑出各种各样的数学公式,除了常见的代数几何符号,集合符号以及概率统计等一些符号也有,还有一些模板可以直接使用。求和符号是概率统计中经常用到的一个符号,下面就来介绍用MathType打求和符号的方法。

    2022年8月31日
    6
  • 特斯拉笔试内容_数据库笔试题

    特斯拉笔试内容_数据库笔试题今天笔试一共两道题,1个小时内答出来,第一题如下两张图所示:正确sql为:selectsensor_id,count(distinctevent_type)fromeventsgroupbysensor_idorderbysensor_id效果如下图:第二道题如下两张图:,答案如下sql:selectid,server_name,casewhenconnections>(selectavg(conne…

    2025年6月21日
    2
  • Java 介绍

    1 Java 介绍 Java的历史 Java的历史非常有趣。 Java最初是为交互式电视而设计的,但是对于当时的数字有线电视行业来说,它是太先进的技术。 Java的历史始于绿色团队…

    2022年1月24日
    50

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号