Configuring the User Interface
This section describes the configuration model of the user interface and provides examples of XML packets.
Data Model
The configuration model file matching the user interface is huawei-user-interface.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-user-interface:user-interfaces/user-interface/name |
Indicates the user interface name. |
The value is a character string and must be similar to vty 3 or con 0. |
N/A |
/huawei-user-interface:user-interfaces/user-interface/authentication-mode/aaa/aaa-protocol |
Indicates that the user interface authentication mode is the login protocol corresponding to AAA authentication. |
The value is of the Boolean type:
|
The value none can be delivered only when user-interface:name in a request message is con 0. Additionally, the con 0 interface can only deliver the none option. |
/huawei-user-interface:user-interfaces/user-interface/authentication-mode/password/password-protocol |
Indicates that the user interface authentication mode is the login protocol corresponding to password authentication. |
The value is of the Boolean type:
|
The value none can be delivered only when user-interface:name in a request message is con 0. Additionally, the con 0 interface can only deliver the none option. |
/huawei-user-interface:user-interfaces/user-interface/authentication-mode/password/password |
Indicates the local authentication password. |
The value is a string of 8 to 16 case-sensitive characters without spaces. |
N/A |
/huawei-user-interface:user-interfaces/user-interface/privilege-level |
Indicates the user interface priority. |
The value is an integer that ranges from 0 to 15. |
N/A |
/huawei-user-interface:user-interfaces/user-interface/idle-timeout/minutes |
Indicates the user connection timeout period, in minutes. |
The value is an integer that ranges from 0 to 35791, in minutes. |
N/A |
/huawei-user-interface:user-interfaces/user-interface/idle-timeout/seconds |
Indicates the user connection timeout period, in seconds. |
The value is an integer that ranges from 0 to 59, in seconds. |
N/A |
/huawei-user-interface:user-interfaces/user-interface/screen-length/line-num |
Indicates the number of lines on each terminal screen. |
The value is an integer that ranges from 0 to 512. The default value is 24. |
N/A |
/huawei-user-interface:user-interfaces/user-interface/acl/ipv4-inbound |
Indicates the ACL that restricts users with an IPv4 address or within an address segment from logging in to a device. |
|
The value must be an existing ACL delivered by the controller. |
/huawei-user-interface:user-interfaces/user-interface/acl/ipv4-outbound |
Indicates the ACL that restricts IPv4 users who have logged in to a device from logging in to other devices. |
|
The value must be an existing ACL delivered by the controller. |
/huawei-user-interface:user-interfaces/user-interface/acl/ipv6-inbound |
Indicates the ACL that restricts users with an IPv6 address or within an address segment from logging in to a device. |
|
The value must be an existing ACL delivered by the controller. |
/huawei-user-interface:user-interfaces/user-interface/acl/ipv6-outbound |
Indicates the ACL that restricts IPv6 users who have logged in to a device from logging in to other devices. |
|
The value must be an existing ACL delivered by the controller. |
Configuring the User Interface
This section provides a sample of configuring the user interface using the config method.
Operation |
XPATH |
---|---|
edit-config:config |
|
Data Requirements
Item |
Data |
Description |
---|---|---|
User interface name |
vty 4 |
Set the password, priority, timeout interval, number of lines displayed on each terminal screen, and ACL on the VTY 4 user interface. |
Login protocol corresponding to password authentication as the user interface authentication mode |
all |
|
Local authentication password |
root@123 |
|
User interface priority |
15 |
|
User connection timeout period, in minutes |
30 minutes |
|
User connection timeout period, in seconds |
49 seconds |
|
Number of lines on each terminal screen |
512 |
|
ACL that restricts users with an IPv4 address or within an address segment from logging in to a device |
test1 |
|
ACL that restricts IPv4 users who have logged in to a device from logging in to other devices |
test2 |
|
ACL that restricts users with an IPv6 address or within an address segment from logging in to a device |
test3 |
|
ACL that restricts IPv6 users who have logged in to a device from logging in to other devices |
test4 |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <user-interface:user-interfaces xmlns:user-interface="urn:huawei:params:xml:ns:yang:huawei-user-interface"> <user-interface:user-interface> <user-interface:name>vty 4</user-interface:name> <user-interface:password-protocol>all</user-interface:password-protocol> <user-interface:password>root@123</user-interface:password> <user-interface:privilege-level>15</user-interface:privilege-level> <user-interface:idle-timeout> <user-interface:minutes>30</user-interface:minutes> <user-interface:seconds>49</user-interface:seconds> </user-interface:idle-timeout> <user-interface:screen-length> <user-interface:line-num>512</user-interface:line-num> </user-interface:screen-length> <user-interface:acl> <user-interface:ipv4-inbound>test1</user-interface:ipv4-inbound> <user-interface:ipv4-outbound>test2</user-interface:ipv4-outbound> <user-interface:ipv6-inbound>test3</user-interface:ipv6-inbound> <user-interface:ipv6-outbound>test4</user-interface:ipv6-outbound> </user-interface:acl> </user-interface:user-interface> </user-interface:user-interfaces> </config> </edit-config> </rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <ok/> </rpc-reply>
Sample of failed response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-message>parse rpc config error.</error-message> </rpc-error> </rpc-reply>