devlink-dev - Linux
Overview
devlink-dev is a command-line utility for managing network devices and their configurations. It provides a comprehensive interface for monitoring, modifying, and controlling network devices in Linux environments.
Syntax
devlink dev [OPTIONS] COMMAND [ARGUMENTS]
Options/Flags
- -h, –help: Display help and usage information.
- -V, –version: Print version information and exit.
- -e, –exclude-dev: Exclude a specific device from the operation.
- -s, –show-dev: Display device information as part of the command output.
- -S, –show-metrics: Display extended device metrics along with device information.
- -r, –report: Generate a report containing detailed device information.
- -f, –format: Specify the output format. Valid options are ‘json’ and ‘text’.
Examples
Display device information:
devlink dev show
Modify a device’s offload capabilities:
devlink dev set eth0 tx_offload set gro,tso
Generate a JSON report for all devices:
devlink dev report -f json > devices.json
Common Issues
- No output: Ensure that the device is properly recognized by the kernel. Check if the device status is ‘up’ using
ip link show
. - Permission denied: Verify that you have sufficient privileges to perform the operation. Use
sudo
or run the command as root.
Integration
devlink-dev can be integrated with other tools for advanced tasks:
- tc: Modify traffic control rules.
- ethtool: Retrieve device statistics and information.
- ip: Manage network interfaces.
Related Commands
- tc
- ethtool
- ip
- ifconfig
- netstat