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 set static IP for CentOS in VMware

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to set up static IP in CentOS in VMware". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to set static IP in CentOS in VMware".

First, close the dhcp of vmware:

Edit- > virtual network editor

Select vmnet8 and remove the use local dhcp service to distribute ip address to vms option. Click nat settings to view the gateway address:

Just click ok.

Set the centos static ip:

Three profiles are involved, which are:

/ etc/sysconfig/network / etc/sysconfig/network-scripts/ifcfg-eth0 / etc/resolv.conf

First, modify / etc/sysconfig/network as follows:

Networking=yes hostname=localhost.localdomain gateway=192.168.129.2

Specify the gateway address.

Then modify / etc/sysconfig/network-scripts/ifcfg-eth0:

Device= "eth0" # bootproto= "dhcp" bootproto= "static" ipaddr=192.168.129.129 netmask=255.255.255.0 hwaddr= "00:0c:29:56:8f:ad" ipv6init= "nm_controlled=" yes "onboot=" yes "type=" ethernet "uuid=" ba48a4c0-f33d-4e05-98bd-248b01691c20 "dns1=192.168.129.2

Note: dns1 must be set here, otherwise domain name resolution cannot be performed.

Finally configure / etc/resolv.conf:

Nameserver 192.168.129.2

In fact, this step can be omitted, the system will automatically modify the configuration file after setting the address of dns server.

This is very simple. After a few steps, the ip of the virtual machine has been 192.168.129.129.

At this point, I believe you have a deeper understanding of "how to set static IP in CentOS in VMware". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Development

Wechat

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

12
Report