Replicating virtual machines problems encountered in network configuration eth0 and eth1 in the process of building cluster nodes for VMware CentOS and virtual machine static IP configuration method in NAT mode

Source: Internet
Author: User

After installing the first virtual machine in CentOS, it is customary to create other virtual machines by cloning, after which VMware cannot find the NIC information and the system thinks it is reinstalled, so a new NIC is re-created called eth1.

and use Ifconfig-a to view the network card information, only the LO information, unable to display the eth0.

Workaround:to modify the 70-persistent-net.rules file under/ETC/UDEV/RULES.D, we will find the following two lines:# PCI Device 0x1022:0x2000 (pcnet32) subsystem== "NET", drivers== "? *", attrs{address}== "00:0c:29:4d:23:01", name= " Eth0 "This line deletes # Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (Rulewritten by Anaconda) subsystem== "NET", action== "add", DRIVER s== "? *", attr{address}== "00:0c:29:bb:af:1a", attr{type}== "1", kernel== "eth*", name= "eth1 "This line to modify the last eth1 for eth0, note attrs{address}== "00:0c:29:bb:af:1a" This Mac physical address, to use. Then save and exit. when you build a cluster in a virtual machine, you generally use NAT to share the host IP with the virtual host, so that eth0 is dynamically acquiring IP and needs to be modified to static:fill in the Mac physical address noted aboveThen configure IPV4 where address is the static Ip,gateway gateway you want and DNS server can see from the VMware menu to select the Virtual network Editor ... Point to the two red circle, you can get the subnet IP, Gateway IP,IP start address and IP End address (note that the static IP address set for the virtual machine must be within this range) last modified/etc/sysconfig/network-scripts/ifcfg-eth0 This file, as follows: Device=eth0
Type=ethernet
uuid=b78700a3-1abb-4c53-a6fc-44a9c8408473
Onboot=yes
Nm_controlled=yes
Bootproto=none
HWADDR=00:0C:29:BB:AF:1A #检查一下这个地址和最上面ATTRS {address}== "00:0c:29:bb:af:1a" to be consistent
ipaddr=192.168.11.130 #你想要为这台虚拟机分配的静态IP
gateway=192.168.11.2 #中第一个红圈按钮点开后看到的那个网关
dns1=192.168.11.2 #DNS1服务器的地址,remain on the same network segment with the end set to 2. you can use Nslookup in cmd to find
broadcast=192.168.11.255 #对应的子网广播地址,stay on the same network segment, end is 255
netmask=255.255.255.0 #网卡对应的网络掩码
Name= "System eth0" #名称 free configuration, do not configure this save after exiting the service network restart make the configuration effective, other nodes similar configuration, except the assigned static IP address is not the same. In this way, each time the virtual machine is opened, the IP will no longer change, and the virtual machine can ping the extranet.

Replicating virtual machines problems encountered in network configuration eth0 and eth1 in the process of building cluster nodes for VMware CentOS and virtual machine static IP configuration method in NAT mode

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.