Clone centos Virtual Machine in vsphere, add new Nic and configure IP Address

Source: Internet
Author: User

 

Preface

The installed centos is cloned from vcenter. In this way, the following problems exist:

Question 1: Mac conflict description:

The cloned system Nic eth0 may be consistent with the system before cloning, resulting in MAC conflict;

Solution:

1. Modify Mac in CAT/etc/udev/rules. d/70-persistent-net.rules

2, to CD/etc/sysconfig/network-scripts/to modify the original network card eth0 configuration file ifcfg-eth0 Mac and/etc/udev/rules. d/70-persistent-net.rules the eth0 Mac is consistent, restart the NIC

Problem 2: the newly added Nic does not have a configuration file. Problem description:

You do not need to use the original Nic. Generally, the original Nic is deleted and a new Nic is added. Delete the original network adapter eth0 and add a new network adapter. You cannot see it in/etc/sysconfig/network-scripts/. For example, you can only use the ifconfig-a command to view the newly added network adapter eth4, A Nic switch name is indeed changed. But how to configure the IP address. Especially for me, this kind of knowledge is minimized and no setup or other management tools are installed.

 

Solution:

Solution: Problem 3"

1. Use ifconfig-a to view the name of the new Nic.

2. Copy the original Nic configuration file to the CD/etc/sysconfig/network-scripts/directory as the new Nic name.

3. Check the real MAC of the network adapter, CAT/etc/udev/rules. d/70-persistent-net.rules.

4. Modify the device name and hwaddr In the NIC configuration file. After adding a new IP address, restart the NIC (servicenetwork restart.

 

 

Problem 3: the MAC address of the original Nic changes

 

Problem description:

Because the cloned Virtual Machine only modifies the Virtual Machine name and other information, and does not modify any information in the virtual hard disk, the cloned system MAC address is inconsistent with the MAC address in the system configuration file, in this case, the original Nic such as eth0 cannot be started. The operating system records the addition of a new Nic. The new Nic name is eth1, And the MAC address is the new MAC address assigned by VMware.

 

Mac: 00: 50: 56: A5: 0C: 33-34 of the two NICs of the cloned host

MAC address of the cloned HOST: 00: 50: 56: A5: 0C: 40-3f

Solution:

1. Start the cloned system and check the NIC. The NIC name and MAC address are changed. 00: 50: 56: A5: 0C: 3f-40


2, view the NIC configuration file, found that there is no configuration file on eth2 and eth3, only the original system of eth0 and eth1 configuration file ifcfg-eth0 and ifcfg-eth1

3. Check the MAC address of the NIC in the/etc/udev/rules. d/70-persistent-net.rules configuration file.

4. Copy the ifcfg-eth0 to the ifcfg-eth2 and ficfg-eth3 and change the name and Mac to the new name

Copy ifcfg-eth0 to ifcfg-eth2

5. Modify device and hwaddr in the ifcfg-eth2 to modify the MAC address in the/etc/sysconfig/network-scripts/ifcfg-eth2 to/etc/udev/rules. MAC address of eth2 modified by D/70-persistent-net.rules

Add IP addresses and set startup

6. configure a fixed IP address for the centos Virtual Machine

Vim/etc/sysconfig/network-scripts/ifcfg-eth0

 

The following is the eth2 information of the NIC:

Device = "eth2"

# Bootproto = "DHCP"

Bootpro = "static"

Hwaddr = "00: 50: 56: A5: 0C: 3f"

Ipaddr = "192.168.1.104"

Gateway = "192.168.1.1"

Netmask = "255.255.255.0"

Nm_controlled = "yes"

Onboot = "yes"

Type = "Ethernet"

 

6. The eth3 modification method is the same as above.

7. Restart the NIC: Service Network restart

References

Nic configuration after centos cloning

Http://www.linuxidc.com/Linux/2013-01/77709.htm

Add centos 6 Nic under Virtual Machine

Http://www.2cto.com/ OS /201212/174172.html

 


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.