Set a fixed IP address for CentOS 6.4 in VMware Virtual Machine
For some reason, if you want to perform a test in a virtual machine and require a fixed IP address, record this process.
1. First obtain your GATEWAY for later use in cento System Configuration
Choose Edit> Virtual Network Editor from the menu bar.
Select VMnet8 and click NAT Settings to view the GATEWAY address. The Gateway IP address here is 192.168.110.2.
Next, you can go to the topic.
2. Set the CentOS static IP Address:
Three configuration files are involved:
/Etc/sysconfig/network
/Etc/sysconfig/network-scripts/ifcfg-eth0
/Etc/resolv. conf
A. First Modify/etc/sysconfig/network as follows:
Specify the gateway address.
B. Then modify/etc/sysconfig/network-scripts/ifcfg-eth0:
[Html] view plaincopy
- DEVICE = "eth0"
- # BOOTPROTO = "dhcp"
- BOOTPROTO = "static"
- IPADDR = 192.168.110.129
- NETMASK = 255.255.255.0
- HWADDR = "00: 0C: 29: 53: A8: 1D"
- IPV6INIT = "no"
- NM_CONTROLLED = "yes"
- ONBOOT = "yes"
- TYPE = "Ethernet"
- UUID = "f933b2bf-47eb-42f3-bea9-1f54088a2cb7"
- DNS1 = 192.168.110.2
C. Finally, configure/etc/resolv. conf: (in fact, this step can be omitted. After the DNS Server address is set above, the system will automatically modify this configuration file .)
[Html] view plaincopy
- # GeneratedbyNetworkManager
- Nameserver192.168.110.2
After a few steps, the IP address of the VM is 192.168.110.129.
After the IP address is fixed, you can set the host