LINUXIP address, network card related

Source: Internet
Author: User
Tags nameserver

Change the IP address (#setup)

1. Input Vi/etc/sysconfig/network-scripts/ifcfg-eth0

2, the contents of the inside of the revision changed to

hwaddr=fc:4d:d4:2e:af:31
type= Ethernet
uuid= ad8ede6c-2e68-441c-8d8b-8e760fe38305
Onboot=yes
nm_controlled=yes
netmask=255.255.252.0
ipaddr= 10.10.3.95
gateway=10.10.0.1

Network restart

/etc/init.d/network restart

OK----ifconfig to see it.

Ifup eth0

Ifdown eth0

------------------------------------------------

Change DNS

1, vi/etc/resolv.conf

2. Input

NameServer 8.8.8.8
NameServer 1.2.4.8

VM cloning, eth0 into eth1 processing

Cause Analysis:

Many Linux distribution use Udev to dynamically manage device files and name them based on the device's information. For example, in

In Debian Etch, Udev identifies the network card during system boot, and the MAC address and network card name are recorded in Udev's rules

The script. VMware automatically generates the MAC address of the virtual machine. As a result, the virtual machine for the base system has recorded the virtual machine's network

The MAC address of the card corresponds to the NIC Eth0, and the MAC address changes in the cloned virtual machine, and Udev automatically corresponds the Mac to the network

Card eth1. And so on, Udev records the relationship of all identified Mac and Nic names, so each clone of the NIC name is automatically added 1.

In fact, the kernel only recognized a network card, and NIC name-related configuration has not changed any

Workaround:

1, Vi/etc/udev/rules.d/70-persistent-net.rules

Delete the line associated with Name= "Eth0″, and then change which line of eth1 corresponds to" Eth1″ to "Eth0″.

2, cp/etc/sysconfig/networking/devices/ifcfg-eth0/etc/sysconfig/network-scripts/

3. Service Network restart

LINUXIP address, network card related

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.