Inspect current interfaces and their assigned IPv4 and IPv6 addresses without changing configuration.
Use iproute2.
Which command is appropriate?
ip address show displays each interface's IPv4 and IPv6 addresses and attributes. The shorter ip addr show form is equivalent.
Detailed explanation
ip route showIncorrect. ip route show displays the routing table.
Incorrect. ip route show displays the routing table.
ip address showCorrect. ip address show displays interface address information.
Correct. ip address show displays interface address information.
ip neighbor showIncorrect. ip neighbor show displays the neighbor cache.
Incorrect. ip neighbor show displays the neighbor cache.
ip link deleteIncorrect. ip link delete changes and removes a link.
Incorrect. ip link delete changes and removes a link.
Try it yourself
An example you can run in a temporary verification environment.
ip address show loExpected result
loのlink情報と127.0.0.1/8、環境により::1/128などのアドレス情報Key points
- address refers to IP addresses
- show is read-only
- It can be narrowed to an interface
Notes
- Environment: iproute2 / 読み取り専用
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.