System‑Config
AsterNOS-System-Config
This chapter provides examples on how to use Netconf to manage System configurations on AsterNOS devices.
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
NOTE: 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>Modify System Clock
NOTE: 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 hostname 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
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
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
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
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
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>
<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
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
NOTE: 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
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>