Home > Operation and Maintenance > Linux Operation and Maintenance > Teach you how to configure a static IP address for a virtual machine

Teach you how to configure a static IP address for a virtual machine

巴扎黑
Release: 2017-07-17 15:52:29
Original
4498 people have browsed it

Use VMware to configure the static IP address of the virtual machine

1. After installing the virtual machine, click on the menu bar Select Edit→Virtual Network Editor, open the Virtual Network Editor dialog box, select the Vmnet8 Net network connection method, set the subnet IP as desired, click the NAT setting page to view the subnet mask and gateway , will be used later to modify the static IP.

2. Check the host VM8 network card settings and open the network and Sharing Center → Change Adapter Settings →, right-click on VMware Network Adapter VMnet8 and select the Properties button to open the Properties dialog box.

3. In the lower right corner of the virtual machine, click the network adapter button, right-click and select Disconnect, and then reconnect to ensure that you just settings take effect. Then start the virtual machine and enter ifcfg to view the currently assigned IP.

4. Modify the network configuration file, turn off the host firewall (/etc/init.d/iptables stop), and then check the firewall Please check the status (chkconfig iptables status), and then ping the host IP (192.168.223.11), host VM8 IP (192.168.219.1), and the gateway IP (192.168.219.2) between the host and the virtual machine. This can generally indicate that the fixed IP of the virtual machine is successfully set.

vi /etc/sysconfig/network-scripts/ifcfg-eth0 is:

(Tip: Press a key to enter insert mode, press esc, press ":wq" to save and exit)

DEVICE=eth0

HWADDR=00:0C:29:FA:C8:C2 (physical address cannot be copied)

TYPE=Ethernet

UUID=b1aff802-155b-445e-b9cc-485d30aa6e4e (The 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 turned off

#5. Restart the virtual machine (reboot) to verify the IP Whether it is fixed or not.

The above is the detailed content of Teach you how to configure a static IP address for a virtual machine. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template