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.
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_ipv4is defined as an array[...]containing an object, which is not the standard or most common representation inietf-ipfor a single IPv4 address on an interface; it should typically be a single object. Also,address_ipv6is an array containingnull, which is an unconventional and potentially incorrect way to indicate no IPv6 address. - B. The root element
interfacewithout a namespace andietf-loopbackas a separate key are syntactically incorrect for standard YANG-to-JSON mapping. Theaddresskey with 'ipv4' and an array[...]is also non-standard. - C. The
netmask0.0.0.0is incorrect for a/32IP address; a/32netmask is255.255.255.255. Using0.0.0.0would imply a default route or a different subnet.
Concept tested. YANG data models, JSON for network configuration, IETF interfaces and IP modules
Topics
Community Discussion
No community discussion yet for this question.