We can change the MAC address for NIC in Ubuntu easily as well. Just like we can do it in Linux (explained here)
You will need a package called macchanger installed on Ubuntu in order to change the MAC address for NIC.
[[email protected] ~]$ sudo apt-get install macchanger
Verify the eth0 configuration using the ifconfig command
[email protected]:~$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0c:29:2d:a7:d5 inet addr:xxx.xxx.xxx.xxx Bcast:xxx.xxx.xxx.xxx Mask:255.255.255.0 inet6 addr: fe80::21f:d0ff:fe44:7933/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2292995 errors:0 dropped:0 overruns:0 frame:0 TX packets:541600 errors:0 dropped:50 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2346138833 (2.3 GB) TX bytes:65315435 (65.3 MB) Interrupt:221 Base address:0x6000
So you can see that the current MAC address for eth0 is 00:0c:29:2d:a7:d5.
Spoof / Change / Modify MAC address on Ubuntu
In order to spoof / change / modify the MAC address for an interface we will have to shut down the network. The following is the command that will be used:
[email protected]:~$ sudo /etc/init.d/networking stop
Now using the macchanger command you can change the MAC address for eth0.
[email protected]:~$ sudo macchanger -a eth0
You will now have a new fake MAC address attached to the interface eth0.
There are several option for the command macchanger. The following are a few examples:
-a will assign random MAC address from the same vendor -A will assign random MAC address from any vendor
For more details you can refer to the man page for macchanger.