Solution to Linux CentOS 6.5 ifconfig cannot query IP

Solution to Linux CentOS 6.5 ifconfig cannot query IP

Recently, some friends said that after installing CentOS in a virtual machine, they could not query the IP address using the ifconfig and ip addr commands. Here, I provide a simple and effective method;

1. Log in as root user

su root

2. Enter the folder where you configured to search for related files and find the ifcfg-eth0 file

cd /etc/sysconfig/network-scripts

3. Modify the file and change ONBOOT=no to ONBOOT=yes

vi ifcfg-eth0

4. Save and exit

:wq

5. Query IP

ifconfig

Summarize

The above is the solution to the problem that ifconfig cannot query IP in Linux CentOS 6.5 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Difference between sockaddr and sockaddr_in in Linux C
  • Solve the problem that ifconfig and addr cannot see the IP address in Linux

<<:  A brief discussion on an efficient algorithm for constructing tree structures in JavaScript

>>:  MySql 8.0.11-Winxp64 (free installation version) configuration tutorial

Recommend

Essential bonus items for optimizing and packaging the front end of Vue projects

Table of contents Preface 1. Routing lazy loading...

Solution to the Docker container cannot be stopped and deleted

Find the running container id docker ps Find the ...

Detailed explanation of the use of umask under Linux

I recently started learning Linux. After reading ...

mysql method to view the currently used configuration file my.cnf (recommended)

my.cnf is the configuration file loaded when MySQ...

Problem analysis of using idea to build springboot initializer server

Problem Description Recently, when I was building...

Use iframe to submit form without refreshing the page

So we introduce an embedding framework to solve th...

Markup Languages ​​- What to learn after learning HTML?

Click here to return to the 123WORDPRESS.COM HTML ...

A few steps to easily build a Windows SSH server

The SSH mentioned here is called Security Shell. ...

A detailed introduction to setting up Jenkins on Tencent Cloud Server

Table of contents 1. Connect to Tencent Cloud Ser...

js+Html to realize table editable operation

This article shares the specific code of js+Html ...

Simple use of Vue bus

Simple use of Vue bus Scenario description: Compo...

Detailed explanation of Vue components

<body> <div id="root"> <...

How to find slow SQL statements in MySQL

How to find slow SQL statements in MySQL? This ma...

Detailed explanation of the role and principle of key in Vue

Table of contents 1. Let’s start with the conclus...

How to disable the automatic password saving prompt function of Chrome browser

Note: In web development, after adding autocomplet...