Courseiva
NetworkinghardMultiple ChoiceObjective-mapped

LFCS Networking Practice Question

A systemd-networkd managed interface enp1s0 needs to be configured with a static IP address 192.168.1.100/24 and a default gateway via 192.168.1.1. Which .network file configuration is correct?

⚠ Common exam trap

A common mix-up: candidates confuse the `[Match]` section key `Name=` with `Interface=` (which is used in other tools like ifcfg files) and mistakenly use `DefaultGateway=` (a valid directive in some network configuration systems like Netplan) instead of the correct `Gateway=` in systemd-networkd.

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

[Match] Name=enp1s0 [Network] Address=192.168.1.100/24 Gateway=192.168.1.1

Systemd-networkd uses the `[Match]` section with `Name=` to match the interface, and the `[Network]` section with `Address=` to assign a static IP address and `Gateway=` to set the default gateway. The syntax `Address=192.168.1.100/24` is the proper directive for defining a static IP address in a .network file, and `Gateway=192.168.1.1` correctly specifies the default 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.

  • [Match] Interface=enp1s0 [Network] StaticIP=192.168.1.100/24 Gateway=192.168.1.1

    Why it's wrong here

    'Interface' should be 'Name'; 'StaticIP' is invalid.

  • [Link] Name=enp1s0 [Network] IPAddress=192.168.1.100/24 Gateway=192.168.1.1

    Why it's wrong here

    Use [Match] not [Link]; 'IPAddress' is incorrect.

  • [Match] Name=enp1s0 [Network] Address=192.168.1.100/24 Gateway=192.168.1.1

    Why this is correct

    Correct syntax for static IP and gateway.

  • [Match] Name=enp1s0 [Network] Address=192.168.1.100/24 DefaultGateway=192.168.1.1

    Why it's wrong here

    'DefaultGateway' is not a valid key; use 'Gateway'.

About these practice questions

Courseiva writes every LFCS question from scratch — 507 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.