Home >Operation and Maintenance >Safety >How to implement virtual machine NAT mode to access the Internet

How to implement virtual machine NAT mode to access the Internet

WBOY
WBOYforward
2023-05-20 15:22:121829browse

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete