Multi-Nic Mac configuration problem under Linux

Source: Internet
Author: User

hwaddr=, in which AA:BB:CC:DD:EE: The hardware address of the Ethernet device in the form of FF. On a machine with multiple network card devices, this field is very useful and ensures that the device interface is assigned the correct device name, regardless of the load order in which each NIC module is configured. This field cannot be used with MACADDR.

Macaddr=, where the hardware address of the Ethernet device is in the form of AA:BB:CC:DD:EE:FF. On a machine with multiple network card devices. This field is used to assign a MAC address to an interface, overwriting the physically assigned MAC address. This field cannot be used with HWADDR.

The former is used to bind the ETHX name according to HWADDR, the latter is really used to modify the MAC address

In Linux , modify the MAC address

# Ifdown Eth0

# ifconfig eth0 hw ether 12:34:56:78:90:12

(The modified MAC address differs from the original address)

# ifup Eth0 (modified successfully)

After, with # Ifconfig view, MAC address changed, but after entering #service network restart or ifdown eth0 command, the following error message will appear:

Device eth0 has MAC address 12:34:56:78:90:12, instead of configured address 00:0c:29:ca:b5:7d. Ignoring.

Therefore, it is not possible to modify the/etc/sysconfig/network-scripts/ifcfg-eth0 file to change the IP address and other related information, because the service network restart cannot make it effective, but with ifconfig Eth0 can temporarily change its IP address, reboot and then return to prototype.

Now solve

"Device eth0 has MAC address 12:34:56:78:90:12, instead of configured address 00:0c:29:ca:b5:7d. Ignoring. " The problem:

This problem occurs because of a configuration file: The macaddr=00:0c:29:ca:b5:7d address in/etc/sysconfig/network-scripts/ifcfg-eth0 is different from the 12:34:56:78:90:12, Macaddr=00:0c:29:ca:b5:7d can be modified to 12:34:56:78:90:12, the error is eliminated.

The macaddr=00:0c:29:ca:b5:7d address in/etc/sysconfig/network-scripts/ifcfg-eth0 will also be changed to 12:34:56:78:90:12 in Linux, Modify HWADDR Address

Configuring the NIC

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

IPADDR Configuring IP Addresses

Netmesk Subnet Mask

Gateway Configuration Gateways

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

IPADDR Configuring IP Addresses

NETMASK Subnet Mask

Gateway Configuration Gateways

The IP address of ens1 appears in ENS3 after configuration.

This problem occurs because the hwaddr in ENS1 is not configured with the correct device name.

Workaround:

Change the device name of HWADDR in ens1 to the original device name

For example: Three network adapter configuration:

ENO1 hwaddr=f0 1c F0 FC D4

ENS1 hwaddr=44 4c 07 79 25

ENS3 hwaddr=44 4c AF 70 wherein the device name of ENS1 is 4c CF 70, so the HWADDR device name in ens1 is not correct, should be changed to ENS1 in hwaddr=44 4c, CF 70 then Ifdow N ens1 turn off the NIC and ifup ens1 open the network card. ——————————————————————————————————————————————————————————————————————————————————————————————————————————————— ——————— basic steps for Linux under multiple NIC configuration:1. Enter the vi/etc/sysconfig/network-scripts/ifcfg-network card (e.g. Eno1), carriage return;2. Enter the editing interface, press a/i;3. A bunch of command line, the inside of the onboot=no changed to Onboot=yes, in the configuration Ipaddro IP address, press ESC, enter ": Wq" save exit;4. Restart the network card: Ifdown ens3ifup ens35. Then enter the Ifconfig, look under the correct configuration, OK pull! La La la la!

Multi-Nic Mac configuration problem under Linux

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.