LFCS Networking Practice Question
A Linux server uses NetworkManager and has a wired connection profile named 'Wired connection 1'. The administrator needs to set a static IPv4 address 10.20.30.40/24 with gateway 10.20.30.1, and ensure the change persists across reboots. Which sequence of commands accomplishes this?
⚠ Common exam trap
The trap here is assuming that ip addr and ip route commands persist across reboots or that 'nmcli dev modify' is a valid way to change persistent settings.
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
✓
nmcli con mod 'Wired connection 1' ipv4.addresses 10.20.30.40/24 ipv4.gateway 10.20.30.1 ipv4.method manual && nmcli con up 'Wired connection 1'
The correct approach uses 'nmcli con mod' to alter the existing connection profile's IPv4 settings and set the method to manual, then brings the connection up to apply the changes. This persists the static address and gateway in NetworkManager's configuration, satisfying the reboot requirement. Lower-level ip commands are temporary and do not modify profiles, while creating a duplicate profile or using an invalid command would not achieve the goal.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
nmcli dev modify eth0 ipv4.addresses 10.20.30.40/24 ipv4.gateway 10.20.30.1 ipv4.method manual
Why it's wrong here
The 'nmcli dev modify' command does not exist; device management uses 'nmcli dev' subcommands like connect, disconnect, or status, but not 'modify'. Configuration changes are made to connection profiles with 'nmcli con mod', not to devices directly, so this command will produce an error.
- ✓
nmcli con mod 'Wired connection 1' ipv4.addresses 10.20.30.40/24 ipv4.gateway 10.20.30.1 ipv4.method manual && nmcli con up 'Wired connection 1'
Why this is correct
This is correct because 'nmcli con mod' modifies the persistent connection profile, setting the static address, gateway, and method to manual, and 'nmcli con up' reactivates the profile to apply the changes immediately. NetworkManager stores the configuration in its connection files, so the settings survive reboots.
- ✗
ip addr add 10.20.30.40/24 dev eth0 && ip route add default via 10.20.30.1
Why it's wrong here
These ip commands apply the address and route only to the running kernel; they are not stored in any NetworkManager profile and will be lost on reboot or when the interface is brought down. They do not modify the persistent configuration, so they fail the requirement of surviving reboots.
- ✗
nmcli con add type ethernet con-name 'Wired connection 1' ifname eth0 ip4 10.20.30.40/24 gw4 10.20.30.1
Why it's wrong here
This command attempts to create a new connection profile with the same name, which will fail because a profile named 'Wired connection 1' already exists. Even if a different name were used, it would create a duplicate profile rather than modifying the existing one, leading to conflicting configurations.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LFCS question from scratch — 406 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.