Remove only the temporary 192.0.2.10/24 address from enp1s0.
Keep the interface and other addresses.
Which command is appropriate?
ip address delete ADDRESS/PREFIX dev INTERFACE removes the specified address. flush can remove a broader set and does not match the requirement.
Detailed explanation
ip address flush dev enp1s0Incorrect. flush may delete multiple addresses from the interface.
Incorrect. flush may delete multiple addresses from the interface.
ip link delete enp1s0Incorrect. ip link delete removes the link itself.
Incorrect. ip link delete removes the link itself.
ip route delete 192.0.2.10/24 dev enp1s0Incorrect. ip route delete removes a route, not the local address.
Incorrect. ip route delete removes a route, not the local address.
ip address delete 192.0.2.10/24 dev enp1s0Correct. It deletes the specified address from enp1s0.
Correct. It deletes the specified address from enp1s0.
Try it yourself
An example you can run in a temporary verification environment.
ip address help 2>&1 | sed -n '1,3p'Expected result
ip addressのadd、delete、showなどの構文概要Key points
- address delete
- Name the exact address
- Understand flush scope
Notes
- Environment: iproute2 help / 状態変更なし
- 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.