Tutorial on how to modify the IP address of a Linux virtual machine, check the gateway, and configure the network environment

Tutorial on how to modify the IP address of a Linux virtual machine, check the gateway, and configure the network environment

Modify the IP address of the virtual machine:

Enter the following interface and modify the subnet IP directly.

View the gateway:

Linux network environment configuration:

The first method (automatic acquisition):

Note: After logging in, use the interface to set up automatic IP acquisition

Let’s go into the settings first:

Check Automatically connect and click Apply. After that, each time you start the system, you can automatically connect to the network.

Features: Linux will automatically obtain an IP address after startup. The disadvantage is that the IP address automatically obtained each time may be different. This method is not suitable for servers because the IP address of our server needs to be fixed in real time.

The second method: (specify the fixed top ip)

illustrate:

Directly modify the configuration file to specify the IP address and connect to the external network (recommended by programmers). Edit vim /etc/sysconfig/network-scripts/ifcfg-eth0 (for centos7 and above, vim /etc/sysconfig/network-scripts/ifcfg-ens33)

Requirement: Change the IP to static, IP address is 192.168.184.130

(This part is because I deleted the ens33 file by mistake, and I can't do anything else, so I just took a screenshot from Han Shunping's video and posted it here...)

After that, you must restart the network service: service network restart, or reboot the machine

Summarize

The above is the tutorial on how to modify the IP address of a Linux virtual machine, check the gateway, and configure the network environment. I hope it will be helpful to you. If you have any questions, please leave me a message and I 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:
  • Complete steps to configure a static IP address for a Linux virtual machine
  • How to configure static IP in Linux
  • Detailed steps for manually configuring the IP address in Linux

<<:  javascript input image upload and preview, FileReader preview image

>>:  Detailed explanation of MLSQL compile-time permission control example

Recommend

MySQL should never write update statements like this

Table of contents Preface cause Phenomenon why? A...

CSS Sticky Footer Implementation Code

This article introduces the CSS Sticky Footer imp...

Sharing tips on using Frameset to center the widescreen

Copy code The code is as follows: <frameset co...

vue-table implements adding and deleting

This article example shares the specific code for...

Detailed explanation of the installation and use of Vue-Router

Table of contents Install Basic configuration of ...

js to realize web music player

This article shares simple HTML and music player ...

How to obtain root permissions in a docker container

First, your container must be running You can vie...

js implements custom drop-down box

This article example shares the specific code of ...

Summary of the use of vue Watch and Computed

Table of contents 01. Listener watch (1) Function...

mysql installer web community 5.7.21.0.msi installation graphic tutorial

This article example shares the specific code for...

How to migrate the data directory in mysql8.0.20

The default storage directory of mysql is /var/li...

Example of how to embed H5 in WeChat applet webView

Preface WeChat Mini Programs provide new open cap...

Three ways to implement animation in CSS3

This is a test of the interviewee's basic kno...

Detailed explanation of how to use the calendar plugin implemented in Vue.js

The function to be implemented today is the follo...