010-100 · Question #16
A Linux computer has no access to the internet. Which command displays information about the network gateway for the system?
The correct answer is D. route. Displaying the default gateway on a Linux system requires a command that shows the kernel routing table. The route command prints this table, including the gateway entry.
Question
A Linux computer has no access to the internet. Which command displays information about the network gateway for the system?
Options
- Atraceroute
- Bifconfig
- Cgateway
- Droute
- Eipconfig
How the community answered
(54 responses)- A2% (1)
- B4% (2)
- C2% (1)
- D81% (44)
- E11% (6)
Why each option
Displaying the default gateway on a Linux system requires a command that shows the kernel routing table. The route command prints this table, including the gateway entry.
The traceroute command probes the network path to a remote host hop by hop and requires network connectivity to be useful; it does not simply display local gateway configuration.
The ifconfig command displays interface configuration such as IP address, netmask, and MAC address, but does not show routing or gateway information.
There is no standard Linux command called gateway; this is not a valid utility.
The route command displays and manipulates the kernel IP routing table, which includes the default gateway entry (shown as the 0.0.0.0 destination row with the gateway IP in the Gateway column). It works entirely from local kernel data and requires no internet access, making it suitable for this scenario.
The ipconfig command is a Windows utility, not a Linux command, and is not available on a standard Linux system.
Concept tested: Displaying kernel routing table and default gateway
Source: https://man7.org/linux/man-pages/man8/route.8.html
Topics
Community Discussion
No community discussion yet for this question.