First, the question:
1, if set to NAT mode, the default DHCP dynamic acquisition IP address, the system will generate/ETC/SYSCONFIG/NETWORK-CONFIGS/IFCFG-ENS33 by default, the file content is as follows:
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="ens33"
UUID="ece1577e-e492-4d3c-84a2-ddccb3019424"
ONBOOT="yes"
IEEE_8021X_EAP_METHODS="MD5"
IEEE_8021X_IDENTITY="[email protected]"
IEEE_8021X_PASSWORD_FLAGS="user"
HWADDR="00:0c:29:44:47:5c"
PEERDNS="yes"
PEERROUTES="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
BOOTPROTO="dhcp"
2. Change DHCP to static IP address 3, no Internet access
[[email protected] network-scripts]# ping www.sohu.com
ping: unknown host www.sohu.com
Second, the settlement:
1, configure the virtual machine NAT environment, Edit menu->virtual Network Editor:
Subnet IP set to 192.168.130.0
Subnet Mask set to 255.255.255.0
set in NAT settings:
set the gateway IP to 192.168.130.2
set in DHCP settings:
to configure the range of IP pools: 192.168.130.50~192.168.130.254
2. Configure the host VMware Network adapter VMnet8 :
Note:
The
default gateway must be 192.168.130.0, which is consistent with the subnet of the virtual machine
DNS is not set
3, configure the virtual machine Fedora /etc/sysconfig/network-configs/ifcfg-ens33, the deletion of partial configuration, increase the DNS configuration:
TYPE="Ethernet"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
NAME="ens33"
UUID="707084bc-d3aa-483f-878b-c93e6abf4a07"
ONBOOT="yes"
#HWADDR="00:0C:29:8B:9A:F2"
HWADDR="00:0c:29:94:8e:a2"
BOOTPROTO="static"
NM_CONTROLLED="yes"
IPADDR="192.168.130.101"
NETMASK="255.255.255.0"
GATEWAY="192.168.130.2"
DNS1="192.168.1.1"
Attention:
DNS1 must be the same as the DNS of the host to remove the configuration other than the above configuration (other configurations may affect manual configuration items), otherwise you will still be unable to access the Internet
4. Test whether Internet access is available
From for notes (Wiz)
How a Linux virtual machine can access the Internet in a virtual machine when it is in NAT mode