Amazon Affiliate

Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, 25 April 2016

How to change MAC address in linux?


First find the physical MAC address of your machine by running the following command :

$ ifconfig -a | awk '/HWaddr/ {print "interface: " $1 "/t MAC: " $NF}'
interface: eth0/t MAC: 4e:97:0e:52:29:13
interface: wlan0/t MAC: 02:ec:b4:e1:dc:31


The hexadecimal numbers in blue denote machine's MAC address.

Now, login as root in Linux or use sudo before each command and execute it. 

# ifconfig eth0 down
# ifconfig eth0 hw ether 3c:97:0e:11:21:71 
# inconfig eth0 up
# ifconfig eth0 | awk '/HWaddr/ {print "interface: " $1 "/t MAC: " $NF}'  

I have changed my Mac address to  "3c:97:0e:11:21:71".

Note : This is the temporary change. Once you reboot your machine, the operating system will change the MAC address to the default.