Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify ip address, view gateway and configure network environment in Linux virtual machine

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to modify the ip address, view the gateway and configure the network environment in the Linux virtual machine. The article is very detailed and has a certain reference value. Interested friends must read it!

Modify the ip address of the virtual machine:

Go to the following interface and modify the subnet ip directly.

View the gateway:

Linux network environment configuration:

The first method (automatic acquisition):

Description: after logging in, set up the automatic acquisition of ip through the interface

Let's go to the settings first:

Check the automatic connection and click apply. After that, you can connect to the network automatically every time you start the system.

Features: Linux will automatically obtain ip after startup, the disadvantage is that each automatic access to the ip address may be different, this method is not suitable for servers, because the ip of our server needs to be fixed in real time.

The second method: (specify the ip of the fixed roof)

Description:

Directly modify the configuration file to specify ip, and you can link to the public network (recommended by programmers) and edit vim / etc/sysconfig/network-scripts/ifcfg-eth0 (vim / etc/sysconfig/network-scripts/ifcfg-ens33 for centos7 or above)

Requirement: change IP to static, IP address is 192.168.184.130

(in this part, because I deleted the ens33 file by mistake, I couldn't operate it, so I cut the picture from Mr. Han Shunping's video and released it.)

After that, be sure to restart the network service: service network restart, or reboot can restart the machine.

The above is all the contents of the article "how to modify the ip address, view the gateway and configure the network environment in the Linux virtual machine". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report