Example method of viewing IP in Linux

Example method of viewing IP in Linux

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

How to check IP address in Linux

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 command execution results are as follows:

You can also display the internal IP address using the following command:

hostname -I

ifconfig

To view the public IP address, 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

The above are all the relevant knowledge points compiled by the editor of 123WORDPRESS.COM. If you have any supplements, please contact the editor.

You may also be interested in:
  • Detailed steps for manually configuring the IP address in Linux
  • Solution to the IP address not being displayed under Linux

<<:  Example of Vue implementing fixed bottom component

>>:  MySQL free installation version (zip) installation and configuration detailed tutorial

Recommend

Detailed tutorial for installing influxdb in docker (performance test)

1. Prerequisites 1. The project has been deployed...

Hide div in HTML Hide table TABLE or DIV content css style

I solved a problem tonight that has been botherin...

How to use VirtualBox to build a local virtual machine environment on Mac

1. Big Data and Hadoop To study and learn about b...

MYSQL database GTID realizes master-slave replication (super convenient)

1. Add Maria source vi /etc/yum.repos.d/MariaDB.r...

What to do if you forget the initial password of MySQL on MAC

The method to solve the problem of forgetting the...

Vue implements start time and end time range query

This article shares with you how to query the sta...

Implementation of element input box automatically getting focus

When making a form in a recent project, I need to...

JavaScript to achieve the effect of clicking on the self-made menu

This article shares the specific code of JavaScri...

Vue sample code for implementing two-column horizontal timeline

Table of contents 1. Implement the component time...

How to introduce img images into Vue pages

When we learn HTML, the image tag <img> int...

Windows DNS server exposed "worm-level" vulnerability, has existed for 17 years

Vulnerability Introduction The SigRed vulnerabili...

Use of nginx custom variables and built-in predefined variables

Overview Nginx can use variables to simplify conf...

Vue implements small search function

This article example shares the specific code of ...