Courseiva
NetworkingmediumMultiple ChoiceObjective-mapped

How to Verify Default Gateway Configuration in Linux

A system administrator notices that a web server is not reachable from the internet but is reachable from the internal network. The server's IP is 10.0.1.10/24, and the gateway is 10.0.1.1. Which command should be used to verify the default gateway configuration?

Quick Answer

The answer is `ip route show`. This command is the correct choice because it displays the kernel routing table, and the default gateway appears as a default route entry (typically shown as `default via 10.0.1.1 dev eth0`). When a server is reachable internally but not from the internet, a missing or incorrect default gateway is the most likely cause, and `ip route show` directly verifies whether that default route exists. On the Linux Foundation Certified System Administrator LFCS exam, this question tests your ability to troubleshoot network connectivity using modern `ip` commands rather than the deprecated `route` or `netstat -rn`. A common trap is reaching for `ping` or `traceroute` first, but those only test connectivity, not the routing table itself. To remember: think of the default gateway as the "exit door" for traffic leaving your network—`ip route show` checks if that door is actually configured.

⚠ Common exam trap

Many candidates confuse `ip addr show` (which shows IP configuration) with `ip route show` (which shows routing), leading them to check the IP address instead of the default gateway when troubleshooting external connectivity.

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 show

The `ip route show` command displays the kernel routing table, including the default gateway entry. Since the server is reachable internally but not from the internet, a missing or incorrect default gateway is the likely cause. This command directly verifies whether a default route (e.g., via 10.0.1.1) is present.

Answer analysis

Option-by-option breakdown

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

  • arp -a

    Why it's wrong here

    This shows the ARP cache, not routing information.

  • ip route show

    Why this is correct

    This command displays the routing table, including the default gateway.

  • ip addr show

    Why it's wrong here

    This shows IP addresses, not the routing table.

  • ss -tln

    Why it's wrong here

    This shows listening TCP ports, not routing.

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

Same concept, more angles

2 more ways this is tested on LFCS

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A server has two network interfaces: eth0 (10.0.1.10/24, gateway 10.0.1.1) and eth1 (192.168.1.10/24, no gateway). Both are up. The default gateway is set to 10.0.1.1. A ping to 8.8.8.8 fails, but ping to 10.0.1.1 succeeds. What is the most likely cause?

hard
  • A.eth1 has no gateway configured
  • B.The default route is missing or pointing to an incorrect gateway
  • C.DNS resolution is failing
  • D.eth0 is down

Why B: Although the default gateway is set to 10.0.1.1, the default route may not be present in the routing table if it was not properly added or was later removed. The lack of a default route would allow pings to the local gateway (10.0.1.1) to succeed, but any attempt to reach an external IP like 8.8.8.8 would fail because the system does not know where to send the packets. Thus, the most likely cause is a missing or incorrectly configured default route.

Variation 2. A host with this routing table can ping 10.0.2.1 but cannot ping 8.8.8.8. What is the most likely cause?

hard
  • A.The default route is missing
  • B.The default gateway 10.0.1.1 does not have internet connectivity
  • C.The host has no route to 10.0.2.0/24
  • D.The host has no route to 10.0.1.1

Why B: The host can ping 10.0.2.1, which is on the directly connected 10.0.2.0/24 network, confirming that the local interface and link-layer are functional. However, it cannot ping 8.8.8.8, a public internet address. The routing table shows a default route via 10.0.1.1, so the host will forward the packet to that gateway. Since the host has a default route, the most likely cause is that the gateway 10.0.1.1 itself lacks internet connectivity (e.g., no upstream route, NAT misconfiguration, or ISP outage), preventing the packet from reaching 8.8.8.8.

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.