Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the command for linux to view the network card information?

Shulou Source: shulou.com Published: 2022-06-03 04:11:31 10月03日 Update

1. Use the ifconfig command to view the Nic information

Ifconfig is a command used to display or configure network devices (network interface cards) in linux. Its full name is network interfaces configuring in English. Ifconfig sets the status of the network device or displays the current settings.

Example:

2. Use ethtool to view the network card

Ethtool is a command used to query and set network card parameters under Linux.

Summary of usage:

Ethtool ethx / / query the basic settings of ethx network port, where x is the number of the corresponding network card, such as eth0, eth2, etc.

Ethtool-h / / displays command help for ethtool (help)

Ethtool-I ethX / / query the relevant information of ethX network port

Ethtool-d ethX / / query ethX network port registration information

Ethtool-r ethX / / resets the ethX port to adaptive mode

Ethtool-S ethX / / query the statistics of sending and receiving packets on ethX network port

Ethtool-s ethX [speed 10 | 100 | 1000] [duplex half | full] [autoneg on | off] / / set the network port rate to 100pm and 1000m, set half / full duplex, and set whether the network port is self-negotiated.

Example:

[root@CentOS76 ~] # ethtool ens192Settings for ens192: Supported ports: [TP] Supported link modes: 1000baseT/Full 10000baseT/Full Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 10000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 0 Transceiver : internal Auto-negotiation: off MDI-X: Unknown Supports Wake-on: uag Wake-on: d Link detected: yes [root@CentOS76 ~] #

These are the details of how linux views the network card information. Please pay attention to other related articles for more information.

Tags: Network port network card query information command network example network device device full name content parameter namely interface interface card article more summary mode status Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei macOS Shulou Information Shulou Technology OPPO Reno