How to implement virtual machine NAT mode to access the Internet

WBOY
Release: 2023-05-20 15:22:12
forward
1808 people have browsed it

When using a vmware virtual machine to learn Linux, the common problem encountered is that the host machine cannot communicate normally and the virtual machine cannot access the Internet normally. Here is a detailed configuration for easy reference later

After installing vmware After installing the software, you must have a virtual network card VMnet8 to use NAT mode. Here we take win10 as an example

How to implement virtual machine NAT mode to access the Internet

Go back to the virtual machine settings:

How to implement virtual machine NAT mode to access the InternetTo use NAT mode, the vmnet8 network card here must be connected and used, and both gray ticks must be checked.

How to implement virtual machine NAT mode to access the Internet

You only need to confirm whether NAT mode is enabled. , then the network configuration of linux is as follows:

[root@zabbix ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

HWADDR =00:0C:29:7C:01:85

TYPE=Ethernet

UUID=2ec33123-5547-4b05-ac7c-c04c47963bc1

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=dhcp ~]# cat /etc/resolv.conf

; generated by /sbin/dhclient-script

search localdomain

nameserver 192.168.25.2 #This is gateway

How to confirm that it is the correct gateway:

The ip information of vmnet8 of the win10 host:

How to implement virtual machine NAT mode to access the Internet

The above is the detailed content of How to implement virtual machine NAT mode to access the Internet. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template