LFCS Networking Practice Question
A Linux server has an interface eth0 with IP 192.168.1.100/24. You need to temporarily add a secondary IP address 192.168.1.101/24 to the same interface for testing, and then verify that both addresses are present. Which two commands will accomplish this? (Choose two.)
⚠ Common exam trap
The trap here is using ifconfig without an alias, which replaces the primary IP instead of adding a secondary, and confusing ip route with ip addr.
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 show dev eth0
To add a secondary IP address temporarily, use 'ip addr add 192.168.1.101/24 dev eth0'. To verify, use 'ip addr show dev eth0'. The ifconfig command would replace the primary address, not add a secondary. The ip route command is for routing, and ip link set up only changes the interface state.
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 set eth0 up
Why it's wrong here
The 'ip link set eth0 up' command brings the interface up administratively, but it does not assign an IP address. If the interface was down, this would enable it, but it does not add the secondary IP. It is not relevant to the task of adding an address, and the interface is presumably already up.
- ✓
ip addr show dev eth0
Why this is correct
The 'ip addr show dev eth0' command displays all IP addresses configured on eth0, including the primary and any secondary addresses. This is the correct way to verify that both 192.168.1.100 and 192.168.1.101 are present. It is the standard verification command for IP configuration.
- ✗
ip route add 192.168.1.101/24 dev eth0
Why it's wrong here
The 'ip route add' command adds a route to the routing table, not an IP address to an interface. Specifying an IP address with a prefix as a route destination is incorrect; routes are for networks, not host addresses on an interface. This command would not assign the address and would likely fail or create an invalid route.
- ✓
ip addr add 192.168.1.101/24 dev eth0
Why this is correct
The 'ip addr add' command adds a new IP address to the specified interface. This is the correct modern method to add a secondary address. It takes effect immediately and does not require a restart. The address is added in addition to any existing addresses on the interface.
- ✗
ifconfig eth0 192.168.1.101 netmask 255.255.255.0
Why it's wrong here
This ifconfig command sets the primary IP address of eth0 to 192.168.1.101, replacing the existing 192.168.1.100. It does not add a secondary address. To add a secondary with ifconfig, you would need to use an alias like eth0:0. Therefore, this command would remove the original address, which is not desired.
Go deeper
Related to this question
About these practice questions
One of 406 original LFCS 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Linux Foundation exam blueprint
This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.