Change MAC Address In Linux



Here we will see a technique how to spoof MAC address in Linux. MAC address spoofing is changing the Media Access Control (MAC) address of the network interface card (NIC).
First of all let me tell you that the MAC address or the Hardware address is inbuilt and is actually burnt into your NIC interface card at the time of manufacturing. It is unique worldwide and cannot be changed permanently by the use of any kind of software.
That being said, however we can change it temporarily to suit our needs. The method described here can be used in RHEL, CentOS and Ubuntu as well.
MAC address is 48 bits hexadecimal address. Before directly changing the address you need to find out the current MAC address of your network card by using the command
# ifconfig | grep HWADDR
It will give you output as
eth0 Link encap:Ethernet HWaddr 00:21:5A:9B:00:F0
The MAC address in this case is 00:21:5A:9B:00:F0

How to spoof / change MAC address in Linux

To change it use the ifconfig command as below
# ifconfig eth0 down
# ifconfig eth0 hw ether 00:21:5A:9B:00:F2
# ifconfig eth0 up
Note that we have changed the new MAC address to 00:21:5A:9B:00:F2. Now if you check you’ll see the newly assigned address as your MAC address.
# ifconfig | grep HWADDR
eth0 Link encap:Ethernet HWaddr 00:21:5A:9B:00:F2
You can choose any 48 bit hexadecimal address as your new MAC address. After changing your MAC address everyone communicating with you will see the new address as your MAC address.
As I’ve told earlier this is not permanent and it will revert back to your old address as soon you reboot your machine.

Comments

  1. You can follow these 3 steps to resolve the matter first start device manager , second find the network device and last step open the properties and appearance for the entry Network Address and enter your mac address you wish.

    Thanks
    Silvester Norman

    Change Mac Address

    ReplyDelete

Post a Comment

Popular posts from this blog

Scan FC LUN's in RHEL/CentOS

CEPH bluestore using ceph-ansible

How to enable federated engine in MySQL