Configure static IP addresses for virtual machines and static IP addresses for virtual machines
Use VMware to configure Virtual Machine static IP addresses
1. After the virtual network is installed, select Edit> Virtual Network editor on the menu bar to open the virtual network editor dialog box and selectVmnet8 NetSet the subnet IP address as needed. Click the NAT settings page to viewSubnet Mask and gateway, Which will be used later to modify the static IP address.
2. Check the VM 8 Nic settings, open Network and sharing center → change Adapter settings → right-click VMware Network Adapter VMnet8, and select Properties to open the Properties dialog box.
3. In the lower-right corner of the VM, right-click the network adapter and choose disconnect from the shortcut menu. Then, reconnect to the VM to make sure the settings take effect. Enable the VM and enter ifcfg to view the allocated IP address.
4. Modify the network configuration file and disable the host firewall (/etc/init. d/iptables stop), check the fire protection status (chkconfig iptables status), ping the Host ip address (192.168.223.11), and host VM8
IP address (192.168.219.1), host machine and gateway IP address (192.168.219.2) before the virtual machine can all indicate that the VM's fixed IP address is successfully set.
Vi/etc/sysconfig/network-scripts/ifcfg-eth0 is:
(Note: Press a to enter insert mode. Press esc and press ": wq" to save and exit)
DEVICE = eth0
HWADDR = 00: 0C: 29: FA: C8: C2 (physical addresses cannot be copied)
TYPE = Ethernet
UUID = b1aff802-155b-445e-b9cc-485d30aa6e4e (unique ID cannot be copied)
ONBOOT = yes
NM_CONTROLLED = yes
BOOTPROTO = static
IPADDR = 192.168.219.11
GATEWAY = 192.168.219.2
Check whether the firewall is disabled
5. Restart the Virtual Machine (reboot) to verify that the IP address remains unchanged.