Each site has a unique, public IP address that anyone can access from anywhere.
Internet Protocol Internet Protocol (IP) does not need to be introduced--we use it every day. Even if you don't use it directly, when you enter website-name.com on the browser, it looks for the IP address of the URL and then loads the site.
We divide IP addresses into two categories: private and public. A private IP address is a private IP address that is provided by (and the company intranet) for your non-line. They range from 10.xxx, 172.16.xx-172.31.xx, and 192.168.xx, where x=0 to 255. The public IP address, as the name implies, is "public" and you can access it anywhere in the world. Each site has a unique IP address that anyone can access at any point, which can be considered a public IP address.
In addition, there are two types of IP addresses: IPv4 and IPV6.
The IPV4 address format is x.x.x.x, where x=0 to 255. There are 232 (approximately 4 billion) possible IPv4 addresses.
The IPV6 address uses more complex hexadecimal. The total number of bits is 128, which means there are 2128 (340 followed by 36 0!). ) a possible IPv6 address. IPV6 has been introduced to resolve the foreseeable IPv4 address exhaustion problem.
As a network engineer, I recommend that you do not share your machine's public IP address with anyone. Your WiFi router has a public IP, or WAN (WAN) IP address, and any device connected to that WiFi is the same. All devices connected to the same WiFi have the private IP address described above. For example, my laptop's IP address is 192.168.0.5, and my phone number is 192.168.0.8. These are private IP addresses, but both have the same public IP address.
The following command lists the IP address list to find the public IP address of your computer:
ifconfig.me
curl -4/-6 icanhazip.com
curl ipinfo.io/ip
curl api.ipify.org
curl checkip.dyndns.org
dig +short myip.opendns.com @resolver1.opendns.com
host myip.opendns.com resolver1.opendns.com
curl ident.me
curl bot.whatismyipaddress.com
curl ipecho.net/plain
The following command will give you the private IP address of the interface:
ifconfig -a
ip addr (ip a)
hostname -I | awk ‘{print $1}’
ip route get 1.2.3.4 | awk ‘{print $7}‘
(Fedora) Wifi-Settings→ click the setting icon next to the Wifi name that you are connected to → Ipv4 and Ipv6 both can be seen
nmcli -p device show
Note: Some tools need to be installed on your system based on the Linux distribution you are using. In addition, some of the mentioned commands use third-party Web sites to obtain IP
Via:https://opensource.com/article/18/5/how-find-ip-address-linux
Archit Modi topic: lujun9972 Translator: GEEKPI proofreading: Wxy
How to find your public IP address in Linux