Modify MAC address in centos Linux

Source: Internet
Author: User

 

 

1. First view the NIC information:

[Root @ localhost ~] # Ifconfig

Eth0 link encap: Ethernet hwaddr 00: 0C: 29: 49: 22: C8

Inet ADDR: 10.65.7.182 bcast: 10.65.7.255 mask: 255.255.255.0

Inet6 ADDR: fe80: 20c: 29ff: fe49: 22c8/64 scope: Link

...

 

 

The figure above shows the Mac information of the device eth0, that is, the hardware address hwaddr 00: 0C: 29: 49: 22: C8.

2. Disable eth0 because the network service is disabled. Therefore, you must directly operate the local machine.

[Root @ localhost ~] # Ifconfig eth0 down

3. Change the Mac information to 00: 0C: 29: 49: 22: C1.

[Root @ localhost ~] # Ifconfig eth0 HW ether 00: 00: 00: 00: 00: C1

4. Start eth0

[Root @ localhost ~] # Ifconfig eth0 up

5. view the modified Nic information:

[Root @ localhost ~] # Ifconfig

Eth0 link encap: Ethernet hwaddr 00: 00: 00: 00: 00: C1

Inet ADDR: 10.65.7.182 bcast: 10.65.7.255 mask: 255.255.255.0

Inet6 ADDR: fe80: 20c: 29ff: fe49: 22c1/64 scope: Link

Up broadcast running Multicast MTU: 1500 Metric: 1

RX packets: 3470 errors: 0 dropped: 0 overruns: 0 frame: 0

TX packets: 1509 errors: 0 dropped: 0 overruns: 0 carrier: 0

Collisions: 0 FIG: 1000

RX Bytes: 907742 (886.4 kib) TX Bytes: 182280 (178.0 kib)

Interrupt: 67 base address: 0x2024

 

Lo link encap: local loopback

Inet ADDR: 127.0.0.1 mask: 255.0.0.0

Inet6 ADDR: 1/128 scope: Host

Up loopback running MTU: 16436 Metric: 1

RX packets: 1505 errors: 0 dropped: 0 overruns: 0 frame: 0

TX packets: 1505 errors: 0 dropped: 0 overruns: 0 carrier: 0

Collisions: 0 txqueuelen: 0

RX Bytes: 2414590 (2.3 MIB) TX Bytes: 2414590 (2.3 MIB)

 

★★★★★★★★★★★★

Permanently modify Mac information:

Open/etc/rc. d/rc. Local and append the following three lines:

Ifconfig eth0 down

Ifconfig eth0 HW ether 00: 00: 00: 00: 00: C1

Ifconfig eth0 up

Then restart

 

 

 

Related Article

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.