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

HTML basic structure_Powernode Java Academy

Many times when learning web page development, th...

Complete the search function in the html page

Recently I've been working on a framework tha...

Native js realizes the drag and drop of the nine-square grid

Use native JS to write a nine-square grid to achi...

Implementation of static website layout in docker container

Server placement It is recommended to use cloud s...

Docker-compose installation yml file configuration method

Table of contents 1. Offline installation 2. Onli...

More Features of the JavaScript Console

Table of contents Overview console.log console.in...

Detailed explanation of the text-fill-color property in CSS3

What does text-fill-color mean? Just from the lit...

Mysql queries the transactions being executed and how to wait for locks

Use navicat to test and learn: First use set auto...

A brief discussion on Flex layout and scaling calculation

1. Introduction to Flex Layout Flex is the abbrev...

MySQL chooses the appropriate data type for id

Table of contents Summary of Distributed ID Solut...

How to build and deploy Node project with Docker

Table of contents What is Docker Client-side Dock...