LFCS · Question #773
Consider the following command and an abbreviated version of its output: $ netstat nr Kernel IP routing table Destination Gateway Genmask Flags Iface 192.168.165.0 0.0.0.0 255.255.255.0 U ethO…
The correct answer is A. 192.168.165.1. In the netstat -nr output, the default gateway is identified by the row with a 'Destination' of 0.0.0.0 and its corresponding 'Gateway' address.
Question
Options
- A192.168.165.1
- B255.0.0.0
- C255.255.255.0
- D0.0.0.0
- E192.168.165.0
How the community answered
(34 responses)- A91% (31)
- C6% (2)
- E3% (1)
Why each option
In the `netstat -nr` output, the default gateway is identified by the row with a 'Destination' of `0.0.0.0` and its corresponding 'Gateway' address.
In a routing table, the entry with a 'Destination' of `0.0.0.0` and a 'Genmask' of `0.0.0.0` represents the default route. Any traffic that does not match more specific routes will be sent to the 'Gateway' specified in this row. In the provided output, this gateway is `192.168.165.1`.
`255.0.0.0` is a network mask, specifically for the loopback network, not a gateway address.
`255.255.255.0` is a network mask for the `192.168.165.0` network, indicating its subnet, not a gateway address.
`0.0.0.0` in the 'Destination' column signifies the default route, but the actual gateway IP address is found in the 'Gateway' column for that specific entry.
`192.168.165.0` is a network address, specifically for the local `eth0` interface, not the default gateway.
Concept tested: Interpreting IP routing tables
Source: https://man7.org/linux/man-pages/man8/netstat.8.html
Topics
Community Discussion
No community discussion yet for this question.