Set the MAC address in Ubuntu and Debian

There are many situations when you need to manually set your MAC address. I have previously showed you 3 ways for temporary changing the MAC address.

Watch Free Movies

In this article I will explain you how configure the MAC address permanently, on Debian, Ubuntu and other Debian based distros.

To set the hardware address (MAC), open the /etc/network/interface file in your favourite text editor:

$ sudo vim /etc/network/interfaces

After the network interface configuration, paste this line: hwaddress ether AA:BB:CC:11:22:33.

Note: AA:BB:CC:11:22:33 is just a sample, replace it with the MAC address you want to set for your interface.

Example, with dhcp enabled network interface:

auto eth0
iface eth0 inet dhcp
hwaddress ether AA:BB:CC:11:22:33

Example, with a network interface having a static ip:

auto eth0
iface eth0 inet static
hwaddress ether AA:BB:CC:11:22:33

To apply the MAC change, restart the network interface:

$ sudo /etc/init.d/networking restart

Scroll to Top