Linux modify network card MAC address

Use iproute2 to modify the MAC address of the network card

1. Use the following command to view all current network cards and their MACaddresses;

sudo ip link show

insert image description here
2. If the author wants to modify the address ens224of the network card MAC, first use the following command to close the network card;

sudo ip link set dev ens224 down

3. Set the address of the network card MAC;

sudo ip link set dev ens224 address XX:XX:XX:XX:XX:XX

4. Enable the network card

sudo ip link set dev ens224 up

5. Check MACwhether the address has been modified.

sudo ip link show ens224

At this point, the physical address of the network card has been modified.

#over

Guess you like

Origin blog.csdn.net/qq_36393978/article/details/131510717