cisco交换机配置方法

PS

1.如代码能缩写尽量缩写节省时间   命令唯一才可以使用缩写方式

 比如:config terminal 缩写为 conf t 即可

2.查看配置信息,只能在特权模式下查看

3.如果代码只记得前几位,直接按tab键补全,或者?查找一下

4.翻看show的信息 按空格一屏一屏翻看,按回车一行一行查看

5.取消任何操作,在输入的代码开头添加no

1.用户模式:

Switch>

2.特权模式:

Switch>enable    缩写en

返回结果:Swith#

3.全局配置模式:

Swith#config terminal     缩写conf t

返回结果:Switch(config)#

4.接口配置模式:

Switch(config)#interface faastEthernet 0/1  缩写int f 0/1

返回结果:Swith(Config-if)#

5.指定端口描述:(必须进入接口配置才可以添加描述)

Switch(config)#int f0/1                    指定1号端口

Switch(config-if)#description 描述   缩写 des 描述

PS:必须在特权模式下查看   show int

5.Line模式:

Switch(Config)#ine Console 0

返回结果:Switch(Config-line)#

6.修改服务器名字

Switch(config)#hostname CCNA(主机名)

返回结果:CCNA(config)#

PS:全局配置模式才能修改

7.查看当前配置

Switch#show running-config   缩写 sh  run

8.运行的配置信息写入内存

Swith#write

或者

Switch#copy running-config startup-config

9.清除写入内存中的 配置信息

Swith#erase startup-config

PS:需要重启启动交换机(reload)

10.查看MAC地址表(特权模式查看)

Switch#show mac-address-table

返回结果:(有收发送数据才能显示下面的端口号)

Mac Address Table

-----------------------------------------------------------------------------------------------

Vlan   Mac            Address Type          Ports

---- ----------- -------- --------- ----------- -------- --------- ----------- -------- -----

1  0001.c9bb.a765         DYNAMIC    Fa0/16

1   00d0.d33c.1788        DYNAMIC    Fa0/1

1  00e0.b0be.d9b2         DYNAMIC    Fa0/9

11.设置console端口密码

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#line console 0

Switch(config-line)#password 密码

Switch(config-line)#login

Switch(config-line)#end

12.取消console端口密码

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#line console 0

Switch(config-line)#no password

Switch(config-line)#end

13.设置特权模式(enable)密码

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#enable password cisco

Switch(config)#exit

Switch#

%SYS-5-CONFIG_I: Configured from console by console

Switch#disable

14.取消特权模式(enable)密码

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#no enable password

Switch(config)#exit

Switch#

%SYS-5-CONFIG_I: Configured from console by console

Switch#disable

15.设置的明文密码加密

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#service password-encryption

Switch(config)#end

%SYS-5-CONFIG_I: Configured from console by console

Switch#disable

返回结果:

Switch#show running-config

Building configuration...

Current configuration : 1014 bytes

!

version 12.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

service password-encryption

!

hostname Switch

!

enable password 7 0822455D0A16

!

16.取消设置的明文密码加密

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#no service password-encryption

Switch(config)#end

%SYS-5-CONFIG_I: Configured from console by console

Switch#disable

17.本地用户登录设置方法

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#line console 0

Switch(config-line)#login local

Switch(config-line)#end

18.取消本地用户登录设置方法

Switch>en

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#line console 0

Switch(config-line)#no login local

Switch(config-line)#end

19.添加本地用户和密码设置相关权限(级别 0-15  低到高)

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#username 用户名 privilege 15 password cisco

Switch(config)#end

20.删除本地用户和密码设置相关权限

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#no username 用户名

Switch(config)#end

21.查看所有端口删除信息的命令(包括物理以太口和VLAN虚接口。

用这个命令可以清晰看到对应口的物理层、数据链路层、网络层信息

Router>en

Router#show ip interface brief缩写(sho ip int br

返回结果:

Interface     IP-Address   OK? Method Status     Protocol

FastEthernet0/0   unassigned   YES unset administratively down   down

FastEthernet0/1   unassigned    YES unset administratively down   down

Vlan1     unassigned   YES unset administratively down   down

22.打开路由器F0/0接口

Router>en

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#interface f0/0

Router(config-if)#no shutdown

返回结果:

Router>en

Router#show ip interface brief

Interface     IP-Address   OK? Method Status     Protocol

FastEthernet0/0   unassigned   YES unset administratively down   up

FastEthernet0/1   unassigned    YES unset administratively down   down

Vlan1      unassigned   YES unset administratively down   down

23.关闭路由器F0/0接口

Router>en

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#interface f0/0

Router(config-if)#shutdown

返回结果:

Router>en

Router#show ip interface brief

Interface     IP-Address   OK? Method Status     Protocol

FastEthernet0/0   unassigned   YES unset administratively down   down

FastEthernet0/1   unassigned    YES unset administratively down   down

Vlan1      unassigned   YES unset administratively down   down

24.查看设备相邻的邻居

(检查所有设备是否正确连, 连接端口是否正确)

Switch>en

Switch#show cdp neighbors

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone

Device ID   Local Intrfce   Holdtme   Capability  Platform   Port ID

Switch    Fas 0/4   150     S   2950  Fas 0/1

Router    Fas 0/1   164     R   C1841         Fas 0/0

图例:

                                                                                                      PS

Device ID

Local Intrfce

Holdtme

Capability

Platform

Port ID

对端设备名称

本地连接端口

维持时间

平台类型

对端设备型号

设备连接端口

 

  • 8
    点赞
  • 90
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值