mediumMultiple Choice
CCNP Practice Question: A RESTCONF request is sent to a Cisco IOS-XE…
A RESTCONF request is sent to a Cisco IOS-XE device to retrieve interface statistics:
GET /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1 Accept: application/yang-data+json
Response:
{"ietf-interfaces:interface": [
{
"name": "GigabitEthernet1",
"type": "iana-if-type:ethernetCsmacd",
"enabled": true,"ietf-ip:ipv4": {
"address": [
{
"ip": "192.168.1.1",
"netmask": "255.255.255.0"
}
]
}
}
]
}What does the response indicate about the interface?
⚠ Common exam trap
Cisco often tests the distinction between configuration data and operational state data in RESTCONF/NETCONF responses; the trap here is that candidates may assume the 'enabled' field is missing or misinterpret the netmask as a prefix length, leading them to incorrectly select options B or D.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The interface GigabitEthernet1 is enabled and has an IPv4 address of 192.168.1.1/24.
The response includes an 'enabled' field set to 'true' and an IPv4 address of '192.168.1.1' with a netmask of '255.255.255.0', which corresponds to a /24 prefix. The RESTCONF GET request successfully retrieves the interface configuration from the ietf-interfaces YANG data model, confirming the interface is administratively up and has an IPv4 address configured.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The interface GigabitEthernet1 is enabled and has an IPv4 address of 192.168.1.1/24.
Why this is correct
The correct interpretation of the returned data is that GigabitEthernet1 is administratively and operationally ready: the 'enabled' field is explicitly present and set to true, and the 'ipv4' section contains both an 'address' of 192.168.1.1 and a 'netmask' of 255.255.255.0. A netmask of 255.255.255.0 corresponds to a /24 prefix length. Additionally, the 'type' field 'ethernetCsmacd' confirms this is a standard Ethernet interface, so the interface is up and has a valid IPv4 address.
- ✗
The interface is disabled because the 'enabled' field is missing.
Why it's wrong here
It claims the 'enabled' field is missing, but the actual JSON serialization clearly contains '"enabled": true' in the interface data. The assertion is factually unsupported. Moreover, even in models where 'enabled' is optional, an omitted value often defaults to 'true' (admin-up) in YANG, but here there is no need to rely on defaults. The presence of 'enabled: true' indicates that the interface's administrative state is enabled, not disabled.
- ✗
The response indicates an error because the interface type is incorrect.
Why it's wrong here
This option misinterprets the 'type' field. The value 'ethernetCsmacd' is the standard IANA ifType for an Ethernet interface (including GigabitEthernet) as used in YANG and SNMP MIBs. It is not an error; rather, it is the expected type for a GigabitEthernet port. If the interface were not Ethernet, a different value such as 'propVirtualIf' might appear, but 'ethernetCsmacd' is absolutely correct for a physical Ethernet interface. Therefore, the response is a normal, successful data representation, not an error.
- ✗
The response shows that the interface has no IP address configured.
Why it's wrong here
The data includes a complete IPv4 address block with an 'address' of 192.168.1.1 and a 'netmask' of 255.255.255.0. A netmask of 255.255.255.0 is the dotted-quad representation of a /24 prefix. If no IP address were configured, the 'ipv4' field would likely be absent or contain an empty address/null value, but here it is fully populated. Thus the interface clearly has an IPv4 address assigned.
About these practice questions
One of 1,923 original 350-401 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 350-401 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 350-401 exam.