Counting VLANs Created by `vlan batch` Commands
Short answer
D `vlan batch 10 20` creates 2 VLANs (10, 20) while `vlan batch 10 to 20` creates 11 VLANs (10 through 20 inclusive).
Question
Key Takeaways
The test is whether you treat
toas an inclusive range (end − start + 1 = 11) rather than an exclusive difference, and whether you see that space-separated IDs are separate VLANs.
This Huawei VRP question tests how vlan batch parses discrete IDs versus ranges: vlan batch 10 20 creates 2 VLANs and vlan batch 10 to 20 creates 11, so the answer is D.
Common mistake: Option B (2 and 2) wrongly assumes the space-separated form and the `to` form are equivalent, or that a range of 10 to 20 spans only 10 VLANs because the endpoints are forgotten as inclusive.
Expert Analysis
Reading the two commands
vlan batch 10 20 lists discrete IDs separated by a space, so the switch creates exactly two VLANs: VLAN 10 and VLAN 20. The keyword to in vlan batch 10 to 20 declares an inclusive range, so every ID from 10 through 20 is created: 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 — eleven VLANs in total. The counts are therefore 2 and 11, which makes D the correct option.
The arithmetic trap
The classic mistake is computing 20 − 10 = 10 for the range and forgetting that both endpoints are inclusive, or else assuming the two commands are equivalent and answering B. A range count is always end − start + 1, so 20 − 10 + 1 = 11. As one explanation puts it, vlan batch 10 20 creates "2 VLANs: VLAN 10 and VLAN 20 specifically", while vlan batch 10 to 20 creates "11 VLANs: VLAN 10 through 20 inclusively" — 2 and 11, matching D.
What else this knowledge covers
The adjacent decision is whether the exam is asking about VLAN creation count or about the resulting configuration footprint: batch creation only makes the VLANs exist in the VLAN database, whereas assigning ports (port link-type access, port default vlan), trunk allowed lists, and SVIF IPs are separate steps. If the question instead asked how many VLANs must be permitted on a trunk carrying traffic for VLANs 10–20, the answer would be the same eleven, but the reasoning shifts from creation to port trunk allow-pass vlan 10 to 20.
What would flip the answer
Change the range endpoints — vlan batch 10 to 20 versus vlan batch 10 11 12 — and the count changes accordingly, so always compute end − start + 1 for to ranges and count tokens for discrete lists. A mixed form such as vlan batch 10 to 15 20 yields 6 + 1 = 7 VLANs.
Operational consequence
Over-creating VLANs (unintended to range) leaves unused VLAN IDs in the database and expands the trunk allow-list work, while under-creating them means a port configured with port default vlan 20 fails because VLAN 20 does not exist. On Huawei VRP the error appears when you reference a non-existent VLAN, so verifying display vlan after a batch command is the practical check.
Exam Strategy
On batch-creation questions, first classify the syntax: space-separated tokens are discrete IDs, while the keyword to marks an inclusive range. Compute ranges as end − start + 1 and never trust a subtraction that omits the +1. Read the option order carefully, since the question asks for two counts in sequence and swapping them is an easy misread.
Frequently Asked Questions
Does `vlan batch 10 to 20` include VLAN 10 and VLAN 20?
to keyword defines an inclusive range on Huawei VRP, so VLAN 10 through VLAN 20 are all created — eleven VLANs total.What is the difference between `vlan batch 10 20` and `vlan 10` plus `vlan 20`?
vlan batch simply combines them into one command line for efficiency.How do I verify how many VLANs were actually created?
display vlan on the switch to list the VLANs present in the database and confirm the batch command produced the expected IDs.Community Votes
100% of anonymous learners picked answer D. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 2 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 2
-
Fmoura17 👍 1 Answered Dhe correct answer is D. 2 and 11. Understanding the commands: vlan batch 10 20 Creates 2 VLANs: VLAN 10 and VLAN 20 specifically The space between 10 and 20 means these are two separate VLAN IDs Result: VLAN 10, VLAN 20 → 2 VLANs vlan batch 10 to 20 Creates 11 VLANs: VLAN 10 through 20 inclusively The keyword to specifies a range of VLANs Result: VLAN 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 → 11 VLANs
-
ButcherCapybara 👍 1 Answered DVlan batch 10 20 creates 2 Vlans. 10 and 20. Total 2 Vlan batch 10 to 20 creates 11 Vlans. 10,11,12,13,14,15,16,17,18,19,20. Total 11
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.