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

JS+Canvas realizes dynamic clock effect

A dynamic clock demo based on Canvas is provided ...

Detailed steps for Linux account file control management

In the Linux system, in addition to various accou...

TCP third handshake data transmission process diagram

The process packets with the SYN flag in the RFC7...

Detailed steps to upgrade mysql8.0.11 to mysql8.0.17 under win2008

Upgrade background: In order to solve the vulnera...

Tutorial on installing lamp-php7.0 in Centos7.4 environment

This article describes how to install lamp-php7.0...

Implement group by based on MySQL to get the latest data of each group

Preface: The group by function retrieves the firs...

HTML table markup tutorial (16): title horizontal alignment attribute ALIGN

By default, the table title is horizontally cente...

js to implement add and delete table operations

This article example shares the specific code of ...

Real-time refresh of long connection on Vue+WebSocket page

Recently, the Vue project needs to refresh the da...

Ubuntu regularly executes Python script example code

Original link: https://vien.tech/article/157 Pref...

Solution to 700% CPU usage of Linux process that cannot be killed

Table of contents 1. Problem Discovery 2. View de...

Step by step guide to build a calendar component with React

Table of contents Business Background Using Techn...

Websocket+Vuex implements a real-time chat software

Table of contents Preface 1. The effect is as sho...