Openwrt MAC address modification error siocsifhwaddr: cannot assign requested address

Source: Internet
Author: User

Problem

Set the MAC address 11: 22: 33: 44: 55: 66. There is no siocsifhwaddr: cannot assign requested address on the master trunk being developed by openwrt.
However, it appears on the latest trunk of attitude adjustment. It is estimated that the kernel version is different, resulting in different MAC address restrictions.
What is the latest but not strict? This is unscientific.

Solution:
Http://blog.csdn.net/evenness/article/details/7674038
Http://blog.csdn.net/hds_yx/article/details/17285873

Run the following command to modify the MAC address of the NIC in Linux:

/Sbin/ifconfig eth0 down
/Sbin/ifconfig eth0 HW ether 47: 72: 65: 65: 6e: 00
/Sbin/ifconfig eth0 up

When you enter the second command, the following message is displayed: siocsifhwaddr: cannot assign requested address. It turns out that the MAC address is set incorrectly.
There are three types of IP addresses: broadcast, multicast, and unicast. Broadcast is: FF: ff. Multicast: the last bit of the first byte is 1, for example, 47: 72: 65: 65: 6e: 00,
The last digit of 47 is 1. Unicast: the last bit of the first byte is 0, for example, 48: 72: 65: 65: 6e: 00.
. If you change the above address to 48, this problem will not occur.

In-depth study:

IEEE 802 defines the MAC address

| <--------- 24 bit ---------> | <--------- 24 bit --------> |
| Ccccccug cccccccc cccccc | XXXXXXXX xxxxxxx XXXXXXXX |

MAC address types controlled by UG:

U: 0: uniformly managed by the specified IEEE ID
1: Local Management
G: 0: unicast
1: Multicast
That is, 12-bit MAC addresses are divided into four categories, which are determined by the second.
The second digit is
0 | 4 | 8 | C :( 00) uniformly managed unicast Mac
1 | 5 | 9 | D :( 01) uniformly managed multicast MAC
2 | 6 | A | E :( 10) locally managed unicast Mac
3 | 7 | B | f: (11) locally managed multicast MAC

========================================================== ======================================
Because network terminals such as ADSL routes generally use a uniformly managed unicast Mac
Therefore, 02: 10: 18: 01: 00: 01 or (11: 01: 18: 00: 00: 30) are invalid Mac, leading to ineffective wireless functions, or network connection failure.
However, Mac 00: 25: 5E: 08: de: 43 is considered valid.

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.