Inspect enp1s0's administrative state, MTU, MAC address, and carrier status without changing it.
Use iproute2.
Which command is appropriate?
ip link show dev INTERFACE displays link flags, MTU, state, qdisc, and link-layer address.
Detailed explanation
ip address flush dev enp1s0Incorrect. address flush can remove interface addresses.
Incorrect. address flush can remove interface addresses.
ip route show dev enp1s0Incorrect. route show displays routes using the interface, not all link attributes.
Incorrect. route show displays routes using the interface, not all link attributes.
ip link show dev enp1s0Correct. It displays the requested link-layer state and attributes.
Correct. It displays the requested link-layer state and attributes.
ip link set dev enp1s0 downIncorrect. link set down changes the administrative state.
Incorrect. link set down changes the administrative state.
Try it yourself
An example you can run in a temporary verification environment.
ip link show dev lo 2>/dev/null || printf '%s
' 'ip command is not available'Expected result
loのフラグ、MTU、state、link/loopbackなどの情報Key points
- link shows layer-2 data
- show is read-only
- Inspect state and flags
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.