ensp命令-1

一、基本配置命令
1)查看当前配置信息
display current-configuration
2)查看系统版本、交换机型号信息,开机时间
display version
3)设备重命名
system-view 进入系统视图
[Huawei]sysname switch 将设备重命名为switch
4)接口的禁用和启用
system-view
[switch]interface GigabitEthernet 0/0/2 进入g0/0/2的接口
[switch-GigabitEthernet0/0/2]shutdown (禁用接口)
[switch-GigabitEthernet0/0/2]undo shutdown (启用接口)
5)保存配置
save
The current configuration will be written to the device.
Are you sure to continue?[Y/N] 确认保存输入y,回车
6)重启设备
reboot
Info: The system is now comparing the configuration, please wait.
Info: If want to reboot with saving diagnostic information, input ‘N’ and then execute ‘reboot save diagnostic-information’.
System will reboot! Continue?[Y/N]:y 确认重启输入y,回车
7)切换语言模式
language-mode Chinese //暂时切换为中文
Change language mode, confirm? [Y/N] y //是否改成中文
language-mode English //切换为英文
8)取消终端提示信息
undo terminal monitor //暂时取消终端“提示信息”
9)更改自动退出超时
system-view //进入系统视图
[Huawei]user-interface console 0 //进入console口
[Huawei-ui-console0]idle-timeout 1440 //将闲置超时设为1440分钟
10)恢复出厂设置 (用户视图恢复出厂设置,然后“重启”)
reset saved-configuration //恢复出厂设置
Warning: The action will delete the saved configuration in the device.
The configuration will be erased to reconfigure. Continue? [Y/N]:y //是否恢复,恢复y
Warning: Now clearing the configuration in the device.
Error: The config file does not exist.
reboot //重启
Info: The system is now comparing the configuration, please wait.
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:n //是否保存配置文件
Info: If want to reboot with saving diagnostic information, input ‘N’ and then e
xecute ‘reboot save diagnostic-information’.
System will reboot! Continue?[Y/N]:y //是否重启
11)查看当时接口状态
display interface brief
12)查看当前视图下所有配置
display this
13)查看设备本次及下次启动相关的系统文件和版本
display startup

二、交换机常用的配置命令
1)配置交换机的IP地址
system-view //进入系统视图
[Huawei]interface Vlanif 1 //进入vlan 1
[Huawei-Vlanif1]ip address 192.168.1.100 255.255.255.0 //配置IP地址,子网掩码
[Huawei-Vlanif1]undo shutdown // 启用接口
[Huawei]display interface Vlanif 1 // 查看VLAN 1 的接口
2)配置远程访问的密码
system-view //进入系统视图
[Huawei]user-interface vty 0 4 //(进入远程登陆的配置视图)配置允许5个终端远程管理
[Huawei-ui-vty0-4]authentication-mode password //启用密码认证
[Huawei-ui-vty0-4]set authentication password cipher 456 //配置远程管理的密码为456
[Huawei-ui-vty0-4]user privilege level 3 // 设置远程管理的权限为3
注:level 3表示管理级
3)远程连接测试 [telnet 远程管理协议,端口23]
telnet 192.168.1.100 //连接指定地址的交换机
Connected to 192.168.1.100 …
Login authentication
Password: //输入456
4) 开启telnet远程服务 (端口23)
telnet server enable
5)更改telnet端口号(安全)
telnet server port 33889
6) 配置console密码(本地访问口令)
[switch]user-interface console 0 进入console口
[switch-ui-console0]authentication-mode password 启用密码认证
[switch-ui-console0]set authentication password cipher 123 设置密码123
[switch-ui-console0]return 返回用户视图
quit
Please Press ENTER.
Login authentication
Password: 输入123

telnet-AAA认证
[R2]user-interface vty 0 4 进入虚拟终端
[R2-ui-vty0-4]authentication-mode aaa 远程登录的认证模式设置为aaa认证
[R2-ui-vty0-4]aaa 进入aaa协议视图
[R2-aaa]local-user ntd password cipher 123456 创建本地用户 ntd 密码:123456
[R2-aaa]local-user ntd service-type telnet 允许本地用户ntd使用telnet远程
[R2-aaa]local-user ntd privilege level 15 给本地用户ntd设置权限等级为15
[R2-aaa]quit 退出

SSH 远程登陆

[Huawei]sy R2
[R2]aaa 进入aaa模式
[R2-aaa]local-user ntd password cipher 123 创建本地用户ntd,设置密码
[R2-aaa]local-user ntd privilege level 15 将本地用户权限改为15
[R2-aaa]local-user ntd service-type ssh 本地接入类型ssh
[R2-aaa]q
[R2]ssh user ntd authentication-type password 创建ssh用户,设置默认密码认证模式
[R2]stelnet server enable 开启stelnet服务
[R2]rsa local-key-pair create 创建本地密钥对,使用ras非对称加密算法
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa
[R2-ui-vty0-4]protocol inbound all 允许所有协议类型通过

客户端访问SSH服务
stelnet server enable 开启stelnet服务
ssh client first-time enable 客户端与ssh建立连接
stelnet 150.1.1.2

搭建ftp服务器
[R3]ftp server enable 开启ftp服务
[R3]display network status all 查看网络状态
[R3]aaa
[R3-aaa]local-user ntd password cipher 123 创建用户
[R3-aaa]local-user ntd service-type ftp 设置本地用户ntd的登陆方式
[R3-aaa]local-user ntd privilege level 15 设置本地用户ntd的权限
[R3-aaa]local-user ntd ftp-directory flash:/ 指定ftp服务器的存储目录

其他:
dis arp | include 10.1.10.27 //已知IP地址得到MAC地址及连接下层的交换机
dis mac-add xxxx-xxxx-xxxx //可以查到服务器,如果是交换机,继续下层查找
clear configuration interface Ethernet 0/0/2 清除e0/0/2接口下的配置

  • 5
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小羊咕噜呼噜☆

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值