- Change Mac Address Linux Terminal
- Change Mac Kali Linux
- Kali Linux Change Mac Address
- Change Mac Address Linux Ubuntu
We will consider two situations; changing your MAC address temporarily and Making the address permanent. For this Tutorial we’ll use Kali Linux,which by default comes with macchanger.There is a tutorial on Top Ten Must Do Things After Installing Kali Linux.Macchanger is a Linux utility for viewing/manipulating the MAC address for network interfaces. Pick the Right Desktop Environment. To achieve the most Mac-like look on Linux you. Change Mac Address To A Random Vendor. This will randomize your Mac address and it will use one from a known vendor. NOTE: A vendor is the manufacturer of the network interface card (ie. TP-LINK TECHNOLOGIES CO., LTD)-A = set a random Mac address of any kind. Macchanger -A wlan0 Change Mac Address But Use The Same Vendor. Changing MAC address or we also can call it MAC address spoofing will be useful in some cases, but we will talk about it later in conclusion at the end of this article. Step by step How to Change MAC Address on Kali Linux: 1. Open your terminal, and type. Ifconfig grep HWaddr.
< Changing Your MAC Address
Under GNU/Linux, the MAC address of a network interface card (NIC) can be changed by following the procedures below.
NOTE: MAC addresses used within this article are provided for example only. Substitute according to your requirements.
NOTE: Commands below MUST be executed with root privileges (e.g. prepended with 'sudo '), in order for things to work!
NOTE: Commands below MUST be executed with root privileges (e.g. prepended with 'sudo '), in order for things to work!
/etc/init.d/networking stop
ifconfig eth0 hw ether 02:01:02:03:04:08
/etc/init.d/networking start
Execute '
ifconfig eth0
' to confirm.The above should work on Debian, Ubuntu, and similar distributions. Alternatively, under RHEL/Fedora and possibly other GNU/Linux distributions (incl. CentOS and Scientific Linux), to disable and restart networking, one must stop and start
/etc/init.d/network
, instead of /etc/init.d/networking
.If you have iproute2 utilities installed, you may prefer to use the '
ip
' command, as follows:/etc/init.d/network stop
ip link set eth0 address 02:01:02:03:04:08
/etc/init.d/network start
To confirm your setting, you may prefer to execute '
ip link ls eth0
' or 'ip addr ls eth0
' instead of 'ifconfig eth0
'.NOTE: You may not be able do this if using a DSL modem (depending on modem vendor or ISP).
Making Changes Permanent - Surviving a Reboot[edit]
In openSUSE and other SUSE-based systems (SUSE enterprise desktopserver, etc.) you can make changes 'permanent' across reboots by adding an appropriate entry to the /etc/sysconfig/network/ifcfg-ethN file (ifcfg-eth0 for the first Ethernet interface config file, ifcfg-eth1 - for the second, etc.):
LLADDR=12:34:56:78:90:ab
In Red Hat Enterprise Linux (RHEL) and other similar systems (Fedora, CentOS, etc.) an easy way to make changes 'permanent' across reboots is to add an appropriate entry to the /etc/sysconfig/network-scripts/ifcfg-ethN file (ifcfg-eth0 for the first Ethernet interface config file, ifcfg-eth1 - for the second, etc.):
MACADDR=12:34:56:78:90:ab
Note: in the file is a value HWADDR - This is not the same thing. Use MACADDR for permanent changes.
from http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html
The HWADDR 'directive is useful for machines with multiple NICs to ensure that the interfaces are assigned the correct device names regardless of the configured load order for each NIC's module. This directive should not be used in conjunction with MACADDR.'...The MACADDR 'directive is used to assign a MAC address to an interface, overriding the one assigned to the physical NIC. This directive should not be used in conjunction with HWADDR.'
Upper and lower case letters are accepted when specifying the MAC address, because the network function converts all letters to upper case.
You can test changes without restarting the system by executing:
service network restart
(WARNING: doing this will break all existing network connections!)
On Debian, Ubuntu, and similar systems, place the following in the appropriate section of /etc/network/interfaces (within an iface stanza, e.g., right after the gateway line) so that the MAC address is set when the network device is started:
hwaddress ether 02:01:02:03:04:08
On Gentoo you may achieve the same result by adding an entry to the global configuration file /etc/conf.d/net for each Ethernet card. Example for the eth0 device:
mac_eth0='12:34:56:78:90:ab'
You can also use the tool 'GNU MACChanger' to change the MAC address under GNU/Linux.
To change MAC address during boot time with MACChanger, add the following line to your /etc/network/interfaces (example for the eth0 interface):
pre-up macchanger -m 12:34:56:78:90:AB eth0
Retrieved from 'https://en.wikibooks.org/w/index.php?title=Changing_Your_MAC_Address/Linux&oldid=3486597'
Every device that connects to the Internet; whether it’s a Computer, Smartphone, Chromecast, or even a Smart TV; they all have unique identifier hardwired in their Network card. This unique ID is a 12 digit alphanumeric key called — MAC (Media Access Control) address.
A typical MAC address looks something like this — EB-52-02-F0-2E-06 and since it’s unique for each device, it’s often used to identify different devices on the network.
Now, even though the MAC addresses are hardwired in your network card, You can still change it with the help of special tools or commands.
Related: 10 Steps to Secure Your Wi-Fi Network From Hackers
But Why Change MAC Address?
Well, there are several reasons to change the MAC address. Some popular ones are.
Privacy — When you connect to the internet, the web server can not see your MAC address. But other devices on your Local Area Network can. So, if you want to be anonymous on a public WiFi then change your MAC address make sense.
MAC filtering — Most Airlines or Hotels, automatically disconnect the Internet on the devices after some time. They do this by identifying the MAC address. So, if you change your MAC address, you can continue using the internet.
Run Software – Some software detect your MAC address, and send it to their web server. So, if you can not open certain websites (mostly gaming), you may consider changing your MAC address.
So, let’s see how to change Mac address on Windows, Mac OS, Linux, and Android. Or watch this video at the end of this article.
#1 Windows
Since most of us have more than one network card (like WiFi and Ethernet etc), there will be multiple MAC address on your computer. So first, you need to find out which MAC address we want to change.
Find MAC Address in Windows
To do this, open up cmd, and type in the following command and hit enter.
Scroll down the list, and you’ll see a couple of Physical Addresses (in Windows MAC address are called Physical address). Now, the one that has an IP address link to it is the one you are using right now. If you are using the Internet from WiFi, it’ll be the MAC address of the WiFi adapter.
Now, write down that MAC address, we’ll need them later on.
Change MAC Address on Windows
You can change the MAC address in Windows directly from GUI. So, open up
So, open up device manager by typing devmgmt.msc in the Run box. A new window will open, there go to the network adapter and expand it. Find your Wireless Network card and right-click on it then click properties. Another new window will open, click on the Advanced tab and select Network Address. Then click the value button and enter the new MAC address, without any special character or colon in between.
I suggest you copy paste your old MAC address (the one you have written down in the previous step) and replace the last two digits. This is a good practice as it’s easy to remember your new MAC address and don’t cause any conflict on the network.
Also, if the value tab is unclickable, it means your network card doesn’t allow changing MAC address.
To check, if you have successfully changed your MAC address, again open up cmd and do ipconfig /all. You should see new the new MAC address this time.
Note: Changing MAC address is temporary. If you restart your computer, it will automatically switch back to the previous MAC address. But, if you want to keep the MAC address permanent, use software like Technitium, and checkmark the options that say — Make the new MAC address persistent.
#2 Mac
Changing the MAC address on Mac OS is done using a command line, so see how it works.
Find MAC Address on Mac OS X
Open up the terminal and type in the command ifconfig (the ipconfig command on Windows becomes ifconfig on Mac and Linux OS)
You will see the different MAC addresses of each network adapter. To find out, which one you are using, look for the MAC address that has IP address link to it. This will be your current MAC address. Also, make a note of your interface name like -- en0 or en1. We will need this later.
Change Mac Address Linux Terminal
Alternatively, you can find your MAC address by going to the System Preference> Network > Current Connection > Advanced > Hardware.
Change MAC Address on Mac OS X
To change MAC Address on MAC OS, open up the terminal and type in the following command.
sudo ifconfig en1 ether a1:b1:c1:d1:e1:f1
Obviously, replace the a1:b1 part with the MAC address you want to have. And once you are done typing the command, hit enter. Since this is a sudo command, you’ll also have to enter your login password. And that’s it.
Now, to check if you have successfully updated your MAC address, type in ifconfig or go to the network settings in system preferences. You should see your new MAC address there.
Note: Like Windows (or for every OS), changing MAC Address in Mac OS is also temporary. Once you restart your computer, you’ll get back the previous MAC Address.
To make it permanent, you can use some MAC Address Changer Script and put it in your startup folder of your MAC. Something like this, though I haven’t tested it.
#3 Linux
Now since there several version of Linux distros, it’s not possible for to cover every one of them. So, we are going with the popular Linux Mint. Though the steps should be similar, for all Debian based OS.
Find MAC Address on Linux Mint
Since Mac OS is built on Linux kernel, the steps for finding and changing MAC address is similar for both. So, to find MAC address on Linux OS, open up terminal and type in the following command.
ifconfig
This will give the MAC Address of all the network cards on your computer. Find the one, you want to change. If you are connected to the internet via WiFi and want to change MAC address of your WiFi card, then look for the MAC address that has an IP address link to it. And write it down, along with the adapter name i.e. — eth0 or eth1 etc.
Change MAC Address on Linux Mint
Now, to change MAC Address on Linux, open terminal and type in the following command.
Replace the eth0 with the name of the Adapter whose MAC address you want to change. And a1:b1.. with the MAC address you want to assign.
So, this first command will disable the network adapter, next we’ll change the MAC address and then restart the adapter once again. To confirm changes, type in ifconfig in the terminal, and you should see the new MAC address.
Note: Like Windows and Mac OS, changing MAC address on Linux is also temporary. So, to make it permanent, go to /etc/network/interfaces and add the following line in the end.
#3 Android
Changing MAC Address on mobile devices are slightly more complicated than Desktop OS. And since Android is also based on Linux kernel, you’ll have to use a sudo command in the terminal. Which means to change MAC address on Android, you’ll need ROOT access. There is no other way.
Change Mac Kali Linux
Find MAC Address on Android
To find the MAC address on Android, go to Settings > About Phone > Status. And look for WiFi MAC address. You can also copy it to the clipboard, by long pressing on it.
Change MAC Address on Android
Now, to change MAC Address on Android, you have two options — either use a terminal app and type in few commands like we did for Linux OS, or use a dedicated app to do that.
For this instance, we’ll go with the simpler method i.e. using a dedicated app. So, go to Play Store and install Change My MAC. Out of many application I’ve tested, this one works quite well.
So, install the app and open it. Now in the app, you can either generate a random MAC address. Or do what I do — copy paste the old MAC Address and replace the last two characters. Next, save changes and that’s it. You have successfully change the MAC address of your Android.
Note: Like the other two, this is also temporary, when you restart your device, your phone will revert to old MAC address. Though unlike the desktop, we don’t restart the Smartphone that often.
iOS
In the recent version of iOS, Apple has made a lot more difficult to change MAC address on iPhone and iPad. You’ll need jailbreak and even then there is no guarantee of success. Overall, not worth it.
Router
Kali Linux Change Mac Address
There is no big reason why you want to change the MAC address of your routers. But if you want to do it anyway — see if your router supports it or not. If it does, you’ll find clone my MAC address option in the advanced interface settings. Or, you can install a custom firmware (like OpenWRT).
How to Change or Spoof MAC Address
Change Mac Address Linux Ubuntu
Wrapping up
Usually, changing MAC address is quite simple. All you have to do is type in a few commands from the terminal or use the software. Though do note, that changing MAC address is not illegal, but what you do with can be. And even if you change your MAC address, you are still not anonymous.