Solution to the IP address not being displayed under Linux

Solution to the IP address not being displayed under Linux

Preface

Environment: Create a Linux virtual machine on VMware Workstation

Problem: When checking the IP address through ifconfig on Linux, the IP address cannot be displayed

When you enter ifconfig to view, the IP address is not displayed in the middle, as shown below

The network icon in the lower right corner is found to be disconnected, and it is determined that the problem is caused by the virtual network card not being connected.

Solution:

Step 1

Directly click the icon to connect manually, as shown below

Enter ifconfig again to view the IP address, the problem is solved; but shut down the virtual machine, and then open it again, the network is still disconnected

Step 2

Enter the following command in the command box, the result is as shown below

vi /etc/sysconfig/network-scripts/ifcfg-ens33

(Note: ens33 is the name of the network card)

Click i to enter the file editing state (Note: this needs to be done under the administrator account root);

Change ONBOOT=no to ONBOOT=yes (Note: ONBOOT indicates whether to activate the network card when the system starts);

Click Esc, enter: wq and press Enter to save and exit;

Enter the command service network restart (Note: restart service command), as shown below

When the computer is shut down and restarted again, the problem is solved. The final result is as shown below.

Reference: Linux system checks the IP address, does not display the IP address or only displays 127.0.0.1_Call me Lu Xiaobu-CSDN blog_linux checks the IP

You may also be interested in:
  • Detailed steps for manually configuring the IP address in Linux
  • Example method of viewing IP in Linux

<<:  Pure CSS free implementation code for websites to have dark mode switching function

>>:  HTML/CSS Basics - Several precautions in HTML code writing (must read)

Recommend

How to upgrade MySQL 5.6 to 5.7 under Windows

Written in front There are two ways to upgrade My...

Two ways to remove the 30-second ad code from Youku video

I believe everyone has had this feeling: watching ...

How to build pptpd service in Alibaba Cloud Ubuntu 16.04

1. To build a PPTP VPN, you need to open port 172...

How to install Windows Server 2008 R2 on Dell R720 server

Note: All pictures in this article are collected ...

HTML simple shopping quantity applet

This article shares a simple HTML shopping quanti...

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

Vulnerability Introduction The SigRed vulnerabili...

Introduction to TypeScript interfaces

Table of contents 1. Interface definition 2. Attr...

VMware virtual machine installation Linux system graphic tutorial

This article shares the specific steps of VMware ...

Solution to the same IP after cloning Ubuntu 18 virtual machine

Preface I recently used a virtual machine to inst...

Specific method to add foreign key constraints in mysql

The operating environment of this tutorial: Windo...

Modify the default scroll bar style in the front-end project (summary)

I have written many projects that require changin...

Vue page monitoring user preview time function implementation code

A recent business involves such a requirement tha...

Use of JavaScript sleep function

Table of contents 1.sleep function 2. setTimeout ...