Basic settings: Modify the NIC device name.

Source: Internet
Author: User

The VM uses the cloned Vm and the NIC name is eth1. To change eth1 to eth0, follow these steps:

  1. View the MAC address of eth1

    Ifconfig

    For example, eth1: 00: 0C: 29: 74: F2: 99

  2. Change the MAC address of/etc/sysconfig/network-scripts/ifcfg-eth0 to the MAC address of eth1

    Since the VM is cloned, there is no eth1 file under the network-scripts directory, there is a ifcfg-eth0 under the directory, the modification is as follows:

Hwaddr is changed from the original Mac to the MAC of eth1 and saved.

Device = eth0

Hwaddr = 00: 0C: 29: 74: F2: 99

Onboot = Yes

Ipaddr = 192.168.198.10

Bootproto = none

Netmask = 255.255.255.0

Type = Ethernet

Gateway = 192.198.198.2


3. Modify the/etc/udev/rules. d/70-persistent-net.rules file.


ATTR {address} and name fields


[[Email protected] rules. d] # Cat 70-persistent-net.rules

# This file was automatically generated by the/lib/udev/write_net_rules

# Program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# Line, and change only the value of the name = key.


# PCI device 0x1022: 0x2000 (pcnet32)

# Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 0C: 29: 55: 61: 94 ", ATTR {type} =" 1 ", kernel = "ETH *", name = "eth0"


# PCI device 0x1022: 0x2000 (pcnet32)

Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 0C: 29: 74: F2: 99 ", ATTR {type} =" 1 ", kernel = "ETH *", name = "eth0"

[[Email protected] rules. d] #


4. restart the system

This article comes from "even if it is wrong, let me make a mistake to death !" Blog, please be sure to keep this source http://hxw168.blog.51cto.com/8718136/1571255

Basic settings: Modify the NIC device name.

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.