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.
ip route show dev enp1s0Incorrect. 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.
ip link set dev enp1s0 downIncorrect. 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
Interface counters
Kernel-maintained counts of packets, errors, and drops at an interface.
Socket
A local or remote endpoint associated with a transport protocol and process.
Path tracing
A diagnostic method that observes hops and path limits toward a destination.