Systemcfg-Netconf
此内容尚不支持你的语言。
Systemcfg
Section titled “Systemcfg”Resources Summary
Section titled “Resources Summary”| YANG Path | get/get-config | edit-config | rpc |
|---|---|---|---|
| /show-license | — | — | Y |
| /show-supported-timezones | — | — | Y |
| /system-config | Y | merge | — |
| /system-config/clock | Y | merge, delete | — |
| /system-config/dns-resolver | Y | replace, create, delete | — |
| /system-config/dns-resolver/server/{address} | Y | replace, create, delete | — |
| /update-license | — | — | Y |
Examples
Section titled “Examples”This chapter provides examples on how to use Netconf to manage System configurations on AsterNOS devices.
Create DNS Server
Section titled “Create DNS Server”Request example to create DNS server via edit-config.
<config> <top> <system-config> <dns-resolver> <server operation="create"> <address>1.1.1.1</address> </server> </dns-resolver> </system-config> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4f3ee6c9-9bae-427a-93c8-d151b6f2f190"> <ok/></rpc-reply>Modify Hostname
Section titled “Modify Hostname”Valid hostname requirements:
- Only letters (a–z, A–Z), digits (0–9), and hyphens (-) are allowed.
- Special characters like underscores (_), dots (.), spaces, or symbols are not allowed.
- The hostname must start and end with a letter or a digit.
- It cannot begin or end with a hyphen.
- The total length must be between 1 and 63 characters.
Request example to modify hostname via edit-config.
<config> <top> <system-config operation="merge"> <hostname>test-netconf</hostname> </system-config> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4f3ee6c9-9bae-427a-93c8-d151b6f2f190"> <ok/></rpc-reply>Request example to modify router-type via edit-config.
<config> <top> <system-config operation="merge"> <router-type>leaf</router-type> </system-config> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:37190718-bff8-42ec-8bd2-589d12ed34a5"> <ok/></rpc-reply>Modify System Clock
Section titled “Modify System Clock”Here we can mpdify the system datetime and timezone. The datetime format is: YYYY-MM-DDThh:mm:ss±hh:mm. And we can obtain the supported timezones via rpc show-supported-timezones.
However, we recommend using NTP to synchronize the time whenever possible.
Request example to modify clock via edit-config.
<config> <top> <system-config> <clock operation="merge"> <datetime>2025-02-12T02:26:01Z</datetime> <timezone>Asia/Shanghai</timezone> </clock> </system-config> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4f3ee6c9-9bae-427a-93c8-d151b6f2f190"> <ok/></rpc-reply>Modify SSH Max Session Number
Section titled “Modify SSH Max Session Number”Request example to modify SSH max session number via edit-config.
<config> <top> <system-config operation="merge"> <ssh-max-session>20</ssh-max-session> </system-config> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4f3ee6c9-9bae-427a-93c8-d151b6f2f190"> <ok/></rpc-reply>Modify Telnet Max Session Number
Section titled “Modify Telnet Max Session Number”Request example to modify Telnet max session number via edit-config.
<config> <top> <system-config operation="merge"> <telnet-max-session>20</telnet-max-session> </system-config> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4f3ee6c9-9bae-427a-93c8-d151b6f2f190"> <ok/></rpc-reply>Delete DNS server
Section titled “Delete DNS server”Request example to delete DNS server via edit-config.
<config> <top> <system-config> <dns-resolver> <server operation="delete"> <address>1.1.1.1</address> </server> </dns-resolver> </system-config> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:4f3ee6c9-9bae-427a-93c8-d151b6f2f190"> <ok/></rpc-reply>Get DNS Servers
Section titled “Get DNS Servers”Request example to retrieve DNS servers via get-config with subtree filter.
<filter type="subtree"> <top> <system-config> <dns-resolver> <server/> </dns-resolver> </system-config> </top></filter>Response example
<data> <top> <system-config xmlns="http://asterfusion.com/ns/yang/asternos-system-config"> <dns-resolver> <server> <address>2.2.2.2</address> </server> <server> <address>1.1.1.1</address> </server> </dns-resolver> </system-config> </top></data>Get System Configurations
Section titled “Get System Configurations”Request example to retrieve system configurations via get-config with subtree filter.
<filter type="subtree"> <top> <system-config/> </top></filter>Response example
<data> <top> <system-config xmlns="http://asterfusion.com/ns/yang/asternos-system-config"> <hostname>test-netconf</hostname> <router-type>leaf</router-type> <ssh-max-session>20</ssh-max-session> <telnet-max-session>20</telnet-max-session> <dns-resolver> <server> <address>1.1.1.1</address> </server> </dns-resolver> <clock> <timezone>Asia/Shanghai</timezone> </clock> </system-config> </top></data>Show License Status
Section titled “Show License Status”Request example to retrieve license status via rpc show-license
<show-license/>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:05b3dfdd-15c1-44e8-8777-bddcde13a3ed"> <data xmlns="http://asterfusion.com/ns/yang/asternos-system-config"> License Name : all-19710101-license MD5 : fab126157378dd632cc607d0c00488cd Valid : True Build Time : 1971-01-01 00:07:24 Valid To : 2026-07-19 17:39:08 Feature Status --------------------------------------- IGMP TRUE TUNNEL TRUE ROUTER_PROTOCOL TRUE CLI TRUE </data></rpc-reply>Update License
Section titled “Update License”To update the license, you need to place the license file in the /etc/sonic/lic/ directory beforehand.
Request example to update license via rpc update-license
<update-license/>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:90228ddf-2cbc-4d64-895b-cc135051e210"> <ok/></rpc-reply>Get supported timezones
Section titled “Get supported timezones”Request example to get supported timezone via rpc show-supported-timezones
<show-supported-timezones/>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:dd07584a-43f9-4036-8488-653dc46d48f2"> <data>Africa/Abidjan</data> <data>Africa/Accra</data> <!-- The time zones in the middle have been omitted --> <data>WET</data> <data>Zulu</data></rpc-reply>Get ip-err-header-check Status
Section titled “Get ip-err-header-check Status”Request example to get ip-err-header-check status via get-config with subtree filter.
<filter type="subtree"> <top> <system-config> <ip-err-header-check/> </system-config> </top></filter>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:987c289c-af30-4be5-b611-d57baf1bda99"> <data> <top> <system-config xmlns="http://asterfusion.com/ns/yang/asternos-system-config"> <ip-err-header-check>false</ip-err-header-check> </system-config> </top> </data></rpc-reply>Modify ip-err-header-check Status
Section titled “Modify ip-err-header-check Status”Request example to modify ip-err-header-check via edit-config.
<config> <top> <system-config operation="merge"> <ip-err-header-check>true</ip-err-header-check> </system-config> </top></config>Response example
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:75fdbb59-4163-4be0-9971-3256dcdc20b5"> <ok/></rpc-reply>Properties Descriptions
Section titled “Properties Descriptions”System level configurations
Section titled “System level configurations”Tree Diagram
module: asternos-system-config +--rw system-config +--rw dns-resolver | +--rw server* [address] | +--rw address inet:ip-address +--rw hostname? string +--rw router-type? enumeration +--rw clock | +--rw timezone? string | +--rw datetime? yang:date-and-time +--rw ssh-max-session? uint8 +--rw telnet-max-session? uint8 +--rw ip-err-header-check? booleanTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| system-config | M | Path-only node, has no configurable value. System level configurations. | |
| dns-resolver | M | Path-only node, has no configurable value. Configuration of the DNS resolver. | |
| server | M | Path-only node, has no configurable value. List of the DNS servers that the resolver should query. | |
| address | M | inet:ip-address | The address of the DNS server. |
| hostname | O | None | This system’s network name |
| router-type | O | ”leaf" "spine” | Set Device router-type, routefailover only work on leaf, and arptohost route does not go down to the chip |
| clock | M | Path-only node, has no configurable value. System datetime and timezone settings. | |
| timezone | O | string | Timezone in IANA format, e.g., ‘Asia/Shanghai’, ‘UTC’, ‘America/New_York’. |
| datetime | O | yang:date-and-time | Manual system time setting (used when NTP is disabled). |
| ssh-max-session | O | 1..100 | SSH max session of the system. |
| telnet-max-session | O | 1..100 | SSH max session of the system. |
| ip-err-header-check | O | ”true" "false” | IP error packet header check. Enable to forbid packets with IP header errors. Default value: True |
System datetime and timezone settings
Section titled “System datetime and timezone settings”Tree Diagram
module: asternos-system-config +--rw system-config +--rw clock +--rw timezone? string +--rw datetime? yang:date-and-timeTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| clock | M | Path-only node, has no configurable value. System datetime and timezone settings. | |
| timezone | O | string | Timezone in IANA format, e.g., ‘Asia/Shanghai’, ‘UTC’, ‘America/New_York’. |
| datetime | O | yang:date-and-time | Manual system time setting (used when NTP is disabled). |
Configuration of the DNS resolver
Section titled “Configuration of the DNS resolver”Tree Diagram
module: asternos-system-config +--rw system-config +--rw dns-resolver +--rw server* [address] +--rw address inet:ip-addressTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| dns-resolver | M | Path-only node, has no configurable value. Configuration of the DNS resolver. | |
| server | M | Path-only node, has no configurable value. List of the DNS servers that the resolver should query. | |
| address | M | inet:ip-address | The address of the DNS server. |
List of the DNS servers that the resolver should query
Section titled “List of the DNS servers that the resolver should query”Tree Diagram
module: asternos-system-config +--rw system-config +--rw dns-resolver +--rw server* [address] +--rw address inet:ip-addressTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| server | M | Path-only node, has no configurable value. List of the DNS servers that the resolver should query. | |
| address | M | inet:ip-address | The address of the DNS server. |
Show License
Section titled “Show License”Tree Diagram
module: asternos-system-config
rpcs: +---x show-license +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-license | O | ||
| data | O | License info. |
Show Supported Timezones
Section titled “Show Supported Timezones”Tree Diagram
module: asternos-system-config
rpcs: +---x show-supported-timezones +--ro output +--ro data? <anydata>Table of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| show-supported-timezones | O | ||
| data | O | Timezones info. |
Update License
Section titled “Update License”Tree Diagram
module: asternos-system-config
rpcs: +---x update-licenseTable of Properties
| Name | Required | Type/Range | Description |
|---|---|---|---|
| update-license | O |