Prepare for the CompTIA Cloud+ Test. Utilize flashcards and multiple choice questions, with hints and explanations for each question. Ensure your readiness for success in this certification exam.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What command can Donna run to collect her source IP address on the Linux bastion host?

  1. curl /localhost/metadata/global/interface

  2. ipconfig

  3. ifconfig

  4. netstat

The correct answer is: ifconfig

The command that Donna should run to collect her source IP address on the Linux bastion host is ifconfig. This command is integral in managing network interfaces in Unix-like operating systems, including Linux. By using ifconfig, Donna can view detailed information about all of the network interfaces on the system. This includes the IP addresses currently assigned to each interface, along with other critical networking details such as the netmask and broadcast address. In the context of identifying the source IP address, ifconfig provides a straightforward and effective means of retrieving this information directly from the system's network configuration. Additionally, ifconfig has been a long-standing command in Linux for network interface management. The other options provided do not fulfill the requirement for gathering the source IP address: - Using curl with a local address would not directly provide the needed information about the interface's source IP; it's more for fetching data from web resources. - The command ipconfig is specific to Windows and won’t work in a Linux environment. - While netstat is useful to inspect active connections and related network statistics, it does not typically display interface IP addresses directly. Thus, ifconfig stands out as the appropriate choice for this task in a Linux setting.