易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 1200|回复: 1
收起左侧

华为交换机Console口属性配置教程

[复制链接]
发表于 2022-2-24 15:51:12 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
当用户通过Console口登录设备实现本地维护时,可以根据使用需求或对设备安全的考虑,配置相应的Console用户界面属性。这些属性并不是必须要配置的,用户可以结合实际需求和安全性考虑选择配置。
通过MiniUSB口登录设备使用的也是Console用户界面,因此配置的Console用户界面属性也会作用于MiniUSB口登录。
1、设置通过账号和密码(AAA验证)登陆console口
1.1、进入Console用户界面视图
[Huawei]user-interface console 0
[Huawei-ui-console0]
1.2、设置用户验证方式为AAA验证
[Huawei-ui-console0]authentication-mode ?
aaa AAA authentication
none Login without checking # 无需验证直接登陆console口
password Authentication through the password of a user terminal interface # 只通过输入密码登陆console口
[Huawei-ui-console0]authentication-mode aaa
1.3、进入AAA视图
[Huawei-ui-console0]q
[Huawei]aaa
[Huawei-aaa]
1.4、配置登陆console口的账号和密码
[Huawei-aaa]local-user ?
STRING<1-64> User name, in form of 'user@domain'. Can use wildcard '*',
while displaying and modifying, such as *@isp,user@*,*@*.Can
not include invalid character / \ : * ? " < > | @ '
[Huawei-aaa]local-user http://023wg.com ?
access-limit Set access limit of user(s)
ftp-directory Set user(s) FTP directory permitted
idle-timeout Set the timeout period for terminal user(s)
password Set password
privilege Set admin user(s) level
service-type Service types for authorized user(s)
state Activate/Block the user(s)
user-group User group
[Huawei-aaa]local-user http://023wg.com password ?
cipher User password with cipher text
[Huawei-aaa]local-user http://023wg.com password cipher http://www.023wg.com
1.5、设置登陆console的账号和密码的服务类型为console(terminal)类型
[Huawei-aaa]local-user http://023wg.com service-type ?
8021x 802.1x user
bind Bind authentication user
ftp FTP user
http Http user
l2tp L2tp user
ppp PPP user
ssh SSH user
sslvpn Sslvpn user
telnet Telnet user
terminal Terminal user
web Web authentication user
x25-pad X25-pad user
[Huawei-aaa]local-user http://023wg.com service-type terminal ?
8021x 802.1x user
bind Bind authentication user
ftp FTP user
http Http user
l2tp L2tp user
ppp PPP user
ssh SSH user
sslvpn Sslvpn user
telnet Telnet user
web Web authentication user
x25-pad X25-pad user
<cr>
[Huawei-aaa]local-user http://023wg.com service-type terminal
2、设置只通过密码登陆console口
2.1、设置只通过密码登陆console口
[Huawei-ui-console0]authentication-mode password
2.2、设置验证密码,输入的密码可以是明文或密文
[Huawei-ui-console0]set authentication ?
password Set the password for a user interface
[Huawei-ui-console0]set authentication password ?
cipher Set the password with cipher text
simple Set the password in plain text
[Huawei-ui-console0]set authentication password cipher ?
STRING<1-16>/<24> Plain text/cipher text password
[Huawei-ui-console0]set authentication password cipher http://023wg.com
[Huawei-ui-console0]dis th
#
user-interface con 0
authentication-mode aaa
set authentication password cipher }GUbE_&zC@|8z[/:Cq23'O1#
user-interface vty 0 4
user-interface vty 16 20
#
return
[Huawei-ui-console0]
输入的密码可以是明文或者密文,当不指定cipher password参数时,将采用交互方式输入明文密码,当指定cipher password参数时,既可以输入明文密码也可以输入密文密码,但都将以密文形式保存在配置文件中。
当用户输入密码时,直接以明文形式输入存在安全风险,建议用户以交互式方式输入。
3、设置直接登陆console口,无需验证
[Huawei-ui-console0]authentication-mode none
4、配置Console用户界面的用户优先级
用户可以配置用户优先级,实现对不同用户访问设备权限的限制,增加设备管理的安全性。用户的优先级分为16个级别,级别标识为0~15,标识越高则优先级越高。用户的优先级和命令的优先级是相对应的,即用户只能使用等于或低于自己级别的命令。
缺省情况下,Console口用户界面对应的默认命令访问级别是15。
如果用户界面下配置的命令级别访问权限与用户名本身对应的操作权限冲突,以用户名本身对应的级别为准。

' t9 m: E8 E; b7 U  R                               
登录/注册后可看大图
[Huawei-ui-console0]user privilege level ?
INTEGER<0-15> Set a priority
5、设置用户登录超时时间
设置用户连接的超时时间为0或者过长会导致终端一直处于登录状态,存在安全风险,建议用户执行命令lock锁定当前连接。
[Huawei-ui-console0]idle-timeout ?
INTEGER<0-35791> Set the number of minutes before a terminal user times out(default: 10minutes)
6、设置终端屏幕每屏显示的行数
[Huawei-ui-console0]screen-length ?
INTEGER<0-512> Display the number of lines on a screen (the value 0 indicates none split screen, and the default value is 24)
7、设置终端屏幕显示的列数
[Huawei-ui-console0]screen-width ?
INTEGER<60-512> Screen width value, the default is 80
8、设置历史命令缓存条数
[Huawei-ui-console0]history-command ?
max-size Set the size of the maximum history buffer, the default value is 10
[Huawei-ui-console0]history-command max-size ?
INTEGER<0-256> The size of a history buffer
9、设置console口传输速率
[Huawei-ui-console0]speed ?
300 Only asynchronous serial user terminal interfaces can be configured
600 Only asynchronous serial user terminal interfaces can be configured
1200 Only asynchronous serial user terminal interfaces can be configured
4800 Only asynchronous serial user terminal interfaces can be configured
9600 Only asynchronous serial user terminal interfaces can be configured
19200 Only asynchronous serial user terminal interfaces can be configured
38400 Only asynchronous serial user terminal interfaces can be configured
57600 Only asynchronous serial user terminal interfaces can be configured
115200 Only asynchronous serial user terminal interfaces can be configured
10、设置console口流控方式
[Huawei-ui-console0]flow-control ?
hardware Hardware flow control mode # 硬件方式
none None flow control mode # 无
software Software flow control mode # 软件方式
11、设置console口校验位
[Huawei-ui-console0]parity ?
even Even check mode # 偶校验方式
mark Mark check mode # Mark校验方式
none None check mode # 无校验
odd Odd check mode # 奇校验方式
space Space check mode # Space校验方式
12、设置console口停止位
[Huawei-ui-console0]stopbits ?
1.5 One-and-half-bit stop bit
1 One-bit stop bit
2 Two-bit stop bit
13、设置console口数据位
[Huawei-ui-console0]databits ?
5 5-bit databits
6 6-bit databits
7 7-bit databits
8 8-bit databits
14、查看Console用户界面信息
<Huawei>display user-interface console 0
Idx Type Tx/Rx Modem Privi ActualPrivi Auth Int
+ 0 CON 0 9600 - 3 3 P -
+ : 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.
Privi: The privilege of UIs.
ActualPrivi: The actual privilege of user-interface.
Auth : The authentication mode of UIs.
A: Authenticate use AAA.
N: Current UI need not authentication.
P: Authenticate use current UI's password.
Int : The physical location of UIs.
 楼主| 发表于 2022-2-24 16:11:50 | 显示全部楼层
方案一:利用安装有FTP服务器软件的笔记本实现配置文件的复制
! D- L3 q+ [5 I/ D# P) {; h  . Z6 O: U( j  B6 J! t& v0 i
  (一)将旧交换机上的配置文件上传至一台FTP服务器
- Q% f* C% E) V+ b7 }7 _! \  
5 w# U8 y4 C: w/ H  
7 }5 V& f8 I& G3 @  图1
! l5 {' q2 I! I: N* m
* R  b# ?6 Y" Q8 s2 P  
2 C' @- a. {% R6 H8 `% ?, }  如图1所示,本次工程实例我们使用了一台笔记本作为调试终端,旧的笔记本上端口7属于网管VLAN100(即笔记本可以通过这个端口对交换机进行telnet、ftp等操作),交换机VLAN100的地址为10.200.0.1,将笔记本的IP设为10.200.0.111,在这台笔记本上安装有Serv-U软件(即将这台笔记本作为一台FTP服务器),用网线将笔记本连接至旧交换机的端口7,以上操作完毕后,在旧交换机上执行以下操作:
+ [; X( ?* M* S6 w  
3 {, \- m/ ^6 n! I3 r8 B  <ZXJF_3552>ftp 10.200.0.111
! ^; d; U" f6 Y; a9 a+ u  Trying ...
- f8 r! V) K: f  Press CTRL+K to abort) j( {5 r" D. l# {3 ~  \0 h' {
  Connected.
7 {: f- Q1 D4 f9 d! r$ w  220 Serv-U FTP Server v5.2 for WinSock ready...
4 I0 v8 u% I9 p6 J9 x  User(none):lrx
8 M; y; {# H4 Q1 f! q% y  331 User name okay, need password.
6 L1 S: n. J5 [3 s  Password:
' k3 K, o7 e, q, s7 `8 b# C' E  230 User logged in, proceed.
. b# M3 y+ J; D* Z7 j  X  [ftp]bin
  W* G9 b$ @& K2 X7 `/ O7 }; J  [ftp]put vrpcfg.txt: D8 r+ L  U0 q+ v  n
  200 PORT Command successful." ]8 a; G# X% j  P, U/ S* N& W1 Q# u$ X
  150 Opening BINARY mode data connection for vrpcfg.txt.) [1 v9 L2 h! r+ A: C
  226 Transfer complete.& f, t+ l. X. t
  FTP: 6561 byte(s) sent in 0.220 second(s) 29.00Kbyte(s)/sec.
7 X+ W9 w; w& m4 r  [ftp]bye+ O# D; f9 R* o- t
  221 Goodbye!+ n4 E& W4 L0 y: B! v
  
/ e% o& h! N* @1 ^# m7 Z+ Z* v. A. }8 K  其实以上操作很简单,就是将这台华为3552交换机作为一个FTP客户端,将配置文件vrpcfg.txt上传到了一台FTP服务器上面(即保存在一台FTP服务器上面),为了将这个配置文件再上传至那台新交换机上去,我们要进行第二步操作。
, q. ^, c. e8 D# j  \& {" h1 P. J  
2 d$ J* i  Z; U  (二)为新交换机配置IP地址
; Z# f- ?9 i7 w  
. y- L% h; l$ D5 y1 g" B1 U  要想通过FTP的方式获取配置文件,必须首先为这台交换机配置IP地址,在笔记本上通过配置线接至交换机的配置口,进行如下操作& W& D2 O2 ~5 ]- [8 T0 k) z
  <Quidway>sys
$ i5 I& P( o* O  R* U* h6 y  Enter system view, return to user view with Ctrl+Z.
9 V" j; l4 q5 V8 l  [Quidway]inter vlan 1008 O" _* R. W8 b& z+ W
  [Quidway-Vlan-interface100]ip addr 10.200.0.1 255.255.255.09 ]) n7 v( {7 \2 [  M9 n; n
  [Quidway-Vlan-interface100]inter fa0/7( C, o; i5 U& m) L1 {7 Z
  [Quidway-Ethernet0/7]port access VLAN 100" y+ Y2 h4 G# |* w. c* ?
  
2 {" d& c# O6 s* i  以上操作就为这台新交换机新建VLAN100,设置VLAN的ip地址为10.200.0.1,并且将端口7划归属于VLAN100.* ?) k; h: S* H$ p/ x
  
* J4 N/ g" h& |) }/ M- G  (三)新交换机从FTP服务器上下载配置文件* i1 S# W/ K6 \- [+ h* n
  7 R2 S: ?+ ]2 X: N; D$ ]
  进行如下操作:
5 V* ?* a1 \5 F% M/ n; n. r  <Quidway>ftp 10.200.0.111
# V% H6 T- m) U6 ^/ t  Trying ...
/ w2 l& {9 @4 _+ N9 ^( m  Press CTRL+K to abort  S1 f- x" q8 i9 ?2 I2 j: a" h" ?
  Connected.* y: }2 E7 A: v! {2 {
  220 Serv-U FTP Server v5.2 for WinSock ready...' [& L* B, w! u& K3 V# n8 J# v4 K4 s
  User(none):lrx. N: _+ p5 W0 ^; _6 z0 R
  331 User name okay, need password.7 e  E; \/ P7 B5 c" J* m) W8 t
  Password:
+ ~! @6 J7 p7 g7 A, b# o  230 User logged in, proceed.1 i' m$ X, V8 S* q
  [ftp]bin  u" z2 N- M" c* A  }; z1 x" S
  200 Type set to I.
7 M, D$ {' M" w* s" [; Z. T  [ftp]get vrpcfg.txt
1 x0 [+ F' n( H0 M6 l( b. H  227 Entering Passive Mode (10,200,0,111,4,3)
# Q& r. H0 y3 ]3 s/ ]" J: H. b  150 Opening BINARY mode data connection for vrpcfg.txt (6561 Bytes).
& C) x7 j" g2 e3 |2 M  226 Transfer complete.
" o( L' ?- Q" q8 l  FTP: 6561 byte(s) received in 0.528 second(s) 6.00Kbyte(s)/sec.
: x9 o1 I9 O6 g9 m2 m6 P2 N  [ftp]bye
5 h: I. a0 @- [1 d/ |+ {  221 Goodbye!
) L3 Z4 E) s9 a( I! J  4 M* g% o- Q# ^7 ?0 ?; i" ~
  (四)重启交换机,以使配置文件生效
1 Q' N. f+ j6 Z( J3 ?  " M+ k. t' Z  v/ F( n
  <Quidway>reboot: M" I8 i$ W4 ~( l3 u$ y2 C
   This will reboot Switch. Continue? [Y/N] y
% _7 @8 r: a  M* N  & C- }8 K0 f. C$ i
  重启完再通过dis cu命令醒看配置信息,发现已经完全与那台旧的交换机一样了。' w9 |. s, |+ U8 i& @
  通过以上的操作我们可以看到,利用华为交换机的FTP功能,我们可以很快实现两台交换机间配置文件的
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 20:22 , Processed in 0.054374 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表