Courseiva

CCNA Netconf And Xml Api Questions

44 questions · Netconf And Xml Api topic · All types, answers revealed

1
MCQmedium

You need to lock the candidate configuration datastore in your NETCONF script to prevent concurrent modifications by other administrators. Which XML element accomplishes this?

A.<lock-config>
B.<acquire-lock>
C.<exclusive-edit>
D.<lock>
AnswerD

The <lock> element targets the candidate datastore, granting the requesting session exclusive write access so concurrent administrators cannot commit changes. This satisfies the requirement to prevent concurrent modifications during the script's edit window, and the lock is released by <unlock> or session termination.

Why this answer

The <lock> RPC takes a target element specifying which datastore to lock, such as the candidate datastore.

2
MCQmedium

You need to load a set of configuration changes into the Junos candidate datastore from an inline XML string using NETCONF. Which RPC element is used to load configuration data?

A.<update-candidate>
B.<set-config>
C.<load-configuration>
D.<edit-config>
AnswerC

The <load-configuration> RPC carries configuration data into the Junos candidate datastore over NETCONF. This satisfies the scenario's requirement to load inline XML changes, accepting the XML string as its payload before a subsequent commit activates them.

Why this answer

The <load-configuration> RPC is a Juniper-specific extension used within NETCONF to load configuration data with formats like XML, text, or set.

3
Multi-Selecteasy

Which TWO methods can an administrator use to verify that a Python script successfully established a NETCONF session with a Junos device? (Choose two)

Select 2 answers
A.Review BGP neighbor adjacency tables.
B.Run 'show system netconf sessions' on the Junos CLI.
C.Verify physical interface link LEDs.
D.Inspect script execution logs or success return objects from PyEZ/NETCONF connection handlers.
E.Check the device temperature sensors.
AnswersB, D

Running `show system netconf sessions` on the Junos CLI directly lists active NETCONF sessions, confirming the script's connection reached the device. This satisfies the stem's requirement to verify session establishment from the device side, showing the session ID, username and client address that the Python script created.

Why this answer

Option B is correct because the Junos CLI command 'show system netconf sessions' displays active NETCONF-over-SSH sessions on the device, including the session ID, client, and login time, directly confirming that the script's NETCONF session was established. Option D is correct because a PyEZ or ncclient-based script can programmatically confirm success via return objects (for example, a connected Device instance or a successful <hello> exchange) and by inspecting execution logs that record session establishment or exceptions. Option A is wrong because BGP neighbor adjacency tables reflect routing protocol state, not NETCONF session status.

Option C is wrong because physical interface link LEDs only indicate Layer 1 link state and say nothing about an application-layer NETCONF session. Option E is wrong because temperature sensors report hardware environmental data unrelated to NETCONF connectivity.

4
MCQeasy

Which Junos configuration statement enables the NETCONF service over SSH for remote automation clients?

A.set system services netconf ssh
B.set protocols netconf enable
C.set netconf ssh-server enable
D.set system xml-api netconf enable
AnswerA

`set system services netconf ssh` activates the NETCONF subsystem on the Junos device, tunnelled over SSH on port 830. This satisfies the stem's requirement for remote automation clients to establish NETCONF sessions, since the statement explicitly binds the netconf service to the ssh transport rather than leaving it disabled.

Why this answer

Enabling NETCONF on Junos requires configuring the system services netconf ssh hierarchy.

5
MCQhard

When executing a NETCONF <get-config> request, you specify <source><candidate/></source> but omit any filtering tags. What is returned in the <rpc-reply>?

A.An rpc-error stating that a filter is mandatory.
B.Only the differences between candidate and running configurations.
C.Only the top-level system hierarchy statements.
D.The complete configuration contained within the candidate datastore.
AnswerD

Omitting filter tags means no subtree or XPath restriction is applied, so the server returns the full candidate datastore contents inside <rpc-reply>. The <source><candidate/></source> element selects the candidate datastore as the retrieval target, satisfying the stem's specified source.

Why this answer

Omiting filter tags on a <get-config> request returns the entire contents of the specified configuration datastore.

6
MCQhard

An administrator issues an edit-config RPC with default-operation="replace" targeting the candidate datastore. What is the impact on the existing configuration on the Junos device?

A.The entire target configuration datastore is replaced by the configuration provided in the RPC payload.
B.The configuration is merged, and any conflicting nodes generate a validation error.
C.The candidate datastore is cleared, and only the default factory configuration is loaded.
D.Only the specific leaf nodes provided in the RPC are updated; everything else remains intact.
AnswerA

Setting default-operation="replace" on the candidate datastore discards the entire existing configuration and substitutes only the hierarchy supplied in the RPC payload, satisfying the stem's whole-datastore replacement constraint. Unlike "merge", which overlays changes, or "none", which inherits per-level defaults, replace wipes unspecified configuration.

Why this answer

The replace operation overwrites the entire target configuration datastore with the configuration provided in the RPC message.

7
MCQmedium

An engineer writes a Python script using ncclient to push changes to a Junos device. After sending the configuration via <edit-config>, the script needs to make the changes active without dropping the NETCONF session lock prematurely or requiring a separate explicit commit RPC if candidate workflows are bypassed. However, using standard candidate datastore workflow, what is the exact RPC required to activate the candidate configuration?

A.<commit/>
B.<apply-changes/>
C.<save-config/>
D.<push-running/>
AnswerA

The candidate datastore holds changes staged by <edit-config> until a separate RPC activates them. Issuing <commit/> promotes the candidate configuration to the running configuration, satisfying the stem's requirement to make changes active while retaining the NETCONF session lock. This is the standard Junos candidate workflow, distinct from <copy-config> or bypassing the candidate entirely.

Why this answer

The <commit> RPC is used to commit the candidate configuration to the running configuration datastore in Junos.

8
MCQhard

An engineer executes a NETCONF <discard-changes> RPC. What is the precise effect of this operation on the Junos device?

A.It clears all active alarms and operational logs from the routing engine.
B.It terminates all active NETCONF sessions currently connected to the device.
C.It discards all uncommitted changes currently sitting in the candidate datastore, reverting it to match the running datastore.
D.It reverts the active running configuration to the factory default state.
AnswerC

The <discard-changes> RPC clears every uncommitted edit held in the candidate datastore, restoring it to mirror the running configuration exactly. Nothing is committed, so the running datastore and device forwarding state remain untouched throughout the operation.

Why this answer

The <discard-changes> RPC discards any uncommitted changes present in the candidate configuration datastore.

9
MCQeasy

An engineer needs to establish a NETCONF session with a Junos device securely. Which underlying transport protocol does NETCONF use by default according to RFC 6242?

A.TCP port 22
B.TCP port 443
C.UDP port 830
D.TCP port 830
AnswerD

RFC 6242 mandates SSH as the default NETCONF transport, and SSH listens on TCP port 830 for NETCONF specifically, satisfying the stem's secure-session requirement. Plain TCP port 830 without SSH would expose credentials and configuration data unencrypted, so the security constraint rules out bare TCP.

Why this answer

NETCONF over SSH is defined in RFC 6242 and uses TCP port 830 by default for secure transport.

10
MCQeasy

A network automation engineer is establishing a NETCONF session with a Junos device. After the SSH connection is established, the device and the client exchange <hello> messages. What is the primary purpose of this exchange?

A.To synchronize the device's clock with the client's clock.
B.To authenticate the client and establish a secure channel.
C.To transfer the initial configuration from the device to the client.
D.To negotiate NETCONF capabilities and session parameters.
AnswerD

The <hello> messages exchanged between the NETCONF server and client advertise supported capabilities, such as base protocol version, candidate datastore support, and other features. This negotiation ensures both parties understand what operations and datastores are available. It is a mandatory part of session establishment and precedes any RPC operations.

Why this answer

The <hello> messages are exchanged immediately after the SSH connection to advertise and negotiate NETCONF capabilities. This includes the base protocol version, supported datastores, and other features. It ensures that both the client and server understand what operations are available before any RPCs are sent.

It does not authenticate, synchronize clocks, or transfer configuration.

Exam trap

The trap here is assuming that the <hello> exchange handles authentication or configuration transfer, when it actually only negotiates capabilities.

11
MCQhard

An automation script uses the Junos XML API to retrieve interface statistics every 5 minutes. The script uses the <get-interface-information> RPC with the <interface-name> filter for a specific interface. After several successful runs, the script suddenly receives an empty <interface-information> element. What is the most likely cause?

A.The <get-interface-information> RPC does not support filtering by interface name.
B.The interface has been renamed or deleted from the configuration.
C.The interface is administratively down, so no statistics are returned.
D.The NETCONF session has timed out and needs to be re-established.
AnswerB

This is correct because if the specified interface no longer exists in the configuration, the <get-interface-information> RPC with a filter for that interface name will return an empty response. The RPC returns data only for existing interfaces. Renaming or deleting the interface would cause the filter to match nothing, resulting in an empty element.

Why this answer

The <get-interface-information> RPC returns data only for interfaces that exist in the configuration. If the specified interface is renamed or deleted, the filter matches no interface, and the response contains an empty <interface-information> element. Other causes like session timeout or unsupported filtering would produce errors or different responses.

Administrative state does not cause an empty response.

Exam trap

The trap here is assuming that an empty response indicates a communication problem, when it often means the requested object no longer exists.

12
Multi-Selectmedium

Which TWO statements are true regarding NETCONF locking mechanisms on Junos devices? (Choose two)

Select 2 answers
A.If a NETCONF session terminates unexpectedly, any locks held by that session are automatically released by the device.
B.Multiple concurrent NETCONF sessions can obtain exclusive write locks on the candidate datastore at the same time.
C.Locking the candidate datastore prevents other users or automation scripts from making conflicting changes.
D.Locks can only be released by rebooting the Routing Engine.
E.Locking is strictly mandatory for every single <get-config> request.
AnswersA, C

Junos ties each lock to its NETCONF session; when that session drops, the management daemon releases the held locks automatically. This prevents stale locks from blocking later commits after a crashed or disconnected automation script, satisfying the unexpected-termination condition in the stem.

Why this answer

Option A is correct because Junos ties NETCONF locks to the session that acquired them; if the session drops or terminates abnormally, the device automatically releases those locks so the configuration is not left permanently locked. Option C is correct because locking the candidate datastore grants exclusive write access, blocking other users or automation scripts from committing conflicting changes until the lock is released. Option B is incorrect because the candidate datastore lock is exclusive, so only one session can hold it at a time.

Option D is incorrect because locks are released through normal NETCONF operations such as <unlock> or session termination, not by rebooting the Routing Engine. Option E is incorrect because locking is not required for read-only <get-config> requests; it is used to protect configuration changes.

13
MCQhard

An automation script performs a NETCONF transaction that triggers an alarm. You want to retrieve current system alarms using the Junos XML API. Which RPC tag represents this request?

A.<retrieve-alarms>
B.<get-system-alarms>
C.<get-alarm-information>
D.<get-chassis-alarms>
AnswerC

The `<get-alarm-information>` RPC is the dedicated Junos XML API tag that returns current system alarm conditions, satisfying the stem's requirement to retrieve alarms via NETCONF. Other RPCs, such as `<get-system-information>`, expose chassis or resource data rather than alarm state, so they cannot fulfil this request.

Why this answer

The <get-alarm-information> RPC retrieves active system alarms from the Junos device.

14
MCQeasy

Which python module is part of the standard library that can be used to parse XML responses returned by NETCONF?

A.netconf.parser
B.xml.etree.ElementTree
C.xml2dict
AnswerB

xml.etree.ElementTree ships with every Python installation, so no pip install is needed to parse NETCONF's XML replies. It satisfies the standard-library constraint directly, unlike third-party parsers such as lxml or xmltodict, which must be installed separately before use.

Why this answer

Python's built-in xml.etree.ElementTree module provides tools for parsing and navigating XML data.

15
MCQeasy

A network engineer is establishing a NETCONF session with a Junos device and needs to lock the candidate configuration to prevent concurrent modifications by other administrators. Which NETCONF operation should be executed?

A.<lock><target><candidate/></target></lock>
B.<lock-config><database>candidate</database></lock-config>
C.<get-config><source><candidate/></source><lock/></get-config>
D.<edit-config><target><candidate/></target><operation>lock</operation></edit-config>
AnswerA

The lock operation targeting the candidate datastore prevents other administrators from modifying the candidate configuration until it is unlocked or the session ends. This satisfies the stem's requirement to block concurrent modifications during the engineer's NETCONF session.

Why this answer

The <lock> operation allows a client to lock the configuration datastore of a device to prevent unauthorized or conflicting changes during a transaction.

16
Multi-Selecteasy

Which TWO actions occur during the initial NETCONF session establishment phase between a client and a Junos device? (Choose two)

Select 2 answers
A.The client and server exchange <hello> messages to negotiate supported capabilities.
B.The client sends an immediate <commit> RPC to initialize the session.
C.The routing engine reloads its control plane daemons.
D.The client authenticates via SSH credentials before the NETCONF subsystem initializes.
E.The Junos device automatically locks the running configuration datastore.
AnswersA, D

Session establishment begins with capability exchange: both peers send <hello> messages containing their supported NETCONF base version, capabilities and session-id. This negotiation determines which operations, such as candidate datastore access, are available for subsequent RPCs during the session.

Why this answer

Option A is correct because NETCONF session establishment begins with both peers exchanging <hello> messages that advertise their capabilities and, in the server's case, the session-id, allowing the client and Junos device to negotiate supported features such as candidate configuration or confirmed commit. Option D is correct because NETCONF runs over SSH on Junos (typically TCP port 830), so the client must complete SSH authentication before the NETCONF subsystem is started and the <hello> exchange can occur. Option B is wrong because a <commit> RPC is a configuration operation performed after the session is established, not part of session initialization.

Option C is wrong because NETCONF session setup does not reload or restart routing engine control-plane daemons. Option E is wrong because the running configuration datastore is not automatically locked during session establishment; locking is an explicit client action via the <lock> RPC.

17
Multi-Selecthard

Which THREE attributes are available within the <edit-config> operation element in NETCONF to specify the modification action on a target node? (Choose three)

Select 3 answers
A.delete
B.replace
C.append
D.modify
E.merge
AnswersA, B, E

The delete attribute removes the specified configuration node from the target datastore during <edit-config>. It is one of the standard NETCONF modification operations, satisfying the stem's requirement for attributes that specify the action on a target node.

Why this answer

The NETCONF <edit-config> operation supports the operation attribute, whose valid values are merge, replace, create, delete, and remove. Option A (delete) is correct because the delete operation attribute removes a node that exists in the target datastore, and it is one of the standard values defined in RFC 6241. Option B (replace) is correct because replace overwrites the target node's value or configuration with the supplied content, creating it if it does not exist.

Option E (merge) is correct because merge is the default operation attribute value, combining the supplied configuration with the existing target datastore content. Option C (append) is not a valid NETCONF operation attribute value; list/leaf-list additions are handled via merge or the insert/key attributes. Option D (modify) is not a defined operation attribute value in NETCONF; modification is achieved through merge, replace, create, delete, or remove.

18
MCQmedium

You are writing a Python script to retrieve the operational state of interfaces from a Junos device using NETCONF. Which XML RPC element must be enclosed within the <rpc> tag to request operational data?

A.<pull-operational>
B.<get-rpc-reply>
C.<get-config>
D.<get>
AnswerD

The <get> RPC retrieves operational state data from the Junos device via NETCONF. Enclosed within <rpc>, it returns configuration and state information, whereas <get-config> returns only configuration. This makes <get> the correct element for requesting interface operational state.

Why this answer

The <get> rpc tag is used to retrieve both configuration and operational data, whereas <get-config> is restricted to configuration data.

19
MCQmedium

An automation engineer is using the Junos XML API to retrieve operational data from a device. The engineer wants to ensure that the response is well-formed XML and includes the Junos namespace so that it can be parsed correctly. Which XML namespace should the engineer expect in the response for Junos-specific operational tags?

A.urn:ietf:params:xml:ns:netconf:base:1.0
B.http://www.w3.org/2001/XMLSchema-instance
C.http://xml.juniper.net/xnm/1.1/xnm
D.http://www.w3.org/2001/XMLSchema
AnswerC

Junos-specific operational tags and RPCs are defined in the namespace 'http://xml.juniper.net/xnm/1.1/xnm'. When parsing responses, the engineer must account for this namespace to correctly interpret the XML elements. This is the standard namespace used by Junos for its XML API, ensuring proper identification of Junos-specific data.

Why this answer

Junos-specific operational tags are encapsulated in the namespace 'http://xml.juniper.net/xnm/1.1/xnm'. When parsing XML responses from a Junos device, automation scripts must handle this namespace to correctly extract data. Other namespaces listed are for NETCONF base protocol or XML Schema, which are not used for Junos operational elements.

Exam trap

The trap here is confusing the NETCONF base namespace with the Junos-specific namespace; the base namespace applies to protocol operations, not Junos operational data.

20
Multi-Selecthard

Which THREE error-tag values defined in NETCONF RFC 6241 may be returned by a Junos device when an edit-config operation fails validation? (Choose three)

Select 3 answers
A.syntax-timeout
B.invalid-value
C.data-exists
D.buffer-overflow
E.missing-element
AnswersB, C, E

`invalid-value` is defined in RFC 6241 as an error-tag returned when a configuration element's content fails validation, such as a value outside its permitted range or an unsupported type. Junos raises it during `edit-config` when the candidate configuration fails syntax or semantic validation, directly satisfying the stem's validation-failure constraint.

Why this answer

Option B, invalid-value, is correct because RFC 6241 defines this error-tag for when a configuration value is syntactically or semantically invalid, which is exactly what a Junos device reports when edit-config content fails validation checks such as range or type constraints. Option C, data-exists, is correct because it is the standard NETCONF error-tag returned when a create operation targets data that already exists, a common validation failure during edit-config processing. Option E, missing-element, is correct because RFC 6241 specifies this tag for when a required element is absent from the configuration being edited, another typical validation error.

Option A, syntax-timeout, is not a defined NETCONF error-tag in RFC 6241, and option D, buffer-overflow, is likewise not part of the RFC 6241 error-tag enumeration, so neither belongs.

21
Multi-Selecteasy

Which TWO benefits does NETCONF provide over traditional screen-scraping CLI automation? (Choose two)

Select 2 answers
A.Structured data representation (XML) that eliminates the need for complex regular expression parsing.
B.Automatic generation of physical fiber cabling diagrams.
C.Elimination of any need for authentication credentials.
D.Formal transaction semantics with built-in validation and error reporting (<rpc-error>).
E.Requirement for lower bandwidth links by compressing all payloads into binary audio streams.
AnswersA, D

NETCONF returns XML-encoded replies whose elements map directly to the schema, so scripts extract values by node rather than matching fragile regular expressions against human-readable CLI text. This structured representation is the benefit the stem seeks.

Why this answer

Option A is correct because NETCONF encodes configuration and state data in structured XML (per RFC 6241), so management applications can consume well-defined elements and namespaces instead of brittle screen-scraping with regular expressions against human-oriented CLI output. Option D is correct because NETCONF defines formal RPC transaction semantics, including candidate datastores, commit/rollback operations, and standardized error reporting via <rpc-error> elements, which CLI scraping cannot guarantee. Option B is wrong because NETCONF is a configuration protocol and does not generate physical fiber cabling diagrams.

Option C is wrong because NETCONF still requires authentication (commonly SSH per RFC 6242), so it does not eliminate credentials. Option E is wrong because NETCONF does not compress payloads into binary audio streams or reduce bandwidth requirements in that manner.

22
Multi-Selecthard

Which THREE error-type values are defined in the NETCONF protocol specification (RFC 6241) for categorizing <rpc-error> messages? (Choose three)

Select 3 answers
A.rpc
B.hardware
C.transport
D.protocol
E.kernel
AnswersA, C, D

RFC 6241 defines rpc as an error-type value, indicating the request itself was invalid or malformed at the RPC layer. It is one of the protocol's defined categories for classifying rpc-error messages returned to the client.

Why this answer

RFC 6241 defines the <error-type> element of an <rpc-error> with exactly three enumerated values: rpc (A), transport (C), and protocol (D). The rpc value indicates an error occurred during RPC processing on the server, such as an invalid or malformed RPC element. The transport value indicates an error at the transport-protocol layer, such as a dropped connection or authentication failure.

The protocol value indicates a violation of the NETCONF protocol semantics, such as an unknown operation or missing mandatory parameter. The unmarked options hardware (B) and kernel (E) are not part of the RFC 6241 <error-type> enumeration; they resemble syslog or SNMP-style categories and have no defined role in NETCONF error reporting.

23
MCQmedium

An automation engineer is using the Junos XML API over SSH to load a configuration snippet into the candidate datastore. The engineer wants to ensure that the configuration is merged with the existing candidate configuration. Which RPC and attribute should be used?

A.<load-configuration> with action='replace'
B.<commit-configuration> with action='merge'
C.<edit-config> with operation='merge'
D.<load-configuration> with action='merge'
AnswerD

This is correct because <load-configuration> is the Junos XML API RPC used to load configuration data. The 'action' attribute specifies how to integrate the new configuration. Setting action='merge' merges the provided configuration with the existing candidate configuration, preserving existing statements not included in the snippet. This is the standard way to perform a merge load.

Why this answer

In the Junos XML API, configuration is loaded using the <load-configuration> RPC. The 'action' attribute controls how the configuration is integrated; 'merge' merges the new configuration with the existing candidate configuration. Other actions like 'replace' or 'override' would not achieve a merge.

NETCONF's <edit-config> is not used in the Junos XML API over SSH context.

Exam trap

The trap here is confusing the Junos XML API <load-configuration> RPC with NETCONF's <edit-config>, which have similar but distinct roles.

24
MCQeasy

What is the standard IETF RFC that defines the core NETCONF protocol architecture and operations?

A.RFC 8040
B.RFC 6241
C.RFC 4253
D.RFC 7950
AnswerB

RFC 6241 defines the NETCONF protocol architecture, including the transport-independent framing, the `<rpc>` and `<rpc-reply>` message pairs, and core operations such as `<get-config>`, `<edit-config>` and `<commit>`. It satisfies the stem's requirement for the standard IETF RFC specifying NETCONF's core architecture and operations.

Why this answer

RFC 6241 is the definitive IETF standard defining the NETCONF Configuration Protocol.

25
MCQhard

An automation script attempts to load a configuration snippet using NETCONF <edit-config> with operation="delete" on a container statement. What happens if the specified container does not currently exist in the candidate configuration?

A.The device ignores the request and returns an OK response.
B.The device converts the operation to a merge automatically.
C.The device returns a NETCONF rpc-error indicating the node does not exist.
D.The device automatically creates the container as an empty object.
AnswerC

Junos treats operation="delete" as strict: deleting a non-existent container returns an rpc-error with a data-missing or unknown-element condition rather than silently succeeding. This satisfies the scenario's expectation that the device reports the missing node, unlike merge operations which tolerate absence.

Why this answer

The delete operation fails if the target node does not exist, whereas remove is silent if absent.

26
MCQeasy

What is the purpose of the <hello> element exchanged immediately after establishing a NETCONF SSH session?

A.To exchange supported protocol capabilities and namespace identifiers.
B.To authenticate the SSH username and password.
C.To request an immediate reboot of the Junos routing engine.
D.To lock the candidate configuration database automatically.
AnswerA

The <hello> element, sent by both peers immediately after the SSH session opens, advertises each side's supported NETCONF capabilities and namespace identifiers. This negotiation determines which protocol operations and datastore features are available for the remainder of the session.

Why this answer

The <hello> element is used by both client and server to exchange supported capabilities and session parameters.

27
Multi-Selecthard

Which THREE distinct operational states or configuration views can be queried using specific Junos XML API RPCs? (Choose three)

Select 3 answers
A.System information via <get-system-information>
B.BGP routing table via <get-bgp-kernel-table>
C.Chassis inventory via <get-chassis-inventory>
D.Firewall filter logs via <get-security-packet-capture>
E.Interface information via <get-interface-information>
AnswersA, C, E

The `<get-system-information>` RPC returns hostname, model, Junos version and uptime, satisfying the requirement to query a distinct operational state through the Junos XML API. It is a genuine, documented RPC, unlike fabricated tags, so it counts as one of the three valid configuration or operational views.

Why this answer

Option A is correct because the Junos XML API provides the <get-system-information> RPC, which returns operational system data such as hostname, uptime, and platform details from the device. Option C is correct because <get-chassis-inventory> is a valid Junos RPC that queries the hardware inventory of the chassis, including components like FPCs, PICs, and power supplies. Option E is correct because <get-interface-information> is a standard Junos RPC used to retrieve operational state and statistics for interfaces, equivalent to the CLI 'show interfaces' command.

Option B is not correct because there is no Junos XML API RPC named <get-bgp-kernel-table>; BGP routing information is retrieved through other RPCs such as <get-route-information> or <get-bgp-neighbor-information>. Option D is not correct because <get-security-packet-capture> is not a valid Junos RPC for retrieving firewall filter logs; packet capture and log retrieval use different mechanisms and commands.

28
MCQeasy

Which transport protocol is mandated by RFC 6241 as the standard secure connection mechanism for NETCONF when operating in typical Junos enterprise automation environments?

B.SSH
C.gRPC
D.TLS
AnswerB

RFC 6241 mandates SSH as the default secure transport for NETCONF, providing encryption and authentication over port 830. This satisfies the stem's requirement for a standard secure connection mechanism in typical Junos enterprise automation environments.

Why this answer

RFC 6241 specifies NETCONF over Secure Shell (SSH) as the standard secure transport protocol.

29
MCQmedium

You are writing a script that parses NETCONF responses from Junos. You encounter an element named <ok/> inside an <rpc-reply>. What does this indicate?

A.The SSH tunnel has been successfully authenticated.
B.The NETCONF operation completed successfully with no error or data payload to return.
C.The candidate configuration has uncommitted changes.
D.The device CPU utilization is normal.
AnswerB

The `<ok/>` element is the NETCONF protocol's standard acknowledgement that an RPC completed without error, defined in RFC 6241. It appears only when the operation returns no data payload, satisfying the stem's scenario where a Junos device confirms success silently rather than returning configuration or operational output.

Why this answer

The <ok/> tag indicates that the requested NETCONF operation executed successfully with no data to return.

30
MCQhard

An automation script attempts to unlock a candidate configuration datastore that was previously locked by a different NETCONF session. Which RPC is required to force-terminate that session and release the lock?

A.<kill-session><session-id>...</session-id></kill-session>
B.<unlock target="candidate" force="true"/>
C.<release-lock session-id="..."/>
D.<close-session><session-id>...</session-id></close-session>
AnswerA

A lock held by another session cannot be released with <unlock> from your session; <kill-session> with the owning session-id terminates that session, which automatically drops its lock. This satisfies the requirement to force-terminate the other session and release the candidate datastore.

Why this answer

The <kill-session> RPC allows terminating another active NETCONF session, which automatically releases any locks held by that session.

31
MCQeasy

What is the role of the <rpc> element in a NETCONF message exchange?

A.It defines the security credentials for SSH authentication.
B.It acts as a wrapper enclosing the specific NETCONF method request sent by the client to the server.
C.It stores error logs returned by the Junos routing engine.
D.It terminates the NETCONF session upon completion.
AnswerB

The <rpc> element is the mandatory envelope for every NETCONF request, carrying the message-id attribute and wrapping the operation the client invokes. The server replies with <rpc-reply>. Without this wrapper, the server cannot identify which method to execute, so it satisfies the stem's requirement for the request container.

Why this answer

The <rpc> element is the protocol envelope used by the client to send a request to the NETCONF server.

32
MCQhard

While executing a NETCONF edit-config operation, you want to ensure that any syntax errors or invalid statements immediately cause the device to roll back the entire transaction without applying partial changes. Which parameter achieves this?

A.<error-option>rollback-on-error</error-option>
B.<test-option>test-then-set</test-option>
C.<default-operation>none</default-operation>
D.<error-option>stop-on-error</error-option>
AnswerA

The `<error-option>rollback-on-error</error-option>` parameter instructs the NETCONF server to discard the entire candidate configuration and revert to the previous committed state if any error occurs during the edit-config transaction. This satisfies the stem's requirement that syntax errors or invalid statements trigger a full rollback, preventing partial changes from being applied.

Why this answer

The error-option element with the value 'rollback-on-error' instructs the device to abort and roll back if any error occurs.

33
MCQmedium

An automation engineer is using the Junos XML API over NETCONF to load a configuration change into the candidate datastore. The engineer wants to ensure that the change is committed automatically only if the candidate configuration passes a validation check. Which NETCONF operation should the engineer use to validate the candidate configuration before committing?

A.<edit-config>
B.<commit>
C.<check>
D.<validate>
AnswerD

The <validate> operation in NETCONF is used to validate the contents of a specified configuration datastore. It checks the candidate configuration for syntax and semantic errors without applying it. This allows the engineer to confirm that the change is valid before committing, satisfying the requirement to validate before commit.

Why this answer

The <validate> operation is the standard NETCONF method to check a configuration datastore for errors without applying changes. In Junos, this corresponds to the 'commit check' functionality. Using <validate> on the candidate datastore ensures the configuration is syntactically and semantically correct before a commit is attempted, reducing the risk of a failed commit in production.

Exam trap

The trap here is confusing the Junos CLI 'commit check' command with a NETCONF operation of the same name; the correct NETCONF operation is <validate>.

34
MCQhard

A network automation engineer is using the Junos XML API over NETCONF to make configuration changes. The engineer wants to ensure that if the commit fails, the candidate configuration is automatically rolled back to its previous state without manual intervention. Which NETCONF operation should the engineer use to achieve this?

A.<rollback> operation with a rollback number.
B.<discard-changes> operation after a failed commit.
C.<commit> with a <confirmed/> element and a <confirm-timeout> value.
D.<commit> with a <synchronize/> element.
AnswerC

The <commit> operation with <confirmed/> and <confirm-timeout> establishes a confirmed commit. If the engineer does not issue a follow-up <commit> within the timeout, the device automatically rolls back to the previous configuration. This provides the desired automatic rollback on failure, meeting the requirement without manual intervention.

Why this answer

A confirmed commit using <commit> with <confirmed/> and a timeout automatically rolls back if a confirming commit is not received within the timeout period. This is ideal for automation scripts that need to ensure configuration changes do not persist if something goes wrong. It provides a safety net without manual intervention, unlike explicit rollback or discard operations.

Exam trap

The trap here is confusing the explicit <rollback> operation with the automatic rollback provided by a confirmed commit; only the latter triggers automatically on timeout.

35
MCQhard

When using NETCONF to edit a Junos configuration, you include the attribute operation="create" on an existing configuration leaf. What behavior does the device exhibit?

A.The attribute is ignored, and the operation defaults to merge.
B.The configuration value is updated successfully.
C.The device returns an rpc-error indicating that the target data model element already exists.
D.The existing node is deleted and recreated with the new value.
AnswerC

The create operation demands that the target element not already exist. Applied to an existing leaf, Junos rejects the edit and returns an rpc-error stating the element exists, rather than silently merging or overwriting it.

Why this answer

The 'create' operation adds a configuration node only if it does not already exist; if it exists, it returns an error.

36
MCQhard

An automation script executes a NETCONF <get-config> query with a specific subtree filter for interface statistics. However, the response contains configuration data instead of operational statistics. Why did this occur?

A.The session was not locked prior to executing the query.
B.Interface statistics cannot be retrieved via NETCONF; CLI parsing is required.
C.The <get-config> RPC targets configuration datastores, whereas interface statistics are operational state data retrieved via the <get> RPC.
D.The subtree filter syntax was invalid, causing the device to fallback to the default configuration view.
AnswerC

The NETCONF <get-config> RPC reads only from configuration datastores (running, candidate, startup), so it can never return operational state. Interface statistics live in the device's operational datastore, which is queried exclusively through the <get> RPC. The script's choice of RPC, not its subtree filter, caused the wrong data to be returned.

Why this answer

<get-config> retrieves configuration data, whereas operational statistics require the <get> RPC with operational filters.

37
MCQeasy

Which tool or library is commonly used in Python to simplify interacting with Junos NETCONF APIs by abstracting low-level XML handling?

A.Netmiko
B.Junos PyEZ (juniper-eznc)
C.Paramiko
D.Requests
AnswerB

Junos PyEZ abstracts NETCONF's low-level XML into Python objects and methods, so engineers configure and query Junos without hand-crafting XML RPCs. It directly satisfies the stem's constraint of simplifying NETCONF interaction by hiding XML handling.

Why this answer

PyEZ is Juniper's official Python library designed specifically for interacting with Junos devices via NETCONF.

38
MCQeasy

Which NETCONF RPC tag is used to gracefully terminate an active NETCONF session with a Junos device?

A.<terminate-session>
B.<close-session>
C.<disconnect>
D.<kill-session>
AnswerB

The `<close-session>` RPC performs a graceful NETCONF session teardown, allowing the Junos device to release locks and resources cleanly before closing the transport. This satisfies the stem's requirement for graceful termination, unlike `<kill-session>`, which forcibly ends another user's session without that orderly shutdown.

Why this answer

The <close-session> RPC requests graceful termination of the NETCONF session.

39
MCQeasy

Which XML tag encapsulates the entire response returned by a Junos device in reply to a valid NETCONF RPC request?

A.<rpc-reply>
B.<response-data>
C.<xml-reply>
D.<netconf-response>
AnswerA

Every valid NETCONF RPC response is wrapped in the <rpc-reply> element, which carries the message-id matching the request and contains the returned data or errors. This is the mandatory outer envelope defined by RFC 6241, so it encapsulates the entire response.

Why this answer

Every NETCONF response from a Junos device is wrapped in an <rpc-reply> tag.

40
MCQhard

An engineer applies a configuration change using NETCONF with <edit-config> and specifies default-operation="replace" at the top level, but includes an element with operation="merge". How does Junos evaluate this?

A.The transaction fails because default-operation and element operations conflict.
B.The specific element operation ('merge') takes precedence over the transaction-level default-operation ('replace').
C.The device rolls back the configuration due to ambiguous parameters.
D.The default-operation takes precedence, ignoring the merge attribute.
AnswerB

Junos applies the most specific operation. An element-level operation attribute overrides the transaction-level default-operation, so that element merges while the remaining hierarchy follows replace. Attribute precedence resolves the conflict in favour of the explicit merge.

Why this answer

Per-element operation attributes override the default-operation specified at the transaction level.

41
MCQmedium

You send an edit-config RPC with an invalid XML tag name. What is the standard structure of the error returned in the <rpc-reply>?

A.A standard Linux kernel panic log string.
B.An HTTP 400 Bad Request status code.
C.A syslog message printed directly to the terminal emulator.
D.An <rpc-error> element containing diagnostic sub-elements like <error-message> and <error-tag>.
AnswerD

An invalid tag name is a protocol-level parsing failure, so the NETCONF server returns a single `<rpc-error>` element nested inside `<rpc-reply>`. Its diagnostic children, notably `<error-tag>` (here `malformed-message`) and `<error-message>`, identify the fault, satisfying the stem's requirement for the standard error structure.

Why this answer

NETCONF errors are returned inside an <rpc-error> element containing details such as error-type, error-tag, and error-message.

42
Multi-Selecteasy

Which TWO statements are true regarding the NETCONF protocol hello message exchange? (Choose two.)

Select 2 answers
A.The client uses the hello message to lock the configuration database before session initialization.
B.The client hello message must include the list of YANG modules it intends to modify during the session.
C.Both client and server exchange capabilities using XML elements containing URI strings.
D.The server hello message includes a session ID attribute assigned to the NETCONF session.
E.The hello message exchange is optional if a pre-shared SSH key is used for authentication.
AnswersC, D

NETCONF hello messages carry a `<capabilities>` element listing capability URIs, and both peers send their own hello immediately upon session establishment, so each side learns the other's supported capabilities. This satisfies the stem's requirement that both client and server exchange capabilities, with each capability identified by a URI string inside XML.

Why this answer

Option C is correct because in the NETCONF hello exchange both peers send a <hello> element containing a <capabilities> list, where each capability is expressed as a URI string (for example urn:ietf:params:netconf:base:1.0 or urn:ietf:params:netconf:capability:candidate:1.0), allowing each side to learn the other's supported features. Option D is correct because the server's hello includes a <session-id> element, a positive integer attribute that uniquely identifies the NETCONF session for the duration of that connection. Option A is wrong because database locking is performed later with <lock> operations, not during the hello exchange, and the hello occurs before any configuration operations.

Option B is wrong because the client hello advertises supported capabilities, not a list of YANG modules it intends to modify. Option E is wrong because the hello exchange is mandatory in NETCONF regardless of the SSH authentication method used.

Exam trap

JNCIA-DevOps often tests whether candidates know the hello exchange is mandatory and that capabilities are advertised (not negotiated), and candidates frequently assume locking or module-intent declarations happen during hello.

43
MCQeasy

When establishing a NETCONF session over SSH, which standard capability announcement is exchanged during the initial hello message phase?

A.http://xml.juniper.net/junos/rpc/v1
B.urn:ietf:params:netconf:base:1.0
C.netconf:params:xml:ns:netconf:base:2.0
D.urn:juniper:params:netconf:ssh:1.0
AnswerB

The base NETCONF capability urn:ietf:params:netconf:base:1.0 is announced in the server's hello message during session establishment, per RFC 6241. It signals support for the core NETCONF protocol operations, forming the mandatory baseline capability exchanged before any RPCs are issued.

Why this answer

NETCONF capabilities are exchanged in <hello> messages at session startup, referencing URIs like urn:ietf:params:netconf:base:1.0.

44
MCQeasy

An automation engineer is writing a Python script that uses the ncclient library to connect to a Junos device via NETCONF. The engineer wants to retrieve the entire candidate configuration from the device. Which NETCONF operation should be used?

A.<get> with a subtree filter for configuration
B.<copy-config> from running to candidate
C.<get-config> with source set to <candidate/>
D.<edit-config> with operation 'get'
AnswerC

This is correct because <get-config> retrieves configuration data from a specified datastore. Setting the source to <candidate/> requests the candidate configuration. This is the standard NETCONF operation to read configuration from a datastore, and it returns the full configuration unless filtered. It is the appropriate choice for retrieving the candidate configuration.

Why this answer

To retrieve the candidate configuration via NETCONF, the correct operation is <get-config> with the source datastore specified as <candidate/>. This operation reads configuration data from the chosen datastore. Other operations like <get> target running state and configuration, <copy-config> modifies datastores, and <edit-config> changes configuration.

Therefore, <get-config> is the proper choice.

Exam trap

The trap here is confusing <get> with <get-config>; <get> retrieves running configuration and state data, but cannot target the candidate datastore.

Ready to test yourself?

Try a timed practice session using only Netconf And Xml Api questions.