Skip to content
Ask AI

Systemcfg-Netconf

YANG Pathget/get-configedit-configrpc
/show-license——Y
/show-supported-timezones——Y
/system-configYmerge—
/system-config/clockYmerge, delete—
/system-config/dns-resolverYreplace, create, delete—
/system-config/dns-resolver/server/{address}Yreplace, create, delete—
/update-license——Y

This chapter provides examples on how to use Netconf to manage System configurations on AsterNOS devices.

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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? boolean

Table of Properties

NameRequiredType/RangeDescription
system-configMPath-only node, has no configurable value.
System level configurations.
dns-resolverMPath-only node, has no configurable value.
Configuration of the DNS resolver.
serverMPath-only node, has no configurable value.
List of the DNS servers that the resolver should query.
addressMinet:ip-addressThe address of the DNS server.
hostnameONoneThis system’s network name
router-typeO”leaf"
"spine”
Set Device router-type, routefailover only work on leaf, and arptohost route does not go down to the chip
clockMPath-only node, has no configurable value.
System datetime and timezone settings.
timezoneOstringTimezone in IANA format, e.g., ‘Asia/Shanghai’, ‘UTC’, ‘America/New_York’.
datetimeOyang:date-and-timeManual system time setting (used when NTP is disabled).
ssh-max-sessionO1..100SSH max session of the system.
telnet-max-sessionO1..100SSH max session of the system.
ip-err-header-checkO”true"
"false”
IP error packet header check. Enable to forbid packets with IP header errors.
Default value: True

Tree Diagram

module: asternos-system-config
+--rw system-config
+--rw clock
+--rw timezone? string
+--rw datetime? yang:date-and-time

Table of Properties

NameRequiredType/RangeDescription
clockMPath-only node, has no configurable value.
System datetime and timezone settings.
timezoneOstringTimezone in IANA format, e.g., ‘Asia/Shanghai’, ‘UTC’, ‘America/New_York’.
datetimeOyang:date-and-timeManual system time setting (used when NTP is disabled).

Tree Diagram

module: asternos-system-config
+--rw system-config
+--rw dns-resolver
+--rw server* [address]
+--rw address inet:ip-address

Table of Properties

NameRequiredType/RangeDescription
dns-resolverMPath-only node, has no configurable value.
Configuration of the DNS resolver.
serverMPath-only node, has no configurable value.
List of the DNS servers that the resolver should query.
addressMinet:ip-addressThe 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-address

Table of Properties

NameRequiredType/RangeDescription
serverMPath-only node, has no configurable value.
List of the DNS servers that the resolver should query.
addressMinet:ip-addressThe address of the DNS server.

Tree Diagram

module: asternos-system-config
rpcs:
+---x show-license
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-licenseO
dataOLicense info.

Tree Diagram

module: asternos-system-config
rpcs:
+---x show-supported-timezones
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-supported-timezonesO
dataOTimezones info.

Tree Diagram

module: asternos-system-config
rpcs:
+---x update-license

Table of Properties

NameRequiredType/RangeDescription
update-licenseO