华为/思科一些常见命令集对照

思科/华为常见命令集

思科:用户模式 特权模式 全局模式 接口模式 协议模式
用户模式:权限特别低,仅仅用于查看,查看的东西特别少
特权模式:还是用于查看,但是能够查看的东西更多,权限更高
R1>enable---------从用户模式进入特权模式R1#disable---------从特权模式进入到用户模式
R1#show running-config-------查看所有配置的信息
R1#show ip interface brief-------查看接口列表(二层三层接口都显示)
R1#write------保存配置
R1#configure terminal---------从特权模式进入到全局模式
R1(config)#hostname R1-------修改主机名
R1(config)#exit-------一级一级退回
R1(config-if)#end---------直接退回特权模式
R1#logout/exit---------退出登陆(例如给console口配置完密码退出重新登陆验证)
R1(config)#clock timezone BJ 8 --------修改时区(全局模式)
*Feb 24 08:20:21.698: %SYS-3-TIMEZONE_INVALID: Invalid timezone name
然后exit 退出修改时间
R1#clock set 16:27:00 feb 24 2020
R1#show clock ----------查看时间
16:27:49.338 UTC Mon Feb 24 2020

R1(config)#line console 0 ---------设置console口密码
R1(config-line)#password cisco
R1(config-line)#login ----------开启登陆(退出后重新登陆则要密码)
R1(config)#username ccie password ccie -----创建用户和密码
R1(config)#line console 0 -----进入console口R1(config-line)#login local -----使用本地用户名密码进行登陆

远程登陆:
R1(config)#line vty ? -----开启telnet,
<0-924> First Line number
R1(config)#line vty 0 4 ------0-4允许有5个用户登陆进来
R1(config)#banner login ‘wo shi cisco’ -----提示语(telnet输入用户名密码前可以看到)
R1(config)#banner exec ‘ni hao !!!’-----提示语(输入用户名密码后可以看到)
R1(config-line)#password cisco
R1(config-line)#login ----login是使用上面设置的密码登陆,login local是表示telnet时用本地用户名和密码登陆

权限:0-16----16个级别-----只要能进到特权模式就是15级别
初始化默认----0级别 1级别 2-15级别----不设置看到的用户模式默认是1级别R1(config)#username aaa privilege 0 password aaa-----0级别只能查看一些信息(非常少)
R1(config)#username bbb privilege 1 password bbb----1级别比0级别的权限大些,只能用于查看信息,能够查看的东西更多2-15级别的权限是一样的,不止查看也可以配置,之所以分这么多类主要是可以在不同的层数定制一些特定的功能(不同级别不同定制,不同用户不同级别)
R1(config)#privilege exec level 1 show running-config-----1级别是不可以show run的,但是我们可以在1级别的基础上额外的加入show run功能
R1(config)#line vty 0 4 --------------telnet是不能关闭的
R1(config-line)#transport ?
input Define which protocols to use when connecting to the terminal
server
output Define which protocols to use for outgoing connections
preferred Specify the preferred protocol to use
R1(config-line)#transport input none -----拒绝远程登陆(任何传输进来的都被关闭)
R1(config-line)#transport input telnet-----------只允许telnet
R1(config)#enable secret cisco -------从用户模式进入到特权模式需要密码验证—密文
R1(config)#enable password cisco--------明文----几乎不用
R1(config)#service password-encryption-----思科用自己特有的加密方式将所有密码进行密文加密—不可恢复
R1#copy running-config startup-config = write -----保存配置
startup-config保存于nvram:中
R1#erase startup-config ---------清除配置
R1#reload -------重启
System configuration has been modified. Save? [yes/no]: no—不保存配置,重启后就格式化了
Proceed with reload? [confirm]
R1#delete nvram:/startup-config --------删除文件(前面要加上nvram:/才可以)
R1#format flash: = R1#erase flash: ----删除系统(格式化flash卡)—真机上一般是用format
R1#more nvram:startup-config -----查看文件的信息(类似于show)
R1#verify nvram:startup-config -----用来核算或者计算一个文件的MD5检验值—用来比较原有保存的MD5值和重新校验的MD5值是否一致----一致表示数据没被篡改过

华为:用户模式 系统模式 接口模式 协议模式
用户模式:可以save/delete等,只要进入到用户模式就拿到了权限
<R2>system-view---------从用户模式进入系统模式
[R2]quit---------从系统模式进入到用户模式
[R2]display current-configuration--------查看所有配置信息
[R2]display interface brief-------查看所有接口列表(二层三层接口都显示)
[R2]display ip interface brief-------只能查看三层接口列表<
<R2>save--------保存配置(只能进入到用户模式保存)
[R2]sysname R2----------修改主机名
[R2]quit-------一级一级退回
[R2-GigabitEthernet0/0/0]return---------直接退回用户模式
Ctrl+]/quit-----------退出登陆
BJ add 8** --------修改时区(用户模式)
<R2>clock datetime 16:31:00 2020-2-24 ----------修改时间
[R2]user-interface console 0 -----------设置console口密码
[R2-ui-console0]set authentication password ?
cipher Set the password with cipher text
simple Set the password in plain text
[R2-ui-console0]set authentication password cipher huawei
[R2-aaa]local-user hcie password cipher hcie -----创建用户名和密码
Info: Add a new user.
[R2-aaa]quit[R2]user-interface console 0 -----进入到console口
[R2-ui-console0]authentication-mode ?
aaa AAA authentication
none Login without checking
password Authentication through the password of a user terminal interface[R2-ui-[R2-ui-console0]authentication-mode aaa ----使用本地用户名密码进行登陆
远程登陆
[R2]user-interface vty 0 4
[R2]header login information “huawei!!!”----提示语(telnet输入用户名密码前可以看到)
[R2]header shell information “nihao!!!”----提示语(输入用户名密码后可以看到)
[R2-ui-vty0-4]authentication-mode aaa ----telnet使用本地用户名密码进行登陆
[R2-ui-vty0-4]set authentication password cipher huawei ----telnet使用该密码登陆
权限:0-16–16个级别初始化默认----0级别 1级别 2级别 3-15级别----级别越高能够操作的东西就更多------只有进入到2级别才能够system-view进入到系统模式,才能够进行配置(但是没有aaa,就不能创建管理用户,只有更高权限才可以)
0级别—ping tracer
1级别—display
2级别—可以配置协议–OSPF BGP3-15级别----管理系统(创建用户)
[R2]user-interface vty 0 4
[R2-ui-vty0-4]user privilege level 0 -----------(不设置默认是0级别)telnet上去能够使用的指令特别少
[R2]user-interface vty 0 4
[R2-ui-vty0-4]protocol inbound ?
all All protocols ----ssh,telnet都支持 ssh
SSH protocol ----只支持ssh远程登陆进来
telnet Telnet protocol ----值支持telnet远程登陆进来
[R2-ui-vty0-4]undo authentication-mode -----不设置认证模式(其他设备就不能远程连接进来)
Save保存的配置是存在于vrpcfg.zip文件中
<R2>delete vrpcfg.zip --------清除配置/删除文件(delete是删除一个文件,erase是删除整个文件夹下的文件,rm则是删除文件夹)
<R2>reboot -----重启

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值