华为交换机、路由器配置查询、用户界面常见配置及安全加固

news/2024/9/23 4:45:28/

华为交换机路由器配置查询、用户界面常见配置及安全加固。

一、查询命令

1.常用的查询命令
查看当前生效的配置信息:
display current-configuration
//正在生效的配置,默认参数不显示。查看当前视图下生效的配置信息:
display this
//常用于接口视图,正在生效的配置,默认参数不显示。2.常用的正则表达式管道符“|”的使用(begin、exclude、include)
| begin    直到过滤出匹配的项目,剩下内容全部显示出来。| exclude  输出不匹配所有行。`| include  只输出匹配所有行。3.诊断信息查询
display diagnostic-information
//该命令集合了多条常用display命令的输出信息。

二、用户界面(User-interface)

常用的用户界面
1.Console(CON)用户界面
设备上一个物理接口(Console口),计算机的串口或者USB口——使用Console线连接到——通信设备的Console口——实现本地访问。
2.VTY用户界面。
虚拟类型终端(Virtual Type Terminal)是一种虚拟线路端口,使用远程登录(telnet、ssh)方式进行访问,最多支持21个用户同时访问。用户界面的用户级别(level)管理
1.Password验证,需要在用户界面配置Level。[MYWS-ui-console0]dis th
#
user-interface con 0 authentication-mode password  //配置password验证user privilege level 15     //配置用户权限级别set authentication password cipher PASSWORD  //设置登录密码

之前写个关于ssh配置-传送门

2.AAA验证,需要在AAA视图下配置Level。[MYWS-ui-console0]dis th
#
user-interface vty 0 4
authentication-mode aaa    
//配置VTY用户认证方式为AAA认证
protocol inbound ssh    
//配置VTY用户界面支持的协议为SSH协议
quitaaa
local-user NAME password irreversible-cipher PASSWORD
//创建与SSH用户同名的本地用户和对应的登录密码
local-user NAME service-type ssh   
//配置本地用户的服务方式为SSH
local-user NAME privilege level (1-15)   
//配置本地用户级别 
quit
-------------设备命令操作-------------
[MYWS]dis user-interface    //可查看到设备当前支持的用户界面以及它们的绝对编号Idx  Type     Tx/Rx      Modem Privi ActualPrivi Auth  Int     
+ 0    CON 0    9600       -     3     3           N     -       34   VTY 0               -     0     -           P     -       35   VTY 1               -     0     -           P     -       36   VTY 2               -     0     -           P     -       37   VTY 3               -     0     -           P     -       38   VTY 4               -     0     -           P     -       50   VTY 16              -     0     -           P     -       51   VTY 17              -     0     -           P     -       52   VTY 18              -     0     -           P     -       53   VTY 19              -     0     -           P     -       54   VTY 20              -     0     -           P     -       67   LTT 0    9600       -     0     -           N     -       68   LTT 1    9600       -     0     -           N     -       69   LTT 2    9600       -     0     -           N     -       70   LTT 3    9600       -     0     -           N     -       71   LTT 4    9600       -     0     -           N     -       72   LTT 5    9600       -     0     -           N     -       73   LTT 6    9600       -     0     -           N     -       74   LTT 7    9600       -     0     -           N     -       75   LTT 8    9600       -     0     -           N     -       76   LTT 9    9600       -     0     -           N     -       77   LTT 10   9600       -     0     -           N     -       78   LTT 11   9600       -     0     -           N     -       79   LTT 12   9600       -     0     -           N     -       80   LTT 13   9600       -     0     -           N     -       81   LTT 14   9600       -     0     -           N     -       82   LTT 15   9600       -     0     -           N     -       83   LTT 16   9600       -     0     -           N     -       
UI(s) not in async mode -or- with no hardware support: 
1-32  +    : Current UI is active.    //当前用户界面处于活动状态。F    : Current UI is active and work in async mode. //当前用户界面是活动的,在异步模式下工作。Idx  : Absolute index of UIs.//用户界面的绝对索引。Type : Type and relative index of UIs.//UI 的类型和相对索引。Privi: The privilege of UIs.//UI 的特权。ActualPrivi: The actual privilege of user-interface.//用户界面的实际特权。Auth : The authentication mode of UIs.//UI 的身份验证模式。A: Authenticate use AAA. //使用 AAA 进行身份验证。N: Current UI need not authentication. //当前用户界面不需要身份验证。P: Authenticate use current UI's password. //使用当前用户界面的密码进行身份验证。Int  : The physical location of UIs.//UI 的物理位置。

三、用户界面一些小细节参数调整

1.可以根据实际使用需求设置最大数
[MYWS]user-interface ?INTEGER<0,34-48,50-54>   The first user terminal interface to be configuredconsole                  Primary user terminal interfacecurrent                  The current user terminal interfacemaximum-vty              The maximum number of VTY users, the default valueis 5vty                      The virtual user terminal interface [MYWS]user-interface maximum-vty ?INTEGER<0-15>  The maximum number of VTY users, the default value is 5//VTY 用户的最大数量,默认值为5[MYWS]user-interface maximum-vty 15  //可以根据实际使用需求设置最大数2. 配置Console用户界面的物理属性(默认一般不调整:传输速率-9600 bit/s,不进行流控、不进行校验、停止位-1、数据位-8)user-interface con 0 
(speed、flow-control、parity、stopbits、databits)3. 设置用户超时断连功能
user-interface con 0 或者 vty界面
[MYWS-ui-console0]idle-timeout ?INTEGER<0-35791>  Set the number of minutes before a terminal user timesout(default: 10minutes)//设置终端用户超时前的分钟数(默认为10分钟)4.清除在线用户
当用户需要将某个登录用户与设备的连接断开时,可以清除指定的在线用户。
kill user-interface 参数
//清除在线用户5.用户界面通信
执行命令send 参数
//指定发送消息的用户界面,根据系统提示,输入消息并发送。
<MYWS>send ?INTEGER<0-54>  Specify a user terminal interface and configure it all            All user terminal interfacesconsole        Primary user terminal interfacevty            The virtual user terminal interface <MYWS>send all ?<cr>  <MYWS>send all Enter message, end with CTRL+Z or Enter; abort with CTRL+C:
MYWS!!!
Warning: Send the message? [Y/N]:y6. 安全加固(限制那些用户能否登陆成功)比较实用
用户界面支持ACL(基本ACL(2000~2999)和高级ACL(3000~3999))。
[MYWS]user-interface vty 0 4
[MYWS-ui-vty0-4]acl ?INTEGER<2000-3999>  Apply basic or advanced ACLipv6                Filter IPv6 addresses[MYWS-ui-vty0-4]acl ?
[MYWS-ui-vty0-4]acl 2000 ?inbound   Filter login connections from the current user interfaceoutbound  Filter logout connections from the current user interface[MYWS-ui-vty0-4]acl 2000 
这个ACL的inbound、outbound比较关键。请看图

在这里插入图片描述
四、检查配置结果

也是运维过程中常见的手段方法。
display users all
//查看用户界面的使用信息。
display user-interface console 0
//查看Console用户界面信息。
display user-interface maximum-vty
//查看VTY类型用户界面的最大个数。
display user-interface vty 0
//查看VTY用户界面信息。
display ssh server ip-block all
//查看所有认证失败的客户端IP地址。
display ssh server ip-block list
//查看因认证失败而被锁定的客户端IP地址。
display vty ip-block list
//查看因为认证失败而被阻止的IP地址列表。
display vty ip-block all
//查看所有认证失败的IP地址。
display vty mode
//查看VTY的工作模式。

http://www.ppmy.cn/news/1467380.html

相关文章

kafka-消费者服务搭建配置简单消费(SpringBoot整合Kafka)

文章目录 1、使用efak 创建 主题 my_topic1 并建立6个分区并给每个分区建立3个副本2、创建生产者发送消息3、application.yml配置4、创建消费者监听器5、创建SpringBoot启动类6、屏蔽 kafka debug 日志 logback.xml7、引入spring-kafka依赖 1、使用efak 创建 主题 my_topic1 并…

Qt QML学习资料链接

文章目录 1. Qt QML2. 学习和使用Qt QML目的3. Qt QML常用的一些模块举例4. 参考链接 1. Qt QML Qt QML模块为基于QML language开发应用程序和库提供了语言和基础建设。它定义并实现了QML的语法和基础框架&#xff0c;并提供API使得应用程序开发者可以使用定制的类型扩展QML&a…

【5】MySQL数据库备份-XtraBackup - 全量备份

MySQL数据库备份-XtraBackup-全量备份 前言环境版本 安装部署下载RPM 包二进制包 安装卸载 场景分析全量备份 | 恢复备份恢复综合 增量备份 | 恢复部分备份 | 恢复 前言 关于数据库备份的一些常见术语、工具等&#xff0c;可见《MySQL数据库-备份》章节&#xff0c;当前不再重…

小熊家务帮day13-day14 门户管理(ES搜索,Canal+MQ同步,索引同步)

目录 1 服务搜索1.1 需求分析1.2 技术方案1.2.1 使用Elasticsearch进行全文检索&#xff08;为什么数据没有那么多还要用ES&#xff1f;&#xff09;1.2.2 索引同步方案1.2.2.1 Canal介绍1.2.2.1 Canal工作原理 1 服务搜索 1.1 需求分析 服务搜索的入口有两处&#xff1a; 在…

rk3566 klipper config can error

config can hw refer to :RK3568 & Ubuntu20.04调试can口_can0: flags193<up,running,noarp> mtu 16 unspec 00-CSDN博客 check hw: fireflyfirefly:~$ ifconfig -a can0: flags128<NOARP> mtu 16 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00…

面试:eureka、nacos、consul的区别

配置中心 配置中心eureka不支持nacos支持 用起来简单&#xff0c;符合springBoot的命名风格&#xff0c;支持动态刷新consul支持 但用起来偏麻烦&#xff0c;不太符合springBoot框架的命名风格&#xff0c;支持动态刷新 注册中心

我的创作纪念日--我和CSDN一起走过的1825天

机缘 第一次在CSDN写文章&#xff0c;是自己在记录学习Java8新特性中Lambda表达式的内容过程中收获的学习心得。之前也有记录工作和生活中的心得体会、难点的解决办法、bug的排查处理过程等等。一直都用的有道笔记&#xff0c;没有去和大家区分享的想法&#xff0c;是一起的朋…

基于小波变换贝叶斯LMMSE估计的图像降噪方法(MATLAB 2018)

自从小波被发现以来&#xff0c;由于其优良的时频局部化性能&#xff0c;大大解决了信号与图像降噪的难题。利用小波降噪大致有三种方法&#xff0c;分别是基于小波模极大值原理、基于小波变换系数的相关性&#xff0c;和最为常用的小波阈值函数法。 基于小波模极大值降噪 该…