For some reason, testing in a virtual machine requires a fixed IP, so the process is documented.
1. First get your gateway, convenient to use in the Cento system configuration
Choose menu bar: Edit->virtual Network Editor
Select VMnet8, click Nat settings to view the gateway address: The gateway IP here is 192.168.110.2
The next step is to get to the chase.
2. Set up a CentOS static IP:
Three configuration files are involved, namely:
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/resolv.conf
A. First modify the/etc/sysconfig/network as follows:
Specifies the gateway address.
B. Then modify the/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"
- dns1=192.168.110.2
C. Final 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.) )
[HTML]View Plaincopy
- # Generated by NetworkManager
- NameServer 192.168.110.2
This is a simple few steps after the virtual machine's IP has been 192.168.110.129.
Once the IP is fixed, you can then set the host
CentOS 6.4 Set fixed IP in VMware virtual plane