Lanyiyun: Centos7 system check network card, network information command list

In CentOS 7 system, you can use the following command to view the network card and network information:

  1. ifconfig: Display the configuration information of the network interface, including IP address, MAC address, etc.
  2. ip addr: Display the configuration information of the network interface, including IP address, MAC address, etc. Similar  ifconfigfunctionality, but with more options and information.
  3. ip link: Display the link status and information of the network interface, including interface name, status, MAC address, etc.
  4. route -n: Display the routing table information of the system, including destination network, gateway, subnet mask, etc.
  5. netstat -rn: Display the routing table information of the system,  route -nsimilar to the function.
  6. ping: Used to test network connectivity. It can be used  ping <IP地址>to test the connectivity with the host with the specified IP address.
  7. traceroute: Used to track the path of network data packets on the network. It can be used  traceroute <IP地址>to track the path to the host with the specified IP address.
  8. nslookup: Used to query DNS records and can be used  nslookup <域名>to query the IP address of a specified domain name.
  9. ss -tunlp: Display the system’s network connection information, including TCP, UDP connections and listening ports.
  10. hostname: Displays the hostname of the system.

These commands provide a wide range of network information and configuration viewing functions. You can choose the appropriate command according to your needs to obtain the required network information.

Please note that some commands may need to be run as root or require the corresponding software package to be installed. If the command cannot be executed or cannot be found, you can try to use  sudothe command to obtain root privileges or use  yumthe command to install the required software package.

In summary, the above are commonly used commands to view network card and network information in CentOS 7 systems. By using these commands, you can obtain detailed information about network interfaces, routing tables, network connectivity, etc.

Guess you like

Origin blog.csdn.net/tiansyun/article/details/132723809