Courseiva
Networking →hardMultiple Select

LFCS Networking Practice Question

Which TWO are valid methods to configure a network interface on a Linux system?

⚠ Common exam trap

Candidates often confuse global network configuration files (like /etc/sysconfig/network) with per-interface configuration files, or mistake sysctl for a tool that can set interface IP addresses, when it only modifies kernel parameters unrelated to interface addressing.

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

✓

Editing /etc/network/interfaces

Option C is correct because /etc/network/interfaces is the standard configuration file used by the ifupdown toolset on Debian-based Linux distributions to define network interfaces, their addressing (static or DHCP), and related parameters. Option D is correct because nmcli connection add is the NetworkManager command-line method for creating a new connection profile that configures an interface, including its IP addressing, gateway, and DNS settings. Option A is not a valid interface configuration method because sysctl only tunes kernel runtime parameters such as net.ipv4.conf.eth0.forwarding (packet forwarding), not interface addressing or link settings. Option B is not valid because systemctl enable network.service merely sets the legacy network service to start at boot; it does not itself configure an interface. Option E is not valid because /etc/sysconfig/network is a Red Hat-style file that historically held global hostname and gateway settings, not per-interface configuration.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Using sysctl to set net.ipv4.conf.eth0.forwarding

    Why it's wrong here

    sysctl tunes kernel runtime parameters such as IP forwarding; it cannot assign an IP address, netmask or gateway to eth0. It is tempting because net.ipv4.conf.eth0.* keys are genuinely per-interface, so sysctl would be the correct choice for enabling forwarding or disabling ICMP redirects on that interface.

  • ✗

    Using systemctl enable network.service

    Why it's wrong here

    systemctl enable only sets a unit to start at boot; it does not assign an IP address, netmask or gateway to an interface. It is tempting because systemctl manages the network service daemon itself, which would be the correct tool for enabling persistent network management at boot, not for configuring interface parameters.

  • ✓

    Editing /etc/network/interfaces

    Why this is correct

    Editing /etc/network/interfaces is the Debian/Ubuntu ifupdown mechanism: persistent interface definitions consumed at boot by ifupdown, supporting static addressing, DHCP and VLAN stanzas. It satisfies the question's requirement for a valid configuration method on those distributions.

  • ✓

    Using nmcli connection add

    Why this is correct

    `nmcli connection add` creates a persistent NetworkManager connection profile, satisfying the requirement for a valid interface configuration method. It writes settings to NetworkManager's connection store, applying IP addressing, gateway and DNS declaratively rather than transiently. This contrasts with `ip addr add`, which configures a live interface but leaves no persistent profile.

  • ✗

    Editing /etc/sysconfig/network

    Why it's wrong here

    /etc/sysconfig/network holds global hostname and routing settings, not per-interface addressing; interface configuration lives in /etc/sysconfig/network-scripts/ifcfg-*. It is tempting because it is a legitimate network configuration file on RHEL-family systems, and would be the correct place to set a global gateway or hostname.

Visual reference

Client DHCP Server 1 Discover (broadcast) 2 Offer (IP: 192.168.1.10) 3 Request (I accept) 4 Acknowledge (lease confirmed) DORA — the four-step DHCP lease process

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 →

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.