LPIC-2 Advanced Networking Configuration Practice Question
An administrator wants to configure a virtual IP address on interface eth0 with IP 192.168.1.100/24. Which command correctly adds the virtual IP as an alias?
⚠ Common exam trap
Test-takers frequently confuse the `ip` command's syntax with the older `ifconfig` syntax, mistakenly using the `alias` keyword or misapplying the `label` parameter, when in fact `iproute2` requires the alias to be specified as part of the device name (e.g., `eth0:0`).
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
✓
ip addr add 192.168.1.100/24 dev eth0:0
The `ip addr add` command with `dev eth0:0` directly assigns the IP address to the virtual interface `eth0:0`, which is the standard method in the `iproute2` suite for creating an alias. The `ip` command does not use an `alias` keyword; instead, the device name itself (e.g., `eth0:0`) defines the alias. This approach is consistent with modern Linux networking, replacing the deprecated `ifconfig` method.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
ip addr add 192.168.1.100/24 dev eth0 alias eth0:0
Why it's wrong here
Incorrect: The ip command does not support an 'alias' keyword; the alias is defined by the device name (e.g., eth0:0).
- ✓
ip addr add 192.168.1.100/24 dev eth0:0
Why this is correct
Correct: The ip addr add command with dev eth0:0 assigns the IP directly to the virtual interface alias, which is the standard iproute2 method.
- ✗
ip addr add 192.168.1.100/24 dev eth0 label eth0:0
Why it's wrong here
Incorrect: The 'label' parameter only sets a descriptive label for the address; the device remains eth0, so the IP is not assigned to eth0:0.
- ✗
ifconfig eth0:0 192.168.1.100 netmask 255.255.255.0
Why it's wrong here
Incorrect: ifconfig is deprecated and not available on all modern distributions; the ip command is the standard tool. Although the syntax is valid, the question expects the iproute2 approach.
Go deeper
Related to this question
About these practice questions
This LPIC-2 question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI 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 LPIC-2 exam.