How to change MAC address of interface – ubuntu

How to change MAC address of interface – ubuntu

Introduction –

Why we need to change MAC address? On one of our proxy server which is directly connected to internet. Due to some reason I have to assign MAC address to one of the Interface eth0! My ISP want unique MAC address to interface which is connected to there service.

Set MAC address to interface manually –

step(1) Edit the /etc/network/interfaces file. to modify the interface configuration on Ubuntu or Debian system…

root@arunbagul:~# vi /etc/network/interfaces
root@arunbagul:~#

See your network interface conf file. If you have dhcp enabled, it will look like this…

root@arunbagul:~# cat /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

root@arunbagul:~#

step(2) Now specify the MAC address as shown below…

root@arunbagul:~# cat /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
hwaddress ether 01:06:03:04:0B:06

root@arunbagul:~#

step(3) Now restart your network service –

root@arunbagul:~# /etc/init.d/networking restart
* Reconfiguring network interfaces…
There is already a pid file /var/run/dhclient.eth0.pid with pid 4440
killed old client process, removed PID file

…..

DHCPACK from 192.168.1.10
bound to 192.168.1.89 — renewal in 3110 seconds.
[ OK ]
root@arunbagul:~#

step(4) macchanger – is the tool available for Ubuntu to change the MAC address –

How to install macchanger ?

root@arunbagul:~# apt-get install macchanger
Reading package lists… Done
Building dependency tree

…..
Setting up macchanger (1.5.0-1) …

root@arunbagul:~#

step(5) How to use this –

root@arunbagul:~# macchanger eth0
root@arunbagul:~#

Cheers,
Arun Bagul

Similar Posts:

Be Sociable, Share!

2 Replies to “How to change MAC address of interface – ubuntu”

  1. yeah you can use macchanger to change your mac address automatically changing mac address as well as creating it manually. First automatically
    sudo ifconfig eth0 down
    sudo macchanger -r eth0
    sudo ifconfig eth0 up
    Manually
    sudo ifconfig eth0 down
    sudo macchanger -m 00:00:00:00:00:00
    sudo ifconfig eth0 up
    Don’t forget to install macchanger ie
    sudo apt-get install macchanger

Leave a Reply

Your email address will not be published. Required fields are marked *