200-301 Question 118
Single answerA network administrator asks you to verify the IP configuration of a client machine running Linux. Which command would you use to display the IP address, subnet mask, and default gateway of the client?
- A
ifconfig
- B
ip addr show
- C
netstat -r
- D
ping
Show answer and explanation
Correct answer: B
Explanation
In modern Linux distributions, the 'ip addr show' command is the recommended way to verify IP parameters such as the assigned IP address and subnet mask. While 'ifconfig' may still work on older systems, it is considered outdated and does not provide complete network configuration information. The other commands are either unrelated to IP parameter verification or provide incomplete information.
- A. Incorrect.
The 'ifconfig' command is deprecated in most modern Linux distributions and does not provide the default gateway information. It only displays basic IP configuration.
- B. Correct.
The 'ip addr show' command is the correct choice for modern Linux distributions. It provides detailed information about the IP address, subnet mask, and other interface details.
- C. Incorrect.
The 'netstat -r' command displays the routing table, which includes the default gateway but does not provide detailed IP configuration for the interfaces.
- D. Incorrect.
The 'ping' command is used to test connectivity to another host and does not display IP configuration details.