Vmware virtual machine set fixed IP address in CentOS 7

1. Open the virtual network editor dialog

Edit -> Virtual Network Editor



2. Check physical host Network Interface Card settings

Network and Sharing Center -> Change adapter settings -> VMware Network Adapter VMnet8(right click) -> Properties -> TCP/IPv4

3. Enter virtual machine and set a fixed IP address

1
vi /etc/sysconfig/network-scripts/ifcfg-eth0

If eth0 does not exist,

1
vi /etc/sysconfig/network-scripts/ifcfg-ens33

1
2
3
4
5
BOOTPROTO="static"

IPADDR=192.168.88.100
NETMASK=255.255.255.0
GATEWAY=192.168.88.1

4. Restart network service

1
service network restart

5. Other

If you can’t resolve the domain name, you may not have DNS configured,

1. Open the /etc/resolv.conf

1
nano /etc/resolv.conf

2. Add lines for the name servers that you want to use

For example, using Alibaba Cloud DNS:

1
2
nameserver 223.5.5.5
nameserver 223.6.6.6

3. Save the file

4. To ensure that your new settings are working, ping the domain name by using the following command:

1
ping -c 3 baidu.com

Vmware virtual machine set fixed IP address in CentOS 7
https://www.hardyhu.cn/2022/01/26/Vmware-virtual-machine-set-fixed-IP-address-in-CentOS-7/
Author
John Doe
Posted on
January 26, 2022
Licensed under