1. Briefly describe the environment
Software used:VMware Workstation 15
linux version:Linux version 3.10.0-1160.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Mon Oct 19 16:18:59 UTC 2020
2. Set the virtual machine network editor mode
2.1 Click "Edit - Virtual Network Editor - NAT Mode - NAT Settings"
记住这里的 子网IP、子网掩码和网关IP,等等会用到 配置linux网卡配置
2.2 Configure the linux network configuration file
[root@lkk /]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
The modification details are as follows:
DNS1=8.8.8.8
DNS2=8.8.4.4
IPADDR=192.168.75.128
PREFIX=250.250.250.0
GATEWAY=192.168.75.2
Save and exit after modification
2.3 Restart the linux network card
[root@lkk /]# service network restart
After restarting, try again ping
and get the following results to prove that ping
the domain name is successful