table of Contents
Host settings
- Open Network and Sharing Center
- Change adapter settings
We only modify the VMnet8 adapter
Change the attributes of VMnet8 as shown in the figure below. The IP address in it can be mine or 192.168.xx, but remember the address you set, which will be used to set up the virtual machine later.
Virtual machine settings
- View network card information
ifconfig
Remember the string in the red box
- Configure network card information
ens33 can be replaced with the string queried above
vim /etc/sysconfig/network-scripts/ifcfg-ens33
Add inside
IPADDR=192.168.31.221 NETMASK=255.255.255.0 GATEWAY=192.168.31.1
confirm
ONBOOT=yes
- Configure DNS
vim /etc/resolv.conf
Add to it
nameserver 223.5.5.5 nameserver 223.6.6.6
- Try to ping
ping baidu.com -c 5
If the following prompt appears, the configuration is complete
If you want to distribute multiple virtual machines, then you need to do the following configuration
- Modify hostname
vim /etc/sysconfig/network
Join
NETWORKING=yes HOSTNAME=Master
- Modify the hosts file
vim /etc/hosts
Join (after booting, there can be about 10G of free memory, about 4 to 5 virtual machines can be opened, and an average of 2G storage for one machine)
192.168.31.221 Master 192.168.31.222 Slave1 192.168.31.223 Slave2 192.168.31.224 Slave3
- Turn off SELinux
vim /etc/selinux/config
Then you can copy, and enter each virtual machine after the copy is completed (because the copy of the Master is used as the slave, then their HostName must be changed, otherwise SSH and other operations are inconvenient)
The operation is the same as the steps above to modify the host name
vim /etc/sysconfig/network
change
NETWORKING=yes HOSTNAME=Slave1
The other two slaves and so on
VMware settings
- Open VMware's virtual network editor
- Configure VMnet8