switch常用的交换机配置命令

switch常用的交换机配置命令,第1张

switch常用的交换机配置命令

1.clock set:设置交换机的时间,日期。

Switch>en

Switch#clock set 12: 12: 12 10 oct 2017 //设置交换机的时间为2017年10月10日12点12分12秒

Switch#show clock //查看时间

*12: 12: 17.505 UTC ?? 10? 10 2017

2.hostname:用于修改交换机的主机名。

Switch#config terminal

Switch(config)#hostname mjl //将交换机命名为mjl

3.enable password:设置从一般用户配置模式进入特权配置模式时,需要输入的密码,明文。

Switch(config)#enable password 123456 //设置从一般用户配置模式进入特权配置模式时需要输入的密码为123456

Switch(config)# ^Z

Switch#exit                                //退出到一般模式

Switch>en                                  //从一般用户配置模式进入特权配置模式时需要输入密码

Password:                                  //输入密码123456进入特权配置模式

4.enable  secret:设置从一般用户配置模式进入特权配置模式时,需要输入的密码,密文。

Switch#config  terminal

Switch(config)#enable secret 654321   //设置从一般用户配置模式进入特权配置模式时需要输入的密码为654321

Switch(config)#^Z        //Ctrl+Z快捷键

Switch#exit                  //退出到一般模式

Switch>en

Password:                    //输入654321才能从一般用户配置模式进入特权配置模式

5.shutdown:关闭交换机的端口

Switch#config terminal

Switch(config)#interface  fastEthernet 0/1

Switch(config-if)#shutdown       //关闭交换机0/1端口

%link-5-CHANGED:Interface   FastEthernet0/1,changed  state  to  adminiseratively  down

%LINEPROTO-5-UPDOWN:Line  protocol  on  Interfaace  FastEthernet0/1,  changed  state  to  down

Switch(config-if)#no  shutdown    //否定关闭命令,打开0/1端口

%link-5-CHANGED:Interface   FastEthernet0/1,changed  state  to up

%LINEPROTO-5-UPDOWN:Line  protocol  on  Interfaace  FastEthernet0/1,  changed  state  to  up

6.reload:重启交换机。 启动配置文件 startup-config,当前运行配置文件running-config,保存当前运行配置文件为启动配置文件,以保证所做配置在交换机重启或掉电以后不好丢失。

Switch(config)#^Z         //退出到特权配置模式

Switch#reload              //重启交换机

Proceed  with  reload?[config]             //输入Y确认重启交换机

7.writ:保存当前运行配置文件为启动配置文件。

Switch>en

Switch#config  terminal

Switch(config)#enable password 123456

Switch(config)#exit

Switch#write    //保存当前运行配置文件为启动配置文件

Building configuration ...

[OK]

8.earse startup-config:删除启动配置文件

Switch>en

Password:

Switch#earse startup-config          //删除启动配置文件

Erase the nvram filesystem will remove all configuration files! Continue? [/confirm/i]

[OK]

Erase of nvram:complete

%SYS-7-NV_BLOCK_INIT:Initialized the geometry of nvram

Switch#

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5712989.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存