nerdexam
CiscoCisco

300-420 · Question #334

300-420 Question #334: Real Exam Question with Answer & Explanation

The correct answer is D: "ietf-interfaces:interface": { "name": "Loopback0", "type": "iana-if-type:softwareLoopback", "enabled": true, "address_ipv4": { "ip": "172.16.15.12", "netmask": "255.255.255.255" }, "ietf-ip:ipv6": { } }. To configure a loopback interface with an IPv4 address using YANG data in JSON format, the engineer must use the ietf-interfaces:interface container, define address_ipv4 as a single object, and specify the /32 netmask as 255.255.255.255.

Automation

Question

A network engineer prepares a script to configure a loopback interface with IP address 172.16.15.12/32. To comply with the company security policies, 'Content-type': 'application/yang- data+json' is added to the script. Connection to the network devices must be secured. Which code snippet must the network engineer use to meet this requirement? A. B. C. D.

Options

  • A"ietf-interfaces:interface": { "name": "Loopback0", "type": "iana-if-type:softwareLoopback", "enabled": true, "address_ipv4": [ { "ip": "172.16.15.12", "netmask": "255.255.255.255" } ], "address_ipv6": [null] }
  • B"interface": "ietf-loopback" { "name": "Loopback0", "enabled": true, "address": "ipv4" [ { "ip": "172.16.15.12", "netmask": "255.255.255.255" } ], "address_ipv6": { } }
  • C"ietf-interfaces:interface": { "name": "Loopback0", "type": "iana-if-type:softwareLoopback", "enabled": true, "address_ipv4": [ { "ip": "172.16.15.12", "netmask": "0.0.0.0" } ], "address_ipv6": { } }
  • D"ietf-interfaces:interface": { "name": "Loopback0", "type": "iana-if-type:softwareLoopback", "enabled": true, "address_ipv4": { "ip": "172.16.15.12", "netmask": "255.255.255.255" }, "ietf-ip:ipv6": { } }

Explanation

To configure a loopback interface with an IPv4 address using YANG data in JSON format, the engineer must use the ietf-interfaces:interface container, define address_ipv4 as a single object, and specify the /32 netmask as 255.255.255.255.

Common mistakes.

  • A. The address_ipv4 is defined as an array [...] containing an object, which is not the standard or most common representation in ietf-ip for a single IPv4 address on an interface; it should typically be a single object. Also, address_ipv6 is an array containing null, which is an unconventional and potentially incorrect way to indicate no IPv6 address.
  • B. The root element interface without a namespace and ietf-loopback as a separate key are syntactically incorrect for standard YANG-to-JSON mapping. The address key with 'ipv4' and an array [...] is also non-standard.
  • C. The netmask 0.0.0.0 is incorrect for a /32 IP address; a /32 netmask is 255.255.255.255. Using 0.0.0.0 would imply a default route or a different subnet.

Concept tested. YANG data models, JSON for network configuration, IETF interfaces and IP modules

Reference. https://datatracker.ietf.org/doc/html/rfc7223

Topics

#Network Automation#YANG Data Models#RESTCONF#Secure Communication

Community Discussion

No community discussion yet for this question.

Full 300-420 PracticeBrowse All 300-420 Questions