Virtual Linux in VMware Workstation Shares the Internet through NAT
Under the VMware Workstation Virtual Machine, Linux virtual machines need to access the Internet, which is usually in the bridging mode. However, my computer has different Internet access environments, and I am too lazy to always configure the Linux Nic information, set to NAT mode to share the network card of the real machine to access the Internet.
There are errors or other problems, big and small.
The premise is that your virtual machine is created through vmware workstation. When installing vmware workstation, two NICS will be added to your system, one VMware Network Adapter VMnet1; VMware Network Adapter VMnet8 is used here.
Steps:
1. Change the NIC VMware Network Adapter VMnet8 to DHCP to automatically obtain the IP address.
2. Connect the NIC of the Linux virtual machine to the VMnet8 Nic of the VMware Network Adapter. For example:
3. Share the Network card (wired or wireless Network card) that you are currently surfing the Internet with the VMware Network Adapter VMnet8 Network card. enable the Network card attributes and share them with you. For example:
4. Check the connection details of the VMware Network Adapter VMnet8 Nic. The NIC has automatically obtained an IP address of 192.168.137.1/24 and changed it to manual, set the DNS to the DNS used by the physical machine to access the Internet, for example:
5. At this time, you can configure the nic ip address of the Linux virtual machine to the IP address range 192.168.137.x/24. The Gateway is configured as 192.168.137.1, And the DNS is configured as the DNS address of the VMware Network Adapter VMnet8 Nic, in this case, the Linux virtual machine can ping the physical machine and the Internet.
At this point, the configuration of the Internet on the Linux virtual machine is complete !!!
Vmwarevm Linux accesses the Internet through NAT
This article permanently updates the link address: