CentOS set static IP in VMware

Source: Internet
Author: User

Because before the MongoDB shards are not used replica set, the recent network pressure is large, so prepare to study, so in their own computer virtual machine to build the environment, but found that before VMware set up DHCP, so every time after the resume of the virtual machine IP is changed, The previously built MONGODB environment is always a problem and re-construction is very troublesome, so set a static static IP, the steps are simple:

first turn off VMware's DHCP:

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:

Click OK to do it.

To set up a CentOS static IP:

Three configuration files are involved, namely:


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


Specifies the gateway address.

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

Device= "eth0" #BOOTPROTO = "DHCP" bootproto= "Static" Ipaddr= "00:0c : 29:56:8f:ad "ipv6init=" no "nm_controlled=" yes "onboot=" yes "type=" Ethernet "uuid=" Ba48a4c0-f33d-4e05-98bd-248b01691c20 "dns1=

Note : Here DNS1 is required to be set otherwise the domain name resolution cannot be performed.

Last configuration under/etc/resolv.conf:


In fact, this step can be omitted, the above set the DNS server address after the system will automatically modify this configuration file.

This is a simple few steps after the virtual machine's IP has been

CentOS set static IP in VMware

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.