Network settings after cloning a VM from VMware

Source: Internet
Author: User

Network settings after cloning a VM from VMware

After cloning a virtual machine Through VMware, the new virtual machine often does not correctly identify the NIC and needs to be reconfigured.
The following is an example of network reconfiguration in centos.

1. Virtual Nic settings
Host-only and NAT virtual NICs are installed in my virtual machine. The subnets are 192.168.150.0 and 192.168.73.0 respectively. For example


Previously, I encountered a problem where the VM Could not be connected to the Internet several times. I just moved the above settings and clicked "apply", or simply clicked "Restore Default" to reinstall the virtual Nic. To prevent network settings from changing, set the Subnet IP address to the same as the original IP address after "Restore Default.

2. Restore eth0 and eth1 Devices
After the VM is cloned, the MAC address before cloning is retained in the vm OS, making the NIC unrecognizable. The solution is to delete the NIC information recorded in the following files and restart the system so that the NIC can be recognized again during Linux boot.

/Etc/udev/rules. d/70-persistent-net.rules


3. Network Settings
Previously, I had been relying on VMWare's dhcp configuration network, but there was always a problem with the cloned virtual machine, so I simply assigned a static address.
The following eth0 is the VMnet8 (NAT) Nic, the gateway and DNS address are 192.168.73.2, and eth1 is the VMnet1 (Host-only) Nic.

--------------------------------
# Ifconfig eth0 192.168.73.130 netmask 255.255.255.0
# Ifconfig eth1 192.168.150.130 netmask 255.255.255.0
# Hostname node1
# Route add default gw 192.168.73.2
# Vi/etc/resolv. conf
Search localdomain
Nameserver 192.168.73.2
--------------------------------


4. Write the network configuration to the configuration file, so that the configuration is still valid after the system is restarted.
--------------------------------
# Vi/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE = eth0
TYPE = Ethernet
IPADDR = 192.168.73.130
NETMASK = 255.255.255.0
NETWORK = 192.168.73.0
BROADCAST = 192.168.73.255
STARTMODE = onboot
USERCONTROL = no

# Vi/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE = eth1
TYPE = Ethernet
IPADDR = 192.168.150.130
NETMASK = 255.255.255.0
NETWORK = 192.168.150.0
BROADCAST = 192.168.150.255
STARTMODE = onboot
USERCONTROL = no

#/Etc/sysconfig/network
NETWORKING = yes
HOSTNAME = node1
GATEWAY = 192.168.73.2
--------------------------------

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.