How to change MAC address in Linux

1282 ワード

Changing MAC address of a machine is called spoofing a MAC address or faking a MAC address. In linux, you can 
change MAC address
 of your machine.This is how it is done.
How to change MAC address in Linux
First find the physical MAC address of your machine by running the following command :
$ ifconfig -a | grep HWaddr
eth0  Link encap:Ethernet HWaddr 00:80:48:BA:d1:20

The hexadecimal numbers in 
blue
 denote my machine's MAC address. Yours will be different. Learn how to use the  ifconfig
 Linux command.
You can also use  ethtool  to find the hardware address of your machine.
Next, login as root in Linux and enter the following commands -
# ifconfig eth0 down
# ifconfig eth0 hw ether 00:80:48:BA:d1:30
# ifconfig eth0 up
# ifconfig eth0 |grep HWaddr

I have changed the MAC address to a different number highlighted in blue.  00:80:48:BA:d1:30  is the new MAC address I have provided for my Linux machine. You can choose any 48 bits hexadecimal address as your MAC address.