Use the ifconfig command to view network interface information

ifconfig is a Linux/Unix command that can be used to view and configure network interface information. Enter the ifconfig command in the terminal to display all network interface information in the current system, including IP address, MAC address, subnet mask, network status, etc. The ifconfig command can also be used to enable or disable specific network interfaces, configure network parameters, etc. The following is an example of using the ifconfig command to view network interface information:

  1. Open the terminal and enter the ifconfig command, press Enter.

  2. The terminal will display all network interface information in the current system. As follows:

 

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 70:3a:cb:7b:e2:45 
inet6 fe80::723a:cbff:fe7b:e245%en0 prefixlen 64 secured scopeid 0x4 
inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active

Among them, en0 indicates the name of the network interface, the number after ether is the MAC address, the number after inet is the IP address, netmask is the subnet mask, broadcast is the broadcast address, media is the media type connected to the network interface, and status indicates the network interface Connection Status.

Guess you like

Origin blog.csdn.net/weixin_42279822/article/details/130641955