交换机命令

五种模式

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

基本命令

操作命令
设置设备名/主机名conf t
hostname 主机名
敲错ctrl + shift +6
关闭自动解析功能conf t
no ip domain-lookup
快捷键ctrl+u :快速删除光标全所有字符
ctrl+a :快速定位光标到行首
ctrl+e :快速定位光标到行尾
在内存中存在一个文件running-config
第一次开机,系统会在内存中自动
创建一个新的干净的running-config
交换机开机动作先去硬盘中查找startup-config是否存在,
如果不存在,在内存中创建新的run
若果存在,则复制到内存中并改名为running-config
查看所有配置–查看running-config配置文件show running-config
sh run
查看startup-config配置show startup-config
设置用户密码line co 0
password 密码
login
exit
设置特权密码conf t
enable password 密码 # 明文特权密码
enable secret 密码 # 密文特权密码
密文与明文同时配置,明文失效!
开启加密所有密码的服务conf t
service password-encryption
保存配置en
copy running-config startup-config 或
write
重启设备
en
reload
清空/擦除/初始化配置en
erase startup-config
do的用法其他模式加do空格可以强制使用特权模式的命令do sh run
do sh ip int b
删除配置1)在哪配置的,就在哪删!
2)命令前加no空格
3)原命令中有参数,并且参数具有唯一性,则<br/删除时不需要加参数 去掉密码no enable password
.查看接口状态列表en
show ip int brief
sh ip int b
手工关闭接口int f0/x
shutdown
exit
手工开启接口int f0/x
no shutdown
exit
查看MAC地址表show mac-address-table

操作

IP
为3层端口配置IP
   int f0/0
    ip add 10.1.1.254 255.255.255.0
    no shut 
    exit
远程控制
conf 
line vty 0 4
 transport input telent/ssh/none/all
 password 密码
 login
 exit
 或使用本地用户数据库进行身份验证
 conf t
 line vty 0 4
   transport input telnet/ssh/none/all
   login local
   exit
username xxx password 123.com 使用用户验证身份
开启SSH

以上这个实验,只能使用telnet,ssh暂时不可以使用!因为ssh除了要开启以外,还需要生成一对RSA密钥!

conf t
hostname r1
ip domain-name r1.qf.com
crypto key generate rsa        ##生成密钥对!

line vty 0 4
  transport input ssh
  login local
  exit
username aaa password 123.com
username bbb password 123.com

待更新

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值