Tutorial on modifying network configuration After cloning centos6 Virtual Machine in Linux, linuxcentos6

Source: Internet
Author: User
Tags nameserver

Tutorial on modifying network configuration After cloning centos6 Virtual Machine in Linux, linuxcentos6

This configuration is based on centos6.

Generally, when you directly clone a VM and execute ifconfig on the obtained Vm, the IP address is usually not displayed. This is because we still lack some configuration.

The configuration is as follows:

1) modify the network address

(1) edit file vi/etc/sysconfig/network-scripts/ifcfg-eth0

Network Service running at startup: ONBOOT = yes

(2) set the IP address

If BOOTPROTO = dhcp is set, the virtual machine automatically obtains the IP address;

To specify the IP value, set OOTPROTO = static and specify the IPADDR, NETMASK, and GATEWAY values. As follows:

OOTPROTO = static

IPADDR = 192.168.13.136

NETMASK = 255.255.255.0

GATEWAY = 192.168.13.2

Note that the gateway value is set when the nat network mode is set.

2) Reassign the physical address

(1) Delete physical addresses in/etc/sysconfig/network-scripts/ifcfg-eth0 files

Delete two rows: UUID and physical address (HWADDR). If the above files do not have these two items, you don't have to worry about it.

(2) Delete the file/etc/udev/rules. d/70-persistent-net.rules

Operation: rm-rf/etc/udev/rules. d/70-persistent-net.rules

3) modify the Host Name

The cloned Virtual Machine name is still the name of the original virtual machine, which can be modified in the/etc/sysconfig/network file.

Run vi/etc/sysconfig/network to configure its HOSTNAME.

4) Restart linux

Execute the operation: init 6

5) check whether the network can be pinged to the Internet.

Operation: ping www.baidu.com

If the network cannot be pinged, you must set the dns service.

Run vi/etc/resolv. conf.

Add content:

Nameserver 219.232.48.61

Nameserver 59.108.61.61

Nameserver 114.114.114.114

Delete the line of search localdomain

Note: to map the IP address and Host Name of a VM, you can modify the/etc/hosts file to add the configuration of the IP address host name.

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.