Add 192.0.2.10/24 to enp1s0 as a runtime setting.
Persistent profile editing is handled separately.
Which command is appropriate?
ip address add ADDRESS/PREFIX dev DEVICE adds a runtime address to the kernel. Persistence requires configuration in the management system.
Detailed explanation
ip address add 192.0.2.10/24 dev enp1s0Correct. It adds the prefix-bearing address to enp1s0.
Correct. It adds the prefix-bearing address to enp1s0.
ip link add 192.0.2.10/24 dev enp1s0Incorrect. link add creates a link object, not an IP address.
Incorrect. link add creates a link object, not an IP address.
ip route add 192.0.2.10/24 dev enp1s0Incorrect. route add creates a route to a destination network.
Incorrect. route add creates a route to a destination network.
ip neigh add 192.0.2.10/24 dev enp1s0Incorrect. neigh add creates a neighbor entry, not a local address.
Incorrect. neigh add creates a neighbor entry, not a local address.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'address=192.0.2.10/24 device=enp1s0 scope=runtime'Expected result
address=192.0.2.10/24 device=enp1s0 scope=runtimeKey points
- Use address add
- Include the prefix
- This is runtime configuration
Notes
- Environment: 設定値の表示のみ
- 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.