跳转到内容
Ask AI

NTP-Netconf

此内容尚不支持你的语言。

YANG Pathget/get-configedit-configrpc
/ntp-globalYmerge, delete—
/ntp-servers/{address}Ymerge, replace, create, delete—
/show-ntp——Y

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

Request example to modify Kdump-tools configurations via edit-config.

<config>
<top>
<ntp-global operation="merge">
<vrf>default</vrf>
<source-interface>eth0</source-interface>
</ntp-global>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0d9c9ea3-cb6b-4db2-976f-b9dda15b4be1">
<ok/>
</rpc-reply>

Request example to retrieve NTP global configurations via get-config with subtree filter.

<filter type="subtree">
<top>
<ntp-global/>
</top>
</filter>

Response example

<data>
<top>
<ntp-global xmlns="http://asterfusion.com/ns/yang/asternos-ntp">
<vrf>default</vrf>
<source-interface>eth0</source-interface>
</ntp-global>
</top>
</data>

The NTP server is specified by its hostname or IP address, it can be a public NTP server address or a local NTP server, like: ‘ntp.example.com’ or ‘192.168.1.1’.

Request example to create NTP server via edit-config.

<config>
<top>
<ntp-servers operation="create">
<ntp-server>
<address>pool.ntp.org</address>
</ntp-server>
<ntp-server>
<address>192.168.1.1</address>
</ntp-server>
</ntp-servers>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:df5299b4-8762-4219-8acb-57c2549a3fdf">
<ok/>
</rpc-reply>

Request example to delete single NTP server via edit-config.

<config>
<top>
<ntp-servers>
<ntp-server operation="delete">
<address>192.168.1.1</address>
</ntp-server>
</ntp-servers>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:5e1e8349-d8e4-4d20-a8e5-89fa83712aee">
<ok/>
</rpc-reply>

Request example to delete all NTP server via edit-config.

<config>
<top>
<ntp-servers operation="delete">
</ntp-servers>
</top>
</config>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:70c89d24-6af6-4cd0-b4a8-b20f635779d3">
<ok/>
</rpc-reply>

Request example to create NTP server via get-config with subtree filter.

<filter type="subtree">
<top>
<ntp-servers/>
</top>
</filter>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:864dfd12-0da9-42be-8753-061261a37b05">
<data>
<top>
<ntp-servers xmlns="http://asterfusion.com/ns/yang/asternos-ntp">
<ntp-server>
<address>192.168.1.1</address>
</ntp-server>
<ntp-server>
<address>pool.ntp.org</address>
</ntp-server>
</ntp-servers>
</top>
</data>
</rpc-reply>

Request example to get NTP status via rpc show-ntp

<show-ntp/>

Response example

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:1f493334-1c53-4739-91a1-129bac3c83e6">
<data xmlns="http://asterfusion.com/ns/yang/asternos-ntp">
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 192.168.1.1 4 6 17 16 -5986us[ -17ms] +/- 356ms
</data>
</rpc-reply>

Tree Diagram

module: asternos-ntp
+--rw ntp-global
+--rw vrf? string
+--rw source-interface? string

Table of Properties

NameRequiredType/RangeDescription
ntp-globalMPath-only node, has no configurable value.
Global configuration of ntp
vrfONoneNTP can be enabled only in one VRF at a time. In this revision, it is either default VRF or Management VRF.
Default value: default
source-interfaceOEthernet name
PortChannel name
VLAN name
Loopback name
This is the interface whose IP address is used as the source IP address for generating NTP traffic. User is required to make sure that the NTP server is reachable via this IP address and the same IP address is reachable from the NTP server. The source interface should be in the same VRF as the

VRF NTP is enabled in.

Tree Diagram

module: asternos-ntp
+--rw ntp-servers
+--rw ntp-server* [address]
+--rw address union

Table of Properties

NameRequiredType/RangeDescription
ntp-serversMPath-only node, has no configurable value.
ntp-serverMPath-only node, has no configurable value.
List of address sets of the ntp server
addressOAn IPv4 address without a zone index. This type, derived from the type ipv4-address, may be used in situations where the zone is known from the context and no zone index is needed.
An IPv6 address without a zone index. This type, derived from the type ipv6-address, may be used in situations where the zone is known from the context and no zone index is needed.
NTP server (IPv4, IPv6, or hostname)

Tree Diagram

module: asternos-ntp
rpcs:
+---x show-ntp
+--ro output
+--ro data? <anydata>

Table of Properties

NameRequiredType/RangeDescription
show-ntpO
dataOA table that show information of NTP