200-901 Infrastructure and Automation Practice Question
Exhibit
Refer to the exhibit.
yang-module: Cisco-IOS-XE-native
container native
container ip
list route
key "prefix mask"
leaf prefix { type inet:ipv4-address; }
leaf mask { type inet:ipv4-prefix-length; }
leaf next-hop { type inet:ipv4-address; }Refer to the exhibit. Based on the YANG model snippet, what is the data type of the 'mask' leaf?
⚠ Common exam trap
Cisco often tests the distinction between 'inet:ipv4-address' (a full address) and 'inet:ipv4-prefix-length' (the /N notation), tricking candidates who confuse the subnet mask value with its prefix length representation.
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
✓
inet:ipv4-prefix-length
The 'mask' leaf is defined with the type 'inet:ipv4-prefix-length', which represents a decimal integer from 0 to 32 indicating the number of leading 1 bits in the subnet mask (e.g., 24 for /24). This is the correct data type for a prefix length in YANG models, not an IPv4 address or a generic string.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
inet:ipv4-address
Why it's wrong here
inet:ipv4-address represents a full IPv4 address such as 192.0.2.1, not a subnet mask value like 255.255.255.0. It is tempting because masks are written in the same dotted-decimal notation, but the exhibit's typedef for the mask leaf is a dedicated mask type, not the general address type.
- ✓
inet:ipv4-prefix-length
Why this is correct
The `mask` leaf is typed as `inet:ipv4-prefix-length`, a YANG built-in derived type restricting values to 0–32. This satisfies the exhibit's requirement for a subnet mask length rather than a dotted-decimal address, since the type enforces an integer prefix length consistent with the model's IPv4 addressing constraint.
- ✗
uint8
Why it's wrong here
uint8 is an unsigned 8-bit integer, whereas a subnet mask leaf in a YANG model is expressed as a dotted-decimal IPv4 address. It is tempting because masks are often stored numerically, but the exhibit's type statement declares an address type, not an integer.
- ✗
string
Why it's wrong here
string would accept arbitrary text, losing the validation and canonical formatting that a structured mask type provides. It is tempting because dotted-decimal masks look like text, but the exhibit declares a specific typedef for the mask leaf, which constrains valid values rather than permitting any character sequence.
Visual reference
Go deeper
Related to this question
About these practice questions
One of 975 original 200-901 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 200-901 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 200-901 exam.