Linux: Configure Linux networks and clone virtual machines and change configuration

Source: Internet
Author: User

First, configure the Linux network

When installing Linux, make sure that the IP of your physical network is set manually, or it will be reported to the network is unreachable when Linux set up IP connectivity networks and how to find the problem!

When Linux is installed in VMware, some network configuration is required to enable Linux to connect to the network:

1. First, if the Linux installed on the virtual machine must ensure that the network adapter is selected in the place:NAT mode: The IP address used to share the host;


2. When the VMware installation succeeds, an IP address is automatically assigned as the default gateway for the virtual machine: Click VMware's Menu Edit-"Virtual Network Editor-" Select vmnet8-Nat setting (for example):



The gateway IP is the default gateway for the new virtual machine;

3. Set the IP address:

To open a Linux network card using the VI command:

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

Eth0 inside the content, there are several items to set:

Device=eth0hwaddr=00:0c:29:eb:72:fatype=ethernetuuid=af9a3043-12d7-4dd3-9948-9d8de30d8d32onboot=yes (if the boot is to start, Yes) nm_controlled=yesbootproto=static (the IP address is dynamically obtained or static, static) ipaddr=192.168.171.10 (IP address, This IP address must not be set to be the same as the gateway IP) netmask=255.255.255.0 (subnet mask) gateway=192.168.171.2 (default gateway)

After the setup is complete, reboot the NIC, command:

Service Network restart


After the reboot is complete, you can ping the virtual gateway (the URL set above) and the physical gateway (the one that corresponds to the physical computer) to see if it can be ping.

Can ping to explain after the virtual Linux is connected with the outside network, but then you ping www.baidu.com will find that can not ping, this is because Linux does not resolve the DNS server;

4. Resolve the DNS server:


In the newly opened text, enter:

NameServer 8.8.8.8 (My DNS is this, replace your own DNS)


Second, cloning Linux


When a Linux complete Setup is complete, you can use cloning to create multiple Linux in a short period of time;

1. Close the Linux shutdown command you want to clone:

Init 0  or  shutdown-h now


2. Right-click on the virtual machine to be cloned-"manage-" clone, in the selection of the steps of the clone is more important two steps:

Choose to create a complete clone here



Here the virtual machine's storage path must not contain Chinese characters and character


3. Cloning is very fast, the completion of the cloning of the virtual machine, the user name and password are cloned Linux user name password:

4. After cloning because it is completely cloned Linux so need to change these: operating system physical address, IP address, host name:

Use the VI command to remove the UUID and physical addresses in the network card (these two lines are automatically generated by the operating system after the Linux reboot) and change a new IP address:

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

Change to:



Save and exit after the change is complete, and then delete the Linux physical address bound file (the file will bind the physical address to the IP after the operating system restarts and the physical address is generated);

If not deleted, the operating system will always bind the cloned physical address;


Use command: RM-RF

Rm-rf/etc/udev/rules.d/70-persistent-net.rules


5. Change the host name or use the VI command:

Vi/etc/sysconfig/network


After the setup is complete, save and exit, then restart Linux to complete the cloned settings and restart the Linux command:

Init 6  or  shutdown-r now

Linux: Configure Linux networks and clone virtual machines and change configuration

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.