思科交换机工作模式及基本命令

1.)交换机基本工作模式及命令
第一次配置网络设备,需要使用console线,在pc使用crt配置

交换机4种工作模式(思科)

1)用户模式:
switch>
可以查看交换机的基本简单信息,且不能做任何修改配置!
2)特权模式
switch> enable
switch#
可以查看所有配置,且不能修改配置
但可以做测试、保存、初始化等操作
3)全局配置模式:
switch# configure terminal
switch(config)#
默认不能查看配置!
可以修改配置,且全局生效!
4)接口配置模式:
switch(config)# interface f0/1
switch(config-if)#
默认不能查看配置!
可以修改配置,且只对该接口生效!
5)console口/线/控制台模式:
switch(config)# line console 0
默认不能查看配置!
可以修改配置,且只对console口生效!

2.)命令:

1.exiit 返回上一级
2.end 直接退到特权模式

3.支持命令缩写
4.?的用法
5.历史命令
6.tab补全键
7.配置主机名:
conf t
hostname 设备名

8.设置用户密码:
line co 0
password 密码
login
exit

9.快捷键:
ctrl+u :快速删除光标全所有字符
ctrl+a :快速定位光标到行首
ctrl+e :快速定位光标到行尾

在内存中存在一个文件:
running-config
第一次开机,系统会在内存中自动
创建一个新的干净的running-config

11.保存配置:
en
copy running-config startup-config

write

12.交换机开机动作:
先去硬盘中查找startup-config是否存在,
如果不存在,在内存中创建新的run
若果存在,则复制到内存中并改名为running-config

13.查看running-config配置
en
show running-config
sh run

14.查看startup-config配置
show startup-config

15.重启设备:
en
reload

16.配置特权密码:
conf t
enable password 密码 (明文)
enable secret 密码 (密文)

17.查看MAC地址表:
show mac-address-table

18.查看接口状态列表:
show ip int brief
sh ip int b

19.手工关闭接口
int f0/x
shutdown
exit

20.手工开启接口
int f0/x
no shutdown
exit
二层接口默认开启
三层接口默认管理down

21.do的用法
其他模式加do空格可以强制使用特权模式的命令
如:
do show run
do show ip int b
do write

22.删除配置
1)在哪配置的,就在哪删!
2)命令前加no空格
3)原命令中有参数,并且参数具有唯一性,则
删除时不需要加参数
如:
conf t
hostname sw1

conf t
no hostname

23.清空/擦除/初始化配置
en
erase startup-config

24.为3层端口配置IP:
int f0/0
ip add 10.1.1.254 255.255.255.0
no shut
exit

25.开启远程控制:
conf t
line vty 0 4 设置登陆人数
transport input telnet/ssh/none/all 选择输入端口
password 密码
login 开启身份验证
exit
如果使用ssh登录
conf t
hostname r1 需要设置用户名
ip domain-name r1.sina.com 需要设置一个域
crypto key generate rsa 生成密钥对!
line vty 0 4
transport input telnet/ssh/none/all
login local 使用本地用户密码
exit
username xx password 123.com 建立用户名和密码
26.为交换机配置管理IP:
目的:可被远程管理
conf t
int vlan 1
ip add 10.1.1.253 255.255.255.0
no shut
27.为交换机配置默认网关:
目的:可被跨网段管理!
conf t
ip default-gateway 10.1.1.254

28.关闭自动解析功能:
conf t
no ip domain-lookup
防止命令敲错导致全网查找,导致不能继续配置

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值