IP addresses can be divided into two categories, public and internal. A public IP is a unique IP address that is accessible from the Internet. Internal IP addresses are reserved for use within your private network and are not directly exposed to the Internet. Furthermore, there are two types of IP addresses, IP version 4(IPv4) and IP version 6(IPv6).
In Linux you can determine the system's internal IP address by querying the network stack using commands, For example: ip, ifconfig or hostname.
In Linux, the standard command for displaying and configuring network interfaces is ip.
To display a list of all network interfaces and associated IP addresses, type the following command:
ip addr
The output will look like this. The internal IP address is highlighted.
You can also display the internal IP address using the following command:
hostname -I
ifconfig
Linux video tutorial recommendation: linux video tutorial
The above is the detailed content of How to check ip address in linux. For more information, please follow other related articles on the PHP Chinese website!