How to check the network interface usage on Linux?
To check the interface usage on a Linux system, you can utilize the following methods:
- The ifconfig command can be used to display the configuration information of the current network interface, including the interface name, IP address, subnet mask, etc. By running the command ifconfig -a, you can view detailed information about all interfaces.
- The netstat command displays information related to the network, including current connection status and listening ports. Running the command netstat -tunlp will show all current TCP and UDP port listening situations, along with their corresponding process IDs.
- lsof command: The lsof command can show the currently opened files and file descriptors on the system. Running the command lsof -i can display all network connections, including the corresponding process ID, protocol, local address, and remote address.
- The ss command is a faster and more powerful alternative to netstat, which displays information such as network connections and interface status. By running the command ss -tunlp, you can see the status of all current TCP and UDP ports being listened to, along with their corresponding process IDs.
All of the commands mentioned above must be executed in a Linux system by the root user or a user with appropriate permissions in order to see the complete interface usage status.