Linux virtual machine Nat mode network settings
Connect to using NAT mode
1. Check your ip, open cmd, and enter ipconfig in the small black box. Find VMware Network Adapter VMnet8, don't close this window yet. do the next step
2. Take a look at all network connections of the machine and find VMware Network Adapter VMnet8. This is the ip connection related to the virtual machine in NAT mode. The specific way to open is shown in the figure:
3. Right-click--Properties--Internet Protocol Version 4 (TCP/IPv4) this, and then double-click. It should be empty if it has not been set before. Like this, leave it
4. Open the small black box in the first step, fill in the ip, and just use the gateway for dns. then confirm
5. Open the settings of the virtual machine (right-click - Settings), find the network adapter, and select the NAT mode. As shown
6. Menu bar--Edit--Virtual Network Editor. Then set it according to the network connection VMware Network Adapter VMnet8 we did before. specific view
7. Configure the linux network card eth0 (maybe there is no eth0, you can look at the configuration file at the beginning of ifcfg-)
vi /etc/sysconfig/network-scripts/ifcfg-eth0
8. Set DNS, use linux command
vi /etc/resolv.conf
Add this sentence. nameserver 192.168.239.2 (dns set before)
9. Restart the network configuration
service network restart
10. View the network address of linux
ifconfig