VMware installs the CentOS Nat method to set the static IP

Source: Internet
Author: User

"VMware in the cluster environment, etc., DHCP automatic IP access is not convenient, in order to fixed IP to reduce the frequent change of configuration information, it is recommended to use static IP to configure, network connectivity There are three ways 1.nat 2. Bridging, 3 host mode, here is the main way to NAT, Why use NAT static IP instead of bridging the static IP, the main bridge mode has a certain security, using NAT is a network-translated address, bridging is VMnet0 it needs to bind to set the corresponding network card IP needs in the same paragraph, NAT is vmnet network proxy converted IP, Used to hide internal addresses for improved security. The following is the configuration in accordance with NAT, note: Remind yourself in the configuration must be careful, do not put the IP gateway wrong Many unsuccessful reasons are not careful (I have a few times the IP filled the wrong reason) "

    • 1. View Vmnet 8 IP under the native window under cmd run ipconfig
    • 2. View the corresponding information in VMware and modify
    • 3.NAT Gateway View

    • 4./etc/sysconfig/network-script/ifcfg-eth0 Modify Key Code
< Span class= "Hljs-keyword" >class device=eth0//device name onboot=yes//The network interface is valid when the system starts bootproto=static//broadcast=192.168.154.255IPADDR= 192.168.154.101//ip address, follow the second step network segment settings 0-255 take netmask=255.255.255.0 Subnet mask, follow the second step to see the subnet mask gateway=192.168.154.2//Gateway, follow the third step to see the same gateway  dns1=192.168.154.2//dns, multiple can use "," Split nat mode dns is consistent with the gateway             
    • 5. Service Network Restart Restart

    • 6. Ping www.baidu.com can be the general success

However, other machines on the LAN cannot access the virtual machine. So we need to increase the mapping

Environment, physical machine ip:192.168.40.46, virtual machine ip:192.168.80.52

After adding the following mappings

LAN Other Machine access:

Browser input http://192.168.40.46:80 actually access is the virtual machine http://192.168.80.52:80

Similarly, native hosts, modifying 192.168.40.46 www.lamian.tv, is actually the environment for accessing virtual machines.

VMware installs the CentOS Nat method to set the static IP

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.