CompTIA Linux+ (XK0-006)TroubleshootingEasy
A system administrator is investigating a Linux server that intermittently loses network connectivity. Pinging local hosts works, but external websites are unreachable. The administrator suspects a problem with the default gateway. Which command should they use to check the current routing table, specifically looking for the default route?
- Aip a
- Bcat /etc/resolv.conf
- Cping 8.8.8.8
- Dip route show
Show answer & explanationAnswer & explanation
Correct answer: D. ip route show
`ip route show` (or `ip r`) displays the kernel routing table, which includes the default route that directs traffic to external networks. If the default route is missing or incorrect, external connectivity will fail while local connectivity remains.
Why the other options are wrong
- A. `ip a` shows network interface addresses, not routing information.
- B. `cat /etc/resolv.conf` shows DNS server configuration, not routing information.
- C. `ping 8.8.8.8` tests connectivity to a specific external IP but doesn't show the routing table itself.
ip route show
The `ip route show` command displays the kernel routing table, which dictates how network packets are forwarded to their destinations, including the default route for traffic outside the local subnet.
- Shows all configured network routes.
- Essential for verifying the default gateway configuration.
- Used to troubleshoot network connectivity issues beyond the local subnet.
Memory trick: Routing means showing the way, like a map.