Which UNIX/Linux command can display IPv4 and IPv6 addresses?

Prepare for the Network Systems Exam with our comprehensive study guide. Access a variety of questions and detailed explanations designed to boost your understanding and confidence for test day!

Multiple Choice

Which UNIX/Linux command can display IPv4 and IPv6 addresses?

Explanation:
Viewing both IPv4 and IPv6 addresses is handled most effectively with the ip command from the iproute2 suite. This modern tool is designed to manage all IP addressing and routing in one place, so it presents both families in a consistent way. For example, ip addr show lists every network interface and the addresses assigned to it, with IPv4 shown under inet and IPv6 under inet6. You can also tailor the view to one family, using ip -4 addr show for IPv4 or ip -6 addr show for IPv6. Because it provides a unified, up-to-date interface for managing both address families, it's the standard choice for displaying addresses. Older tools like ifconfig are legacy and primarily target IPv4, with limited or outdated IPv6 support on some systems. Netstat focuses on connections and routing rather than a clean per-interface address list. The hostname command can sometimes display addresses, but it’s not the primary tool for discovering all addresses on the host.

Viewing both IPv4 and IPv6 addresses is handled most effectively with the ip command from the iproute2 suite. This modern tool is designed to manage all IP addressing and routing in one place, so it presents both families in a consistent way. For example, ip addr show lists every network interface and the addresses assigned to it, with IPv4 shown under inet and IPv6 under inet6. You can also tailor the view to one family, using ip -4 addr show for IPv4 or ip -6 addr show for IPv6. Because it provides a unified, up-to-date interface for managing both address families, it's the standard choice for displaying addresses.

Older tools like ifconfig are legacy and primarily target IPv4, with limited or outdated IPv6 support on some systems. Netstat focuses on connections and routing rather than a clean per-interface address list. The hostname command can sometimes display addresses, but it’s not the primary tool for discovering all addresses on the host.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy