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

Multiple solutions for cross-domain reasons in web development

Table of contents Cross-domain reasons JSONP Ngin...

Solution to Nginx SSL certificate configuration error

1. Introduction When a web project is published o...

A brief discussion on docker compose writing rules

This article does not introduce anything related ...

React diff algorithm source code analysis

Table of contents Single Node Diff reconcileSingl...

Example of Vue routing listening to dynamically load the same page

Table of contents Scenario Analysis Development S...

js realizes the magnifying glass effect of shopping website products

This article shares the specific code of js to ac...

A brief discussion on the binary family of JS

Table of contents Overview Blob Blob in Action Bl...

Implementation of webpack code fragmentation

Table of contents background CommonsChunkPlugin s...

How to add sudo permissions to a user in Linux environment

sudo configuration file The default configuration...

Three ways to jump to a page by clicking a button tag in HTML

Method 1: Using the onclick event <input type=...

MYSQL Operator Summary

Table of contents 1. Arithmetic operators 2. Comp...

HTML table tag tutorial (3): width and height attributes WIDTH, HEIGHT

By default, the width and height of the table are...