Using NAT mode
The virtual Machine network connection uses NAT mode, and the physical Machine network connection uses VMNET8.
Virtual machine settings inside--Network adapter, network connection Select NAT mode. (The IP address used to share the host)
Virtual Machine Menu Bar-edit-Virtual network editor, select Vmnet8 Nat mode,
1. On the bottom subnet, set the IP to 192.168.20.0 Subnet Mask 255.255.255.0
2. NAT setting inside Gateway IP is 192.168.20.2
3. Assigning IP addresses to virtual machines using the local DHCP service does not tick
Click Apply to exit when the settings are complete.
Physical machine network connection VMNET8 manually set the IP address 192.168.20.1 subnet mask 255.255.255.0
Gateway and DNS address 192.168.20.2 (that is, gateway address for Virtual machine NAT)
Edit the configuration file for the Linux NIC Eth0
#vi/etc/sysconfig/network-scripts/ifcfg-eth0
Enter the above command after entering, open the configuration file, use the arrow keys to move the cursor to the last line, press the letter key "O", enter the edit mode, input the following content:
ipaddr=192.168.20.3
netmask=255.255.255.0
gateway=192.168.20.2
In addition, the cursor moves to the line "Onboot=no" and changes to Onboot=yes
"Bootproto=dhcp", Change to Bootproto=none
When you're done, press the ESC key in the upper-left corner of the keyboard, enter: Wq in the lower left of the screen, enter to save the configuration file.
Set DNS address, Run command #vi/etc/resolv.conf
Move cursor to blank line, press "O" key, enter nameserver 192.168.20.2 exit Press ESC, enter: WQ carriage return to save profile.
Restart Network Service #service networks restart
After reboot #ifconfig view the configured IP address, the physical machine ping this address test is able to pass.
CentOS 6.5 Configuration network under VMware virtual machines