When implementing the high concurrency and high availability of the e-commerce architecture, it is necessary to create several linux virtual machines in VMware. If the default network of VMware is used, it will be obtained automatically, but sometimes the IP address of the virtual machine will be changed, which is very inconvenient to use, so How to set up a static IP address
1. Check the network adapter of the physical machine (host) and determine the adapter corresponding to NAT
Procedure: Control Panel\Network and Internet\Network Connections
My virtual machine is using this adapter
You can find the adapter used by your virtual machine in the following ways
Steps: Open VMware-Edit-Virtual Network Editor
This interface will be covered later, so don't close it yet
2. Set the properties of the NAT network adapter on the physical machine
Follow the steps in the screenshot
You can set the IP address in the third step by yourself, many people's machines are 192.168.*.1
3. Confirm the gateway IP of the virtual machine NAT mode and remember it
4. Set the virtual machine IP to manual configuration
If the box is grayed out, click the "Change Settings" button in the lower right corner, and then uncheck (remove √) "Use local DHCP service to assign IP addresses to virtual machines (D)"
5. Start the virtual machine
6. Configure the virtual machine IP address
6.1 Disconnect
Left click on the computer icon, left click on Disconnect
6.2 Open the modification interface
Right-click the computer icon, left-click Edit Connections
6.3 Select the corresponding network card (you can see "Auto eth2" in step 6.1)
Address: The IP address of the virtual machine, customized, but it must be in the same network as the IP you remembered earlier. For example, the IP you remembered earlier is 192.168.245.2, then you can choose 192.168.245.1 to 192.168.245.255 Any one of them, provided that no one else occupies the IP you set
Netmast: subnet mask, directly input 255.255.255.0
GateWay: Gateway, fill in the IP required to remember
DNS Servers: DNS server IP, fill in the IP required to remember
Click "Apply"
7. Reconnect to the network
Left click on the computer icon, left click on Auto eth2
8. Test the network
8.1 Have you figured it out with the host?
8.2 Whether the host and the virtual machine are connected
8.3 Whether the virtual machine can access the Internet
Note: Some students may encounter the situation that the port is blocked. If it is not so serious, students can use the following two commands to close the firewall of the virtual machine
1. Temporarily turn off the firewall (the firewall will start again after restarting the virtual machine)
service iptables stop
2. Permanently turn off the firewall
chkconfig iptables off