Use iproute2 to modify the MAC address of the network card
1. Use the following command to view all current network cards and their MAC
addresses;
sudo ip link show
2. If the author wants to modify the address ens224
of 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 MAC
whether the address has been modified.
sudo ip link show ens224
At this point, the physical address of the network card has been modified.