XK0-006 Troubleshooting Practice Question
A Linux administrator needs to view all current IPv4 addresses assigned to network interfaces on a system. Which command should be used?
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
The 'ip addr' command displays all IP addresses assigned to network interfaces. 'ifconfig' is deprecated, 'ip link' shows link-layer info, and 'hostname -I' only shows primary IPs.
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 link show
Why it's wrong here
ip link show displays interface link-layer state and flags, not assigned IPv4 addresses; address information requires ip addr show. It is tempting because ip link is the modern iproute2 tool for interface administration, and would be correct for checking whether an interface is administratively up or reading its MAC address.
- ✗
ifconfig -a
Why it's wrong here
ifconfig -a lists every interface including down ones, but the question asks for current IPv4 addresses, which ifconfig does print; however it is deprecated and absent from minimal installs, so ip addr show is preferred. It would be correct on legacy systems lacking iproute2.
- ✗
hostname -I
Why it's wrong here
hostname -I prints only the host's own non-loopback addresses, omitting interfaces that are down or unaddressed, so it cannot show all assigned IPv4 addresses per interface. It is tempting as a quick one-line address lookup, and would be correct when only the machine's primary IPs are needed.
- ✓
ip addr
Why this is correct
`ip addr` queries the kernel's netlink interface and lists every network interface with its assigned IPv4 and IPv6 addresses, satisfying the requirement to view all current IPv4 addresses. Unlike `ifconfig`, it is part of the modern iproute2 suite and remains available on current distributions.
Go deeper
Related to this question
About these practice questions
One of 781 original XK0-006 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 XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.