How to check IP in Linux

angryTom
Release: 2020-02-06 09:27:13
Original
8448 people have browsed it

Knowing your device's IP address is important when troubleshooting network problems, setting up new connections, or configuring firewalls. Let’s take a look at how to check the IP address in Linux!

How to check IP in Linux

Linux method of checking ip

In Linux, the standard command for displaying and configuring network interfaces is ip .

To display a list of all network interfaces and related IP addresses, type the following command:

ip addr
Copy after login

The command execution results are as follows:

How to check IP in Linux

You can also use the following command to display the internal IP address:

hostname -I
ifconfig
Copy after login

To view the public IP, you can use any of the following commands:

dig ANY +short @ resolver2.opendns.com myip.opendns.com 
dig ANY +short @ resolver2.opendns.com myip.opendns.com 
dig ANY +short @ ns1-1.akamaitech.net ANY whoami.akamai.net
Copy after login

(Online video tutorial sharing: linux video tutorial)

The above is the detailed content of How to check IP in Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template