Changing MAC address in Mint 17.1

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
nachos

Changing MAC address in Mint 17.1

Post by nachos »

Hey, I am using Linux Mint 17.1 Cinnamon 64 bit. I am trying to change/spoof the MAC address for my Wi-Fi (wlan0) using the following two ways:

1.) Using "macchanger"

Code: Select all

# ifconfig -a | grep HWaddr
# ifconfig wlan0 down
# macchanger -A interface
# ifconfig wlan0 up
# ifconfig -a | grep HWaddr
After doing "ifconfig wlan0 up" it doesn't connect to the Internet for some seemingly unfathomable reason. I have a workaround it as of now, in which I choose any other available Wi-Fi network and then revert back to my network. At this point, I am connected to the Internet. Now when I check the MAC address using the last command (as cited above), the MAC address remains unchanged

2.) Edit /etc/network/interfaces file

Code: Select all

# vim /etc/network/interfaces
Appending the following line at the end of the file:

hwaddress ether A4-19-E2-94-DD-BB

Code: Select all

sudo /etc/init.d/networking restart
Now when I check the MAC address, it still remains unchanged.

Help?!!
Thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
1.618

Re: Changing MAC address in Mint 17.1

Post by 1.618 »

See if this works

Code: Select all

sudo ifconfig wlan0 down
sudo ifconfig wlan0 hw ether xx:xx:xx:xx:xx:xx
sudo ifconfig wlan0 up

I'm using mate so not sure if this will apply but I had a similar problem recently using macchanger, i couldn't get it to change the mac, reason being that i edited my connections and there is an option to spoof the mac there as well, which overrides macchanger, right click your network icon and select 'edit connections' then choose your wireless connection and see if you can spoof the mac that way? i forgot that i had done it and got a headache trying to sort machchanger out, lol
User avatar
Fred Barclay
Level 12
Level 12
Posts: 4185
Joined: Sat Sep 13, 2014 11:12 am
Location: USA primarily

Re: Changing MAC address in Mint 17.1

Post by Fred Barclay »

This page ?might? help. It has instructions for Windows and OS X as well. :)
Image
"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy."
- Albert Einstein
1.618

Re: Changing MAC address in Mint 17.1

Post by 1.618 »

Also the first 3 pairs of digits need to be legit, i have found that just randomly entering characters won't always work - use only numbers 0-9 and letter A-F

so xz:99:vb:11:22:33 wouldn't work

but

0f:d3:32:3f:5a:4d does work
nachos

Re: Changing MAC address in Mint 17.1

Post by nachos »

When I try the command:

Code: Select all

# ifconfig wlan0 up
the Internet doesn't connect/work. I have to manually disconnect the network using the Wi-Fi icon and reconnect to my Wi-Fi network. Doing this causes the MAC address to revert back to the original MAC address. Any ideas on how to fix this?

Thanks for the help!!
1.618

Re: Changing MAC address in Mint 17.1

Post by 1.618 »

nachos wrote:When I try the command:

Code: Select all

# ifconfig wlan0 up
the Internet doesn't connect/work. I have to manually disconnect the network using the Wi-Fi icon and reconnect to my Wi-Fi network. Doing this causes the MAC address to revert back to the original MAC address. Any ideas on how to fix this?

Thanks for the help!!
does your router/wifi have mac filtering enabled?
are you using the code with the hash symbol # ?

have you tried using macchanger at boot instead of manually in a terminal? the following works for me on mate, I assume cinnamon should be pretty similar, just swap eth0 for wlan0

http://forums.linuxmint.com/viewtopic.p ... 47#p943937
nachos

Re: Changing MAC address in Mint 17.1

Post by nachos »

@1.618,

I checked out the setting of my Wifi router and found out that it has "Filter Type" as "IP/MAC filter". What does this mean? Can you please explain?
LOL, I used the "#" to literally denote that the command was being executed as a root user ('#' for the root user prompt at the terminal).

Do you think that due to the "IP/MAC filter" setting in my router, the URL that you posted will work? I will try and post the results back.

Thanks for your help
1.618

Re: Changing MAC address in Mint 17.1

Post by 1.618 »

Ok well on my router i have a mac filter option in the firewall, basicly it has a list of mac addresses that I manually enter and when activated, only those devices are allowed to connect. It's possible that this could be the problem. I assume this is the same sort of thing on your router

To find out if this is the problem, log into your router and see if the mac filter is enabled and then see if you can add the cloned mac address that you have been trying to connect with, then try and change your mac address like you were doing previously and see if you can connect. or, change your mac and then log into the router and see if you can add the new mac to the filter, I don't think it should matter which way round you do it but sometimes these things have to be done a certain way.

I can't promise that macchanger at boot will work but I thought it might be worth a try in case your network card is refusing to change the mac once up and running, I'm still quite new to all this myself so just going with what i know and consider to be logical steps to undertake to try and find a solution for you. :-)

# lol, sorry I didn't realise you were using that to signify root priviliges, at least i know when i see it posted on here from now on!
nachos

Re: Changing MAC address in Mint 17.1

Post by nachos »

@1.618,

I tried your shell script. But alas! the "macchanger" script isn't working.
1.618

Re: Changing MAC address in Mint 17.1

Post by 1.618 »

nachos wrote:@1.618,

I tried your shell script. But alas! the "macchanger" script isn't working.
not sure why that would be, works ok for me but I am on mate 32 bit, i don't think there should be any difference though there is a 64 bit .deb package as well. Can you spoof the mac via the edit network connections option?
nachos

Re: Changing MAC address in Mint 17.1

Post by nachos »

I tried giving a new address in "Cloned MAC Address" under "Network Connections" and ran

Code: Select all

/etc/init.d/networking restart
. But the MAC address reflected in

Code: Select all

ifconfig | grep HWaddr
isn't changing!!

But when I restarted the system, it didn't connect to the Internet at all. The system was trying to connect to the Wi-Fi but wasn't able to. It was only when I deleted the spoofed MAC address and again rebooted the system that the Internet started working again.
petrovich

Re: Changing MAC address in Mint 17.1

Post by petrovich »

works for me (may be for next restart)

Code: Select all

 ifconfig | grep wlan
 
 sudo ifconfig wlan0 down
 [disable wifi,network from tray network config menu]
 macchanger -A wlan0
 [enable network,wifi  from tray network config menu]
 sudo ifconfig wlan0 up

 [edit wifi connection settings via network manager, set CLONED MAC ADDRESS to new mac]

 connect 
  
Locked

Return to “Networking”