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