当前位置:网站首页>华为交换机基础配置(telnet/ssh登录)
华为交换机基础配置(telnet/ssh登录)
2022-07-03 07:41:00 【鹿鸣天涯】
一、华为S5700交换机初始化和配置SSH和TELNET远程登录方法:
配置登陆IP地址:
system-view //进入系统配置模式
[Quidway]interface Vlanif 1 //进入三层 vlanif 接口
[Quidway-Vlanif1]ip address 192.168.0.1 255.255.255.0 //配置管理 IP 地址
创建web登录管理账号:
[Quidway]http server enable //系统视图下开启http服务
[Quidway]http secure-server enable //系统视图下开启http安全服务 即https
[Quidway]aaa //系统视图下进入aaa模式
[Quidway-aaa]local-user admin privilege level 15 ///配置 http 登录名权限
[Quidway-aaa]local-user admin service-type http /// 开启 http 登录服务
[Quidway-aaa]quit /// 退出aaa模式
如果telnet能登录,但console反而不能登录的话,则需在aaa里把要登录的账户赋予权限
[Quidway-aaa]local-user admin service-type terminal ssh telnet ftp
创建vlan:
system-view ///进入系统配置模式
[Quidway]vlan 10 ///创建vlan 10
[Quidway-vlan10]quit ///退出系统配置模式
[Quidway]interface Vlanif 10 ///进入配置vlan 10的模式
[Quidway-Vlanif10]ip address 192.168.0.1 255.255.255.0
///为vlan 10配置IP地址和掩码
[Quidway-vlan10]quit ///退出系统配置模式
[Quidway-GigabitEthernet0/0/2] ///进入端口2
[Quidway-GigabitEthernet0/0/2]port link-type access
///端口类型设置为access
[Quidway-GigabitEthernet0/0/2]port default vlan 10
///将port加入到我们创建好的vlan 10
[Quidway-GigabitEthernet0/0/2]display vlan ///查看配置的vlan信息
[Quidway]q ///退出系统设置视图
批量创建vlan:
system-view ///进入系统配置模式
[Quidway]vlan batch 2 to 19 ///批量创建vlan 2-19 ,系统都会有一个默认的vlan 1
[Quidway]display vlan ///查看vlan信息
[Quidway]q ///退出系统设置视图
批量删除vlan:
system-view ///进入系统配置模式
[Quidway]undo vlan batch 2 to 19 ///批量删除vlan 2-19 ,系统都会有一个默认的vlan 1
[Quidway]display vlan ///查看vlan信息
[Quidway]q ///退出系统设置视图
批量把端口加入到vlan 10:
system-view ///进入系统配置模式
[Quidway]interface range GigabitEthernet 0/0/1 to GigabitEthernet 0/0/6 ///将1口到6口添加到port-group,此处系统默认的给1口到6口添加到1个组里了。
[Quidway-port-group]port link-type access ///将port-group组内的端口全部改为access口
[Quidway-port-group]port default vlan 10 ///将port-group组内的端口全部加入到vlan 10
[Quidway]q ///退出系统设置视图
或者先创建一个端口组,再添加到vlan中
system-view ///进入系统配置模式
[Quidway]port-group 1 ///创建端口组,组名为1
[Quidway-port-group-1]group-member GigabitEthernet 0/0/7 to GigabitEthernet 0/0/17 ///把端口7到17添加到端口组1中
[Quidway-port-group-1]port link-type access ///将port-group-1组内的端口全部改为access口
[Quidway-port-group-1]port default vlan 20 ///将port-group-1组内的端口全部加入到vlan 20
[Quidway-port-group-1]display vlan ///查看配置的vlan信息
[Quidway-port-group-1]q ///退出端口组1的配置模式
[Quidway]q ///退出系统设置视图
删除vlan----需要先删除vlanif信息—再删vlan:
system-view ///进入系统配置模式
[Quidway]undo interface Vlanif 10 ///删除vlanif 10
[Quidway]display vlan ///查看vlan配置
[Quidway]display current-configuration ///发现vlan配置还在,vlanif配置已经不在
[Quidway]undo vlan 10 ///删除vlan 10
[Quidway]display vlan ///查看vlan配置,发现vlan 10已经不在
[Quidway]display current-configuration ///发现vlan配置不在,vlanif配置也不在,但是port信息还有,单独删port信息太慢
批量删除port信息:
对于上面我们已经把vlanif信息删除,vlan删除,但是display current-configuration发现
之前创建的port信息还是在的,一个一个删太慢,这里我们还创建组去删
system-view ///进入系统配置模式
[Quidway]port-group 2 ///创建port组2
[Quidway-port-group-2]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/6 ///将1口到6口加入到port组2中
[Quidway-port-group-2]undo port default vlan ///将port组2内的端口vlan配置全部删除
[Quidway-port-group-2]undo port link-type ///将port组2内的端口类型全部恢复到默认
[Quidway-port-group-2]display current-configuration ///查看端口信息
[Quidway-port-group-2]q ///退出端口组1的配置模式
[Quidway]q ///退出系统设置视图
华为S5700交换机初始化和配置TELNET远程登录方法:
1,交换机开启Telnet服务
system-view #进入系统视图
[Huawei]telnet server ? #查看有enable还是disable选项,选择对应的开启方式。
[Huawei]telnet server enable #enable选项开启Telnet服务 (普通系列一般为这个)
[Huawei]undo telnet server disable #disable选项开启Telnet服务 (CE高端系列一般为这个)
2,配置VTY用户界面的最大个数(同时可以登录的最大数)
[Huawei]user-interface maximum-vty 15 #默认是5,这个可以不设置
3,配置VTY用户界面的终端属性
[Huawei]user-interface vty 0 14 #上面是15所有这里是0 14 如果选择默认这里是0 4
[Huawei-ui-vty0-14]protocol inbound telnet #配置vty支持telnet协议
4,配置VTY用户界面的用户验证方式
[Huawei-ui-vty0-14]authentication-mode aaa #配置用户终端的身份验证模式为aaa认证为aaa认证
[Huawei-ui-vty0-14]quit #退出vty配置界面
5,配置登录验证方式
[Huawei]aaa #进入aaa配置模式
[Huawei-aaa]local-user admin1234 password ? #查看可以选择的密码选择
[Huawei-aaa]local-user admin1234 password simple Huawei12#$ #密码选项simple 账号admin1234 密码Huawei12#$ (普通系列一般为这个)
[Huawei-aaa]local-user admin1234 password irreversible-cipher Huawei12#$ #密码选项irreversible-cipher 账号admin1234 密码Huawei12#$ (CE高端系列一般为这个)
[Huawei-aaa]local-user admin1234 service-type telnet #配置接入服务类型,如果还需要SSH登录请加上
[Huawei-aaa]local-user admin1234 privilege level 3 #配置账号的级别,默认3级是超级管理员的权限
[Huawei-aaa]quit #退出
telnet 127.0.0.1 #测试telnet配置是否OK
save #保存配置
通过串口线配置S5700 的管理IP地址,串口线接在交换机的console口,ip设置完成后网线接在ETH口:
system-view
[Quidway] interface MEth 0/0/1
[Quidway] interface MEth 0/0/1
[Quidway-MEth0/0/1]ip address x.x.x.x 255.255.255.0 ///设置MEth管理端口的ip地址
[Quidway-MEth0/0/1]quit
[Quidway]ip route-static 0.0.0.0 0.0.0.0 x.x.x.x(gateway)
[Quidway-MEth0/0/1]display ip interface MEth 0/0/1
///查看MEth管理端口的配置信息
如果交换机没有ETH口,且需要配置VLANIF:
system-view
[Quidway] interface vlanif3000
[Quidway–Vlanif3000]ip address x.x.x.x 255.255.255.0
[Quidway–Vlanif3000]quit
[Quidway]ip route-static 0.0.0.0 0.0.0.0 x.x.x.x(gateway)
[Quidway]
添加用户,设置ssh telent远程登录
system-view ///进入系统配置模式
[Quidway]aaa ///进入AAA模式
[Quidway-aaa]local-user chy password cipher qaz123456
///设置本地用户名和密码 cipher加密
[Quidway-aaa]local-user chy service-type ssh telnet terminal
///设置用户设置登录ssh telnet terminal服务
[Quidway-aaa]display ssh server status
///查看ssh服务是否生效
[Quidway-aaa]display telnet server status
///查看telnet服务是否生效
[Quidway-aaa]local-user chy privilege level 15
///设置用户级别
[Quidway-aaa]q ///退出AAA模式
设置vty 0 4远程登陆的虚拟端口
VTY是路由器的远程登陆的虚拟端口,0 4表示可以同时打开5个会话,line vty 0 4是进入VTY端口,对VTY端口进行配置,比如说配置密码,或者ACL.
[Quidway]user-interface vty 0 4 ///进入vty 0 4远程虚拟端口
[Quidway-ui-vty0-4]authentication-mode aaa ///为虚拟用户终端配置AAA身份验证模式
[Quidway-ui-vty0-4]user privilege level 15 ///为虚拟用户终端配置用户级别
[Quidway-ui-vty0-4]protocol inbound all ///为虚拟用户终端配置使用的协议,all即都支持
[Quidway-ui-vty0-4]protocol inbound telnet ///为虚拟用户终端配置telnet协议,即可以使用telnet远程登录
[Quidway-ui-vty0-4]protocol inbound ssh ///为虚拟用户终端配置ssh协议,即用户可以使用ssh远程登录
[Quidway]ssh user chy authentication-type password ///为chy用户设置ssh认证为password,此命令对设置单一用户设置来说比较实用
[Quidway]ssh authentication-type default password ///设置ssh默认的认证方式为密码认证,对设置多个用户来说很实用
[Quidway]ssh user chy service-type stelnet ///为chy用户设置ssh认证服务类型为stelnet
[Quidway]display ssh user-information chy ///查看ssh服务chy用户的配置信息
[Quidway]q ///退出系统设置视图
save ///保存设置
二、设置telnet登录S5700(eg.设置用户名admin密码112233):
system-view
[Quidway] user-interface vty 0 4
[Quidway-ui-vty0-4] authentication-mode aaa
[Quidway-ui-vty0-4]protocal inbound all
[Quidway-ui-vty0-4] user privilege level 15
[Quidway-ui-vty0-4]quit
[Quidway]telnet server enable
[Quidway] aaa
[Quidway-aaa] local-user admin password cipher 112233
[Quidway-aaa] local-user admin service-type telnet
[Quidway-aaa] local-user admin privilege level 15
[Quidway-aaa] quit
三、设置SSH登录5700(eg.设置用户名admin密码112233):
[Quidway]rsa local-key-pair create
The key name will be: Quidway_Host
% RSA keys defined for Quidway_Host already exist.
Confirm to replace them? [y/n]:y
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
it will take a few minutes.
Input the bits in the modulus[default = 512]:
Generating keys…
…++++++++++++
…++++++++++++
…++++++++
…++++++++
[Quidway] aaa
[Quidway-aaa] local-user admin password simple 112233
[Quidway-aaa] local-user admin service-type ssh
[Quidway-aaa] local-user admin privilege level 15
[Quidway-aaa] quit
[Quidway] stelnet server enable
Info: Succeeded in starting the Stelnet server.
[Quidway] ssh authentication-type default password
[Quidway]quit
save all
边栏推荐
- Go language foundation ----- 11 ----- regular expression
- 技术干货|昇思MindSpore算子并行+异构并行,使能32卡训练2420亿参数模型
- [mindspire paper presentation] summary of training skills in AAAI long tail problem
- Collector in ES (percentile / base)
- List exercises after class
- Lombok cooperates with @slf4j and logback to realize logging
- Sent by mqtt client server of vertx
- Lucene skip table
- c语言指针的概念
- HCIA notes
猜你喜欢
![[mindspire paper presentation] summary of training skills in AAAI long tail problem](/img/34/9c9ec1b94edeecd4a3e7f20fdd8356.png)
[mindspire paper presentation] summary of training skills in AAAI long tail problem

UA camouflage, get and post in requests carry parameters to obtain JSON format content

Technical dry goods Shengsi mindspire elementary course online: from basic concepts to practical operation, 1 hour to start!

HCIA notes

URL programming

Common architectures of IO streams

技术干货|关于AI Architecture未来的一些思考

Custom generic structure

技术干货|昇思MindSpore NLP模型迁移之LUKE模型——阅读理解任务

TreeMap
随机推荐
lucene scorer
Vertx's responsive MySQL template
Custom generic structure
Go language foundation ----- 11 ----- regular expression
Introduction of buffer flow
Industrial resilience
Read config configuration file of vertx
c语言指针的概念
Go language foundation ------17 ----- channel creation, read-write, security shutdown, multiplexing select
Use of file class
为什么说数据服务化是下一代数据中台的方向?
VMWare网络模式-桥接,Host-Only,NAT网络
基于RNA的新型癌症疗法介绍
Go language foundation ------ 14 ------ gotest
HISAT2 - StringTie - DESeq2 pipeline 进行bulk RNA-seq
Shengsi mindspire is upgraded again, the ultimate innovation of deep scientific computing
How long is the fastest time you can develop data API? One minute is enough for me
哪一刻你才发现青春结束了
Analysis of the problems of the 10th Blue Bridge Cup single chip microcomputer provincial competition
The babbage industrial policy forum