Return enp1s0 from administrative DOWN to UP with iproute2.
Do not add an IP address.
Which command is appropriate?
ip link set dev INTERFACE up changes the administrative link state. Carrier, addresses, and routes must be checked separately.
Detailed explanation
ip address add up dev enp1s0Incorrect. This is not valid address syntax.
Incorrect. This is not valid address syntax.
ip route add up dev enp1s0Incorrect. It does not change link state and treats up as a route value.
Incorrect. It does not change link state and treats up as a route value.
ip link show dev enp1s0 upIncorrect. show only inspects the link.
Incorrect. show only inspects the link.
ip link set dev enp1s0 upCorrect. It sets enp1s0 administratively up.
Correct. It sets enp1s0 administratively up.
Try it yourself
An example you can run in a temporary verification environment.
ip link help 2>&1 | sed -n '1,6p'Expected result
ip link setのup、downなどの構文概要Key points
- link set
- Select the device with dev
- up is the administrative state
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.