Modify the interface name of an Eni in Linux)

Source: Internet
Author: User

Modify the interface name of an Eni in Linux)

When GI is installed in the local virtual machine environment today, an error is reported because the interface name of the NIC is inconsistent, node1 is eth0, ech1, and eth2, but node2 is eth1, eth2, and eth3. In this way, an error is reported when you click Next after building an SSH mutual trust, and this error cannot be ignored.

The solution on the Internet is to modify/etc/udev/rules. the ATTR {address} value in d/70-persistent-net.rules is consistent with the MAC value in/etc/sysconfig/network-scripts/ifcfg-Auto_eth1, and then restart the server.

Step 1: Check the MAC address value of the current Nic. Note that node2 is copied through the clone function of vmware, the value in the file may be different from the MAC address value of the NIC of the actual virtual machine.

# Cat ifcfg-Auto_eth1 [root @ oel6 network-scripts] #

TYPE = Ethernet

BOOTPROTO = none

IPADDR = 192.168.0.12

GATEWAY = 192.168.0.1

NETMASK = 255.255.255.0

DEFROUTE = no

20174_failure_fatal = yes

IPV6INIT = no

NAME = "Auto eth0"

UUID = 7624a820-03b1-4a8e-abd1-559879087e5d

ONBOOT = yes

HWADDR = 00: 0c: 29: 4f: 36: 73

LAST_CONNECT = 1432796101

Step 2: modify the configuration file ATTR {address} to the MAC address value of the corresponding Nic, and change the NAME value to the desired value.

[Root @ oel6 network-scripts] # cat/etc/udev/rules. d/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 0x8086: 0x100f (e1000)

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: 4f: 36: 73 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0"

# PCI device 0x8086: 0x100f (e1000)

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: 4f: 36: 7d ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth1"

# PCI device 0x8086: 0x100f (e1000)

SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: 4f: 36: 87 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth2"

Step 3: restart the machine for the modification to take effect.

PS: when modifying eth0 and other names, pay attention to the corresponding CIDR blocks between nodes. For example, if eth0 is configured as 192.10.12.14 on node1, then node2 also needs to be configured as the 192.10.12.0 network segment. Otherwise, an error is reported in this case.

This article permanently updates the link address:

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.