Courseiva
Networking →easyMultiple Select

LFCS Networking Practice Question

Which TWO methods can be used to set a static IPv4 address on a CentOS 7 system? (Choose two.)

⚠ Common exam trap

Many candidates confuse temporary runtime commands like 'ip addr add' with permanent configuration methods, or they assume that systemctl can be used for network configuration because it is a common system administration tool.

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

✓

Use the nmtui utility

Nmtui is a text-based user interface for NetworkManager, which is the default networking service on CentOS 7. It allows you to interactively configure network interfaces, including setting a static IPv4 address, without needing to manually edit configuration files. Option E is correct because the ifcfg-eth0 file in /etc/sysconfig/network-scripts is the traditional, direct configuration method for network interfaces on CentOS 7, where you can set BOOTPROTO=static and define IPADDR, PREFIX, and GATEWAY.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Run the command 'systemctl set-static-ip eth0 192.168.1.100/24'

    Why it's wrong here

    No systemctl verb sets a static IP address; systemctl manages units, not network configuration. It is tempting because systemctl is the standard CentOS 7 service-control tool, and it would be correct for enabling or restarting the NetworkManager service rather than assigning addressing.

  • ✗

    Use 'ip addr add 192.168.1.100/24 dev eth0'

    Why it's wrong here

    'ip addr add' applies addressing at runtime only and is lost on reboot, so it does not persistently set a static address. It is tempting because it works immediately for testing, and it would be correct for temporary troubleshooting rather than configuring a permanent static IPv4 address.

  • ✓

    Use the nmtui utility

    Why this is correct

    The nmtui text interface writes persistent configuration into NetworkManager connection profiles, satisfying CentOS 7's requirement for a static IPv4 address that survives reboot. Unlike temporary `ip addr` changes, nmtui edits the connection's ipv4.method to manual and stores the address, prefix, gateway and DNS, which NetworkManager then applies at every activation.

  • ✗

    Edit the /etc/network/interfaces file

    Why it's wrong here

    CentOS 7 uses NetworkManager and ifcfg files under /etc/sysconfig/network-scripts; /etc/network/interfaces is Debian/Ubuntu syntax and is ignored. It is tempting because it is the standard static-IP method on Debian-family systems, so it would be correct on Ubuntu rather than CentOS 7.

  • ✓

    Edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file directly

    Why this is correct

    Editing the ifcfg-eth0 file directly sets a persistent static address on CentOS 7, satisfying the requirement for a static IPv4 configuration. The NetworkManager and network services read BOOTPROTO=none plus IPADDR, NETMASK and GATEWAY from this file at boot, so the setting survives reboots.

About these practice questions

This LFCS question is part of Courseiva's 406-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.