Courseiva
Advanced Networking ConfigurationeasyMultiple ChoiceObjective-mapped

LPIC-2 Advanced Networking Configuration Practice Question

Exhibit

Refer to the exhibit.

# ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::211:22ff:fe33:4455/64 scope link
       valid_lft forever preferred_lft forever

Which command would add the default gateway 192.168.1.1 to this interface?

⚠ Common exam trap

Test-takers frequently choose the legacy `route` command (Option C) out of habit, forgetting that the modern `ip` command is required for LPIC-2 exams, and they may overlook the necessity of specifying the interface (`dev eth0`) to avoid ambiguous routing when multiple network interfaces are present.

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 route add default via 192.168.1.1 dev eth0

The `ip route add default via 192.168.1.1 dev eth0` command explicitly specifies both the gateway address and the outgoing interface, which is necessary when multiple interfaces exist or when the kernel needs to resolve the next-hop without ambiguity. The `default` keyword is a shorthand for `0.0.0.0/0` in IPv4, and the `dev eth0` clause ensures the route is bound to the correct interface.

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 route add 0.0.0.0/0 via 192.168.1.1 dev eth0

    Why it's wrong here

    Uses the network prefix 0.0.0.0/0, which is technically valid for the default route, but the preferred syntax on Linux is to use the 'default' keyword for clarity and consistency. The LPIC-2 exam expects the 'default' notation, so this option is considered incorrect.

  • ip route add default via 192.168.1.1 dev eth0

    Why this is correct

    It uses the modern `ip` command with the `default` keyword and explicitly specifies both the gateway and the outgoing interface (`dev eth0`), which is the recommended practice for adding a default gateway.

  • route add default gw 192.168.1.1

    Why it's wrong here

    Uses the legacy `route` command, which is deprecated and may not be available in all distributions. Additionally, it does not specify the outgoing interface, which is required to avoid ambiguity when multiple interfaces exist.

  • ip route add default via 192.168.1.1

    Why it's wrong here

    Missing the `dev eth0` clause, which explicitly binds the route to the correct interface. While it might work with a single interface, the specification is necessary for clarity and to prevent routing issues.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every LPIC-2 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 LPIC-2 practice question is part of Courseiva's free LPI 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 LPIC-2 exam.