Sometimes it is just necessary to change MAC address (also known as ethernet address, physical/arp/hardware address or even hwaddr) of network interface in Ubuntu.
It is far out of this post’s scope to list here all possible reasons of doing it so I just listed below several ways to change MAC address under Ubuntu Linux.
All of those ways require typing commands in terminal so open it in in Ubuntu menu.
In order to see all interfaces detected by your Ubuntu as well as their MAC addresses and hardware names type the following command:
sudo ip addr
Here is sample output:
1: lo: mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether 4c:22:d0:b8:78:ae brd ff:ff:ff:ff:ff:ff
3: wlan0: mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:19:7e:53:8c:a3 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.18/24 brd 192.168.1.255 scope global wlan0
inet6 fe80::219:7eff:fe53:8ca3/64 scope link
valid_lft forever preferred_lft forever
It shows three interfaces: lo, eth0 and wlan0 (these are hardware names of them). MAC or hardware address is shown in link/ether line, e.g. current MAC address of eth0 is 4c:22:d0:b8:78:ae.
Change MAC address in Ubuntu using ifconfig
sudo ifconfig eth0 down sudo ifconfig eth0 hw ether 4c:22:d0:b8:78:ae sudo ifconfig eth0 up
Where eth0 is hardware name if the interface and 4c:22:d0:b8:78:ae is desired MAC address for it.
Macchanger console utility
Install macchanger using command:
sudo aptitude <a title="See also Ubuntu - How to Install MKVToolNix (Matroska tools) in Linux" href="http://www.whileifblog.com/2012/02/21/ubuntu-how-to-install-mkvtoolnix-matroska-tools-in-linux/">install</a> macchanger
Installed application makes it possible not only to change MAC address to defined one but also makes it possible:
Change MAC to random value
Apply MAC from list of vendors
For example to change MAC address of the interface to hardware address belonging to Linksys you can do the following:
macchanger --list=linksys
It will show that Linksys MAC addresses start with 00:0f:66. Now change MAC address of the interface:
sudo ifconfig eth0 down sudo macchanger -m 00:0f:66:4e:16:88 eth0 sudo ifconfig eth0 up
You will see the following output in case of successful change of MAC address:
Current MAC: 4c:22:d0:b8:78:ae (unknown) Faked MAC: 00:0f:66:4e:16:88 (Cisco-linksys)
Please notice that above mentioned ways to change MAC address in Ubuntu implies that normal hardware address will be restored once you rebooted.
