Skip to content

常用命令

1.视图切换
  • 用户视图<>:只能查看配置,不能修改配置
  • 系统视图[]:可以查看和修改全局配置
  • 接口视图[-0/0]:可以对接口修改配置
# 进入系统视图
system-view
## sys

# 系统视图进去接口视图
interface g1/0/1
## int g1/0/1

# 退出,返回上一视图
quit

# 返回用户视图
return 或 Ctrl + Z
2. 常用查看命令
# 查看当前的所有配置
display current-configuration

# 查看所有三层接口的摘要信息(查看接口的IP以及接口的连通状态)
display ip interface brief
## dis ip int b

# 查看某个接口的详细信息
display interface g1/0/1

# 查看版本和系统信息
display version

# 查看当前视图下配置了哪些参数
display this
3. 设备操作命令
# 更改设备名称
sysname <R1>

# 重启设备(仅用户视图下可用)
reboot

# 保存当前配置
save

# 清空配置,恢复出厂设置(仅用户视图下可用,需要重启才生效,不影响当前运行状态)
reset saved-configuration

# 命令开头添加,执行反向操作,常用于关闭
undo

# 手动关闭接口
shutdown

# 手动开启接口
undo shutdown
4. 快捷操作
    1. 支持命令缩写(可简写到命令的唯一性)
    1. 帮助命令:输入
    1. 历史命令:上键↑
    1. tab 补全键
    1. 快速删除光标前所有字符:Ctrl+U
    1. 光标移动至行首:Ctrl+A
    1. 光标移动至行尾:Ctrl+E
5.1 配置时间<用户视图>
# 查看时间
display clock

# 设置时区
clock timezone beijing add 8

# 调整时间
clock protocol none
clock datetime 00:00 2020/06/01


# 开启ntp功能
ntp-service enable

# 设置ntp同步时间
ntp service unicast-server <IP>

# 查看ntp状态
display ntp-service status

# 查看ntp服务会话
dispaly ntp-service sessions
5. 2配置http web管理界面
sys
# 开启http服务
ip http enable
# 设置用户并分配权限
local-user admin
password simple admin
service-type http
# 管理级:network-admin
authorization-attribute user-role level-3
quit

# 配置vlanif IP
vlan 1
ip address 192.168.1.1 24

# 浏览器访问:http://ip

# 查看 http 服务端口
display ip http/https

# 配置 http 端口号
ip http port 80

# 关闭http服务
undo ip http enable
5.3 配置ssh远程登录
sys
# 生成密码对
public-key local create rsa
public-key local create dsa

# 查看公钥信息
dis public-key local rsa public

# 开启ssh服务
ssh server enable
user-interface vty 0 4
authentication-mode scheme
protocol inbound ssh

# 创建用户
# 如忘记密码通过console访问交换机修改密码
local-user <admin> class manage
password cipher <passwd>
service-type ssh
authorization-attribute user-role network-admin
5. 4配置Telent远程登录
# 初始设备设置IP
interface vlan-interface 1
ip address 192.168.56.1 255.255.255.0

# 开启telnet服务
telnet server enable
# 创建用户
local-user <user> class manage
# 设置密码
password simple <123456>
# 该用户用于telnet服务
service-type telnet
# 设置用户级别
authorization-attribute user-role level-15

# 返回系统视图
quit
# 设置虚拟终端(开启vty线路模式0-15),0 4 表示最多允许5个用户连接 
user-interface vty 0 4
# 指定验证模式(用户名+密码)
authentication-mode scheme
# 权限级别
user-role level-15


# --------------------补充---------------------------

# 配置vty支持telnet协议(可选,华为)
protocol inbound telnet 
# 设置认证模式为口令或aaa认证(可选)
authentication-mode aaa|password|none
# quit

# aaa认证配置(可选)
# 进入aaa视图
aaa
# 配置用户名和密码
local-user <usernmae> password irreversible-cipher <passwd>
# 配置用户权限
local-user <username> privilege level 3
return
5.5 配置sonsole用
5.6 配置sonsole用户验证
user-interface console 0
authentication-mode aaa|password|none
# 设置明文/密文密码
set authentication password|cipher password
6. 网络设备的文件系统

开启FTP实现文件备份

# 开启ftp服务
ftp server enable
# 创建用户
local-user <user> class manage
# 设置密码
password simple <123456>
# 设置用户级别
authorization-attribute user-role level-15
# 该用户用于ftp服务
service-type ftp

客户端FTP命令

# 连接FTP服务器(用户模式下)
ftp <ip>

# 列出当前目录
ls

# 下载文件
get <filename>

# 上传文件
put <filename>

# 断开FTP连接
bye
# 指定开机配置文件,用于还原配置
startup saved-configuration startup.cfg
7. 网络设备调试
  • 对相应的协议所收发的所有报文全部在屏幕上输出显示
  • 用于网络排错,可能对会影响造成网络,建议低峰期操作。
# 用户视图下开启debug
terminal monitor
terminal debugging
debugging <协议类型>

# 关闭debug
undo debugging all
# 中断屏幕滚动输出
CTRL+O
8. VLAN与Trunk
# 查看vlan摘要信息
display vlan brief

# 查看某个vlan信息
display vlan <id>

# 查看trunk端口信息
display port trunk


# 创建vlan,vlan <vlan-id>
vlan 10
# 进入vlan加入接口
[vlan10] port g1/0/1
# 加入多个端口
port g1/0/1 to g1/0/3
# vlan 命名
[vlan10] name <vlan_name>


## 或进入接口加入vlan
int g1/0/2
port access vlan 20

# 配置端口类型为trunk口,可选 access/trunk/hybrid
# 两台交换机相同配置,交换机同vlan互通
int g1/0/3
port link-type trunk
# 允许trunk口放行vlan 10 和 20,all为所有
port trunk permit vlan 10 20
port trunk permit vlan all

# 取消端口类型配置
undo port link-type

# 删除vlan
undo vlan <vlan-id>
# 批量创建vlan,10-15
vlan batch 10 to 15
# 把端口加入到指定vlan,华为设置需要加上default
port default vlan <vlan-id>
# 配置trunk中允许通过的vlan
port trunk allow-pass vlan <vid to vid|all>
# 配置hybrid端口以tagged/untagged 方式加入vlan
port hybrid <tagged|untagged> vlan <vid>

# 配置IP和子网掩码
interface vlanif 1
ip address 192.168.0.1 255.255.255.0

# 基于MAC地址划分VLAN
vlan 3
mac-vlan mac-address <22-22-22....>
quit
int g0/0/1
mac-vlan enable
9. STP
# 查看STP相关信息
display stp

# 查看STP端口状态
display stp brief

# 全局开启STP
stp global enable

# 关闭端口上STP
undo stp enable

# 更改STP模式,默认是MSTP
stp mode <stp/rstp/mstp>

# 更改交换机优先级 
stp priority <priority>

# 更改接口生成树的cost
stp cost <cost>

# 配置端口为边缘端口
stp edged-port

# 华为命令
# 使能|关闭stp
stp enable|disable
# 设置为根桥或备份根桥
stp root primary|secondary

int g0/0/1
# 设置端口优先级
stp port priority <priority>
# 配置端口开销
stp cost <cost>
# 配置端口为边缘端口,连接终端
stp edged-port enable
# 启动端口BPDU报文过滤功能
stp bpdu-filter enable
# 配置STP端口路径开销的计算方法
stp pathcost-standard legacy
10. 802.1X基本配置
# 先开启全局的802.1X特性
dot1x

# 再开启端口的802.1X特性
int g1/0/1
dot1x

# 添加本地接入用户并设置相关参数
local-user <username> class network
service-type lan-access
password {cipher|simple} <password>

# 取消802.1X认证
undo dot1x
11. 端口隔离基本配置
# 端口隔离组:用于同一vlan内的端口隔离,属于同一个隔离组的接口无法互相访问,不通个隔离组的接口可以互访
# 创建隔离组1
port-isolate group 1

# 将指定端口加入隔离组
int g1/0/1
port-isolate enable group 1

# 取消隔离组
undo port-isolate enable
12. 静态链路聚合配置(必用)*

两个物理口参数必须一模一样,先配置聚合再配置物理口参数,

# 创建聚合端口,进入聚合视图,如聚合组 1
interface Bridge-Aggregation 1

# 物理端口加入聚合组
int g1/0/1
port link-aggregation group 1
int g1/0/2
port link-aggregation group 1

# 配置聚合端口为trunk类型,允许vlan通过
# int bri 1
int Bridge-Aggregation 1
port link-type trunk
port trunk petmit vlan all

# 查看聚合链路信息,处于 selected Ports 状态才是正常工作
display link-aggregation summary
display link-aggregation verbose

# 两台交换机配置步骤一样

# 测试,关闭某个端口
shutdown
# 开启
undo shutdown

# 多个连续口一起配置
int range g1/0/1 to g1/0/2
13. 配置DNS代理

由路由器负责请求DNS服务器,将请求结果返回给客户端,后续不需要客户端重复性请求,减少网络开支。

# 1、开启DNS代理
dns proxy enable

# 2、配置dns服务器
dns server 114.114.114.114

# 3、内网终端DNS服务器指向为本路由器
14. 路由器配置 DHCP
# 配置一个IP地址
int g0/0
ip address 192.168.1.1 24
quit

# 开启DHCP服务
dhcp enable

# 创建地址池 <name> 1-63
dhcp server ip-pool 1
# 配置网段
network 192.168.1.0 mask 255.255.255.0
# 配置网关
gateway-list 192.168.1.1
# 配置DNS
dns-list 114.114.114.114
# 配置租期,day/hour
expired day 1
# 排除某地址段(不参与自动分配),系统视图
dhcp server forbidden-ip 192.168.1.2 192.168.1.100
# 查看DHCP服务器统计信息
display dhcp server statistics

# 释放IP地址<用户视图下执行>
reset dhcp server ip-in-use ip 192.168.1.2

DHCP 中继代理:跨网段分配IP地址

# 主路由R1
int g0/0
ip address 192.168.1.1 24
# 配置DHCP 192.168.2.0
dhcp enable
dhcp server ip-pool 1
network 192.168.2.0 mask 255.255.255.0
gateway-list 192.168.2.254
dns-list 114.114.114.114
# 配置默认路由
ip route-static 0.0.0.0 0 192.168.2.254

# 中继路由R2
int g0/0
ip address 192.168.1.2 24
# 接口上开启DHCP中继功能
int g0/1
ip address 192.168.2.254 24
dhcp enable
dhcp select relay
# 指定用于中继的DHCP服务器地址
dhcp relay server-address 192.168.1.1

# PC 获取2网段IP,并ping 192.168.1.1
15. IPV6

手动配置IPV6地址

# R1
int g0/0
# 自动配置ipv6地址
ipv6 address auto

# 配置全球单播地址:不需要依赖DHCP服务,只需要网段内的路由器具有全球单播地址,并取消RA消息抑制即可
ipv6 address 2001::1 64
# 取消RA消息抑制
undo ipv6 nd ra halt

# 查看ipv6接口信息
dis ipv6 int brief

# 查看接口IPV6信息
display ipv6 interface g0/0
# R3 模拟PC自动获取ipv6地址
int g0/0
ipv6 address auto

# ping ipv6链路本地地址和全球单播地址
ping ipv6 -i g0/0 <FE80::...>
ping ipv6 <2001::1>
# 取消ipv6配置
undo ipv6 address
16. IP路由
# 查看路由表
display ip routing-table

# 查看指定网段的路由信息
display ip routing-table 192.168.1.0 24

# 静态路由配置
# ip route-static <目的地址> <子网掩码> <出接口后下一跳地址/或接口>
# 末尾添加 preference <number> 可以设置路由优先级
ip route-static 192.168.2.0 24 192.168.2.254
17. 单臂路由实验(弃用)

设备:一台路由器、一台交换机、2台PC

  • PC_1 配置 192.168.1.1 / 255.255.255.0 / 192.168.1.254
  • PC_2 配置 192.168.2.1 / 255.255.255.0 / 192.168.2.254
  • 交换机配置
sys
# 1口配置vlan10,连PC1
vlan 10
port g1/0/2

# 2口配置vlan20,连PC2
vlan 20
port g1/0/3

# 3口配置trunk,并开通vlan,连路由器
int g1/0/1
port link-type trunk
port trunk permit vlan 10 20
  • 路由器配置
sys
# 创建子接口
int g0/0.1
# 开启 802.1q识别绑定到 vlan10
vlan-type dot1q vid 10
# 配置ip
ip add 192.168.1.254 24
# 开启广播(H3C不需要)
vlan-termination broadcast enable

int g0/0.2
vlan-type dot1q vid 20
ip add 192.168.2.254 24

# 检查验证
# 查看接口信息
display ip interface brief
# 查看路由表,是否存在 1 和 2 网段的直连路由
display ip routing-table
# PC_1 和 PC_2是否互通
18. 三层交换机实现VLAN间路由(现在使用* 转发效率高)
  • 设备:三层交换机、PC1、PC2
  • PC_1 配置 192.168.1.1 / 255.255.255.0 / 192.168.1.254
  • PC_2 配置 192.168.2.1 / 255.255.255.0 / 192.168.2.254
  • 交换机配置
sys
# 1口配置vlan10,连PC1
vlan 10
port g1/0/1

# 2口配置vlan20,连PC2
vlan 20
port g1/0/2

# 创建虚拟的三层接口
interface vlan-interface 10
ip add 192.168.1.254 24

int vlan 20
ip add 192.168.2.254 24

# 检查验证
# 查看接口信息
display ip interface brief
# 查看路由表,是否存在 1 和 2 网段的直连路由
display ip routing-table

推测

# 交换机上接一个路由器
路由器配置g0/0接口 192.168.0.1
交换机接路由器的g1/0/3端口 192.168.0.2 (vlan 1)
# port link-type trunk
# port trunk permit vlan all
路由器配置静态路由 ip route-static 192.168.0.0 16 192.168.0.2
默认vlan1 的端口走路由器的网段

路由器、交换机、PC所涉及的网段均互通

# 三层交换机下接二级交换机,因pvid不一致,会有警告信息,需关闭lldp检测
lldp ignore-pvid-inconsistency

# 三级交换机下的PC端能否发挥路由器访问外网的功能(配置OSPF)
ospf
area 0
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
network 192.168.0.0 0.0.0.255
19. RIP

假设有三个路由器 R1--R2--R3,IP是192.168.1.0和192.168.2.0 R1 连接 172.16.0.0、172.16.1.0 的PC R3 连接 172.16.2.0、172.16.3.0 的PC 如何通过RIP配置网段互通。

配置方案1

# 每个路由器都要配置
# 创建RIP进程,进入RIP协议视图
rip <pid>
# 更改RIP版本为v2
version 2
# 关闭自动聚合(路由信息按IP地址分类)
# 自动聚合会忽略子网掩码,将小网段合并成大网段
undo summary

# 宣告网段
network 172.16.0.0
network 192.168.1.0

配置方案2

# 边缘路由器可以配置手动聚合,中间路由器宣告网段
rip 1
version 2
undo summary
# 边缘路由接口配置手动聚合(比如,172.16.0.0、172.16.1.0)
rip summary-address 172.16.0.0 23

# 配置静默接口(路由出口),静默接口不会收发RIP协议报文
# 如果没有宣告网段不需配置
int g0/0
silent-interface g0/1
silent-interface g0/2

其余可选配置

# 配置RIP接口身份验证
# 直连的两台路由器所在接口都要配置,密码必须一样
int g0/0
rip authorization-mode simple plain <123456>

# 重置RIP进程(用户视图下)验证接口身份验证是否有效
return
reset rip <pid> process

# 查看路由信息
display ip routing-table
20. OSPF

一个大区域里存在多个路由器,路由器各自分配着不同的网段。通过路由协议实现路由信息交换,从而达到主机互通的目的(全网互通)。 假设存在5台路由器R1-R5 分析:实现全网互通,意味着每台路由器都要宣告本地的所有直连网段,包括环回口所在的网段。 要求 ABR 的环回口宣告进骨干区域,即区域 0,同时,每台路由器手动配置各自环回口的 IP 地址作为 Router-id

# R1
# 开启OSPF进程,指定Router-id,进入OSPF协议视图
ospf 1 router-id 1.1.1.1

# 配置环回口,可用作管理地址
int l0
ip add 1.1.1.1 32
silent-interface l0

# 进入区域视图 0
area 0
# 宣告IP路由器IP以及IP网段,network 'ip address' 'wild-mask'
# 后接 反掩码,表示IP前面几段要一样,要求同网段
# wild-mask 掩码通配符,0对应的部分需要匹配一致,1对应的部分不检查
network 1.1.1.1 0.0.0.0
network 100.1.1.0 0.0.0.255

area 1
network 100.3.3.0 0.0.0.255

## R2和R3配置相同,开启ospf,配置环回口,宣告各自的路由IP和IP网段

## 分析:检查 OSPF 是否全网互通,一个是检查邻居关系表,看邻居关系是否正常;另一个是检查路由表,看是否学习到全网路由
# 查看OSPF邻居关系,FULL:邻接关系;2-Way:邻居关系
display ospf peer
# 查看OSPF路由
display ospf routing
# 查看OSPF链路状态数据库
display ospf lsdb
# 查看路由表检查是否学习到全网路由
display ip routing-table


# 修改OSPF接口优先级
ospf dr-pririty <pririty>
# 修改OSPF接口开销
ospf cost <sost>
# 重置OSPF进程(用户视图下)
rset ospf <process id> process
21. ACL
# 要模拟路由器能上网,要配置网关。网关就是缺省路由,目的地址0.0.0.0 下一跳192.168.1.1

## 基础ACL:禁IP或网段访问
# 创建基本ACL,进入ACL视图
# acl basic <acl-number>
acl basic <2000>

# 创建基本ACL规则
#rule <rule id> <permit/deny> source <ip address> <wild-mask>
# 不写编号,默认以5的倍数补充编号
rule deny source 192.168.1.0 0.0.0.255

# 在指定接口配置包过滤
int g1/0/2
# packet-filter <acl number> <inbound/outbound>
packet-filter 2000 outbound


## 高级ACL:禁端口访问
# 创建高级ACL,进入ACL视图
acl advanced 3000

# 创建高级ACL规则
# rule <rule id> <permit/deny> <protocol> source <ip address> <wild-mask> source-port <port> destination <ip address> <wild-mask> destination-port <port>
# 反掩码 0.0.0.0 可省略为 0
rule deny tcp source 192.168.1.1 0.0.0.0 destination 192.168.3.1 0 destination-port range 20 21 

int g1/0/1
packet-filter 3000 inbound


## 高级ACL:禁网段所有端口访问,协议填ip
acl advanced 3000
rule deny ip source 192.168.2.0 0.0.0.255 destination 192.168.3.1 0
int g1/0/2
packet-filter 3000 inbound

# 更改默认动作为拒绝
packet-filter default deny
22. NAT
# 1.创建 NAT 公网地址池
nat address-group 1
# 设置地址池的范围
# 如只有一个公网地址,开始和结束都填同一个地址
address <start-ip> <end-ip>
quit

# 2.配置ACL,指定那些私网IP可以访问公网
acl basic 2000
rule permit source 192.168.1.0 0.0.0.255

# 3.在公网接口上配置 NAPT
int g1/0/0
nat outbound 2000 address-group 1

# 4.或在公网接口上配置 Easy IP
acl basic 2000
rule permit source 192.168.1.0 0.0.0.255
int g1/0/0
nat outbound 2000

## 在公网接口上配置NAT Server
# nat server protocol <tcp/udp/icmp> global <global-address> <global-port> inside <inside-address> <inside-port>
# 将 192.168.1.1 的 20、21 端口映射到公网 100.1.1.1 20、21 端口
nat server protocol tcp global 100.1.1.1 20 21 inside 192.168.1.1 20 21
23. PPP

Chap 单向验证验证配置方法

## 主验证方配置R2
# 创建用户(仅网络访问者),设置密码
local-user <user> class network
password simple <password>
# 声明用户用途
service-type ppp
quit

int s1/0
# 设置接口开启PPP验证,并指定验证方式
ppp authorization-mode chap

## 被验证方配置R1
int s1/0
# 输入账号密码
# 被验证方设置接口上用于pap验证的用户和密码
# ppp pap local-user <username> password simple <password>
# 被验证方设置接口上用于chap验证的用户和密码
ppp chap user <user>
ppp chap password simple <password>
# 重启接口验证配置
shutdown
undo shutdown

MP Chap 双向验证配置方法:接口以及设备双方同样配置

## 验证方R2
# PPP-MP:把两台路由器之间的多条PPP链路捆绑成一条逻辑PPP链路
# 创建PPP-MP口,进入MP口接口视图
interface MP-group 1
# 物理接口加入到MP口
int s1/0
ppp mp MP-group 1
int s2/0
ppp mp MP-group 1
quit

# 配置IP
int mp 1
ip add 192.168.2.2 24
# 配置双向验证

local-user <R2user> class network
password simple <R2password>
service-type ppp

# 两个接口同样配置

int S1/0
ppp authorization-mode chap
ppp chap user <R3user>
ppp chap password simple <R3password>

int s2/0
ppp authorization-mode chap
ppp chap user <R3user>
ppp chap password simple <R3password>

## 被验证方 R3

interface MP-group 1
int s1/0
ppp mp MP-group 1
int s2/0
ppp mp MP-group 1
quit

int mp 1
ip add 192.168.2.3 24

local-user <R3user> class network
password simple <R3password>
service-type ppp

int s1/0
ppp authorization-mode chap
ppp chap user <R2user>
ppp chap password simple <R2password>

int s2/0
ppp authorization-mode chap
ppp chap user <R2user>
ppp chap password simple <R2password>

# 双向验证时,如果两端用于验证的用户名和密码一致,则在PPP接口下只用指定用户名,不用指定密码


# GARP配置

GARP是一种通用属性注册协议,包括GVRP和GMRP两种应用,GVRP类似于思科的VTP协议(实现VLAN自动注册:其他交换机同步 主交换机vlan 的配置)

```sh
# 交换机A
vlan batch 2 3
gvrp
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
gvrp
# 注册模式为normal
gvrp registration normal
quit

# 交换机B 同 A一样
```
系统命令

d80f-99928-caf3 D8-0F-99-28-CA-F3

# 添加静态的MAC地址表
mac-address static <MAC> g1/0/1 vlan 5

# 配置IP和MAC地址绑定,MAC地址格式:0000-0000-0000
arp static <IP> <MAC>
# 查看ARP表
dis arp
# 根据IP查询MAC地址
dis arp <IP>
# 根据内容查询ARP表
dis arp | include <content>
# 删除arp条目
undo arp 192.168.23.98

# DHCP 过期设置
# IP过期时间已删除,但ARP表每300秒更新一次
reset dhcp server ip-in-use ip 192.168.1.1
接口命令
​```sh
# 配置端口可自协商速率
auto speed 1000

实例: 端口隔离,两个接口之间二层数据隔离,三层数据互通(减少广播,限制攻击)

system-view
# 配置全局端口二层隔离, all为三层隔离
port-isolate mode 12
int g1/0/1
# 启动端口隔离功能,并将端口加入到隔离组1
port-isolate enable group1
int g1/0/2
port-isolate enable group1
quit
# 配置后即使这两个端口是同一Vlan,数据也不能传输
# 相互隔离的两个端口一定要加入相同的隔离组

常见问题

1. 三层交换机接二层交换机vid不一致问题
报错:PVID mismatch discovered on GigabitEthernet1/0/1(PVID 20)
解决:关闭PVID检测功能
lldp ignore-pvid-inconsistency
# 或关闭LLDP协议
# undo lldp enable
2. 查看磁盘内容:dir flash:/
   + 创建文件:mkdir <file>
   + 删除文件:rmdir <file>
3. 保存配置:save
   + 擦除配置:reset saved-configuration
   + 设置下次启动的配置文件:startup saved-configuration <file>
   + 备份下次启动配置文件:backup startup-configuration to <tftp>
   + 恢复下次启动配置文件:restore startup-configuration from <tftp><filename>

运行配置:current-configuration
启动配置:saved-configuration
保存配置:save

系统视图(特权模式+全局配置模式)
一、超时时间<600s,失败次数<5
system-view
display password-control
# 看 User....timeout
# Maximum failed login attempts
user-interface vty 0
# line console 0 控制台
# line vty 0 4 远程登录
undo idle-timeout
idle-timeout 10 0
save
display ip routing-table
二、备份配置文件
backup startup-configuration to 172.16.0.201 startup.cfg
tftp 172.16.0.201 put config.cwmp
display ip interface brief
三、更换口令
user-interface vty 0 4
authentication-mode password
set authentication password cipher Huawei@123
return
save
四、启动 telnet 服务
system-view
# 开启服务
telnet server enable
# 创建用户
# AAA 用户认证
aaa
local-user tadmin password cipher telnetUser@0622
local-user tadmin privilege level 15
local-user tadmin service-type telnet
# 配置vty支持 telnet
user-interface vty 0 4
authentication-mode aaa
protocol inbound telnet
五、开启 ssh 服务
# 创建本地密钥对
rsa local-key-pair create
# 检测是否存在 ssh 用户
dis ssh user-information
# 创建 ssh user
ssh user sshadmin authentication-type password
ssh user sshadmin service-type stelnet 
# 创建用户
# AAA 用户认证
aaa
local-user sshadmin password cipher sshUser@0622
local-user sshadmin privilege level 15
local-user sshadmin service-type ssh
# 启动服务
stelnet server enable
# 配置vty支持ssh
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
六、密码过期以及复杂度配置

system-view
display password-contol
password-control aging  90
password-control length  8
password-control history  5
password-control composition type-number 3 type-length 4

七 、查看命令

en
conf t
system-view
user-interface vty 0 4

# 查看配置信息
show run
display current-configuration
display saved-configuration

# 查看vlan信息
show vlan
display vlan

# 查看接口信息
show ip interface brief
display user-interface

# 查看路由信息
display ip routing-table

# 查看用户
display users
display web users