I'm pretty sure the 'router' at a public hotspot knows your MAC address, and probably your laptop hostname (and maybe even your username?).
It's easy to change the hostname & MAC address, but is there a way to make the MAC address change survive a reboot?
My hostname change on Ubuntu 13.10 survives a reboot: $ sudo hostname newhostname $ sudo vi /etc/hostname $ sudo vi /etc/hosts $ hostname
But, the way I change the MAC doesn't seem to survive the reboot: $ sudo ifconfig wlan0 down $ sudo ifconfig wlan0 hw ether DE:AD:BE:EF:CA:FE $ sudo ifconfig wlan0 up $ ifconfig -a | grep HWaddr
Is there an easy way to make an Ubuntu MAC change stick after reboot?
Sure, install macchanger. Use it in your /etc/{ whatever} rc.local script You can even make it randomize numbers, manufacturers etc. Macchanger was made for it. PS: disable IPV6..... use only IPV4. Not sure IPV6 if queries the hardware or the number you change your MAC to.
Another PS :You might want to look into the aircrack-ng tools, they can set your adaptor to promiscuous mode at startup too. It will appear as mon0. (again, in the rc.local script) []'s
Interesting this 'macchanger' program. It may be useful, but, a first pass shows it's more work to use manually than to just issue the manual ifconfig commands.
However, I guess the value of macchanger is the "-r" randomizer. Is that correct?
$ macchanger The program 'macchanger' is currently not installed. You can install it by typing: sudo apt-get install macchanger
$ sudo apt-get install macchanger
$ which macchanger /usr/bin/macchanger
$ macchanger --help GNU MAC Changer Usage: macchanger [options] device
-h, --help Print this help -V, --version Print version and exit -s, --show Print the MAC address and exit -e, --ending Don't change the vendor bytes -a, --another Set random vendor MAC of the same kind -A Set random vendor MAC of any kind -p, --permanent Reset to original, permanent hardware MAC -r, --random Set fully random MAC -l, --list[=keyword] Print known vendors -m, --mac=XX:XX:XX:XX:XX:XX --mac XX:XX:XX:XX:XX:XX Set the MAC XX:XX:XX:XX:XX:XX
Report bugs to snipped-for-privacy@gnu.org
$ sudo macchanger -r wlan0 Permanent MAC: 00:a8:c3:af:33:b9 (Intel Corporate) Current MAC: de:ad:be:ef:ca:fe (unknown) ERROR: Can't change MAC: interface up or not permission: Device or resource busy
$ sudo ifconfig wlan0 down $ sudo macchanger -r wlan0 Permanent MAC: 00:a8:c3:af:33:b9 (Intel Corporate) Current MAC: de:ad:be:ef:ca:fe (unknown) New MAC: 54:c4:a5:de:32:63 (unknown)
$ sudo ifconfig wlan0 up $ ifconfig -a | grep HWaddr eth0 Link encap:Ethernet HWaddr ca:fe:de:ad:be:ef wlan0 Link encap:Ethernet HWaddr 54:c4:a5:de:32:63
It seems the use model is three commands, in sequence:
sudo ifconfig wlan0 down
macchanger -r wlan0
sudo ifconfig wlan0 up
Is that what you suggest I put in rc.local on Ubuntu saucy?
Interesting this 'macchanger' program. It may be useful, but, a first pass shows it's more work to use manually than to just issue the manual ifconfig commands.
However, I guess the value of macchanger is the "-r" randomizer. Is that correct?
$ macchanger The program 'macchanger' is currently not installed. You can install it by typing: sudo apt-get install macchanger
$ sudo apt-get install macchanger
$ which macchanger /usr/bin/macchanger
$ macchanger --help GNU MAC Changer Usage: macchanger [options] device
-h, --help Print this help -V, --version Print version and exit -s, --show Print the MAC address and exit -e, --ending Don't change the vendor bytes -a, --another Set random vendor MAC of the same kind -A Set random vendor MAC of any kind -p, --permanent Reset to original, permanent hardware MAC -r, --random Set fully random MAC -l, --list[=keyword] Print known vendors -m, --mac=XX:XX:XX:XX:XX:XX --mac XX:XX:XX:XX:XX:XX Set the MAC XX:XX:XX:XX:XX:XX
Report bugs to snipped-for-privacy@gnu.org
$ sudo macchanger -r wlan0 Permanent MAC: 00:a8:c3:af:33:b9 (Intel Corporate) Current MAC: de:ad:be:ef:ca:fe (unknown) ERROR: Can't change MAC: interface up or not permission: Device or resource busy
$ sudo ifconfig wlan0 down $ sudo macchanger -r wlan0 Permanent MAC: 00:a8:c3:af:33:b9 (Intel Corporate) Current MAC: de:ad:be:ef:ca:fe (unknown) New MAC: 54:c4:a5:de:32:63 (unknown)
$ sudo ifconfig wlan0 up $ ifconfig -a | grep HWaddr eth0 Link encap:Ethernet HWaddr ca:fe:de:ad:be:ef wlan0 Link encap:Ethernet HWaddr 54:c4:a5:de:32:63
It seems the use model is three commands, in sequence:
sudo ifconfig wlan0 down
macchanger -r wlan0
sudo ifconfig wlan0 up
Is that what you suggest I put in rc.local on Ubuntu saucy?
(or whatever "which" tells you) And I believe rc.local is run as root. No need for the sudo. If rc.local is absent, when you create it, don't forget to make it executable. HTH []'s
Yes, but you don't want an nonexistent manufacturer. The -A is more "low profile" To be "silent" you have to blend in, not stand out like a single currant in a bowl of custard. ;) []'s
Yes, but it can. By default the execute bit is set but it only contains one command: exit 0, which does nothing but it does get executed. Any commands added will also be executed.
Here is the contents from Ubuntu 12.04LTS...
----------------- #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing.
I would put this in /etc/network/interfaces, as this is just the job for a pre-up command, however, you don't mention what you're using to manage the network settings on that machine so it may not play well.
I'm using stock Ubuntu 13.10, so, I don't even know what it's using to manage the network. I think it's called Gnome, but, it's whatever is default.
On the top right of the screen, I have a bar of icons, one of which is the wireless icon, which, when I pull it down, is titled "Network Connections".
If I look in /etc/network/, I have $ file /etc/network/* /etc/network/if-down.d: directory /etc/network/if-post-down.d: directory /etc/network/if-pre-up.d: directory /etc/network/if-up.d: directory /etc/network/interfaces: ASCII text /etc/network/interfaces.d: directory /etc/network/run: symbolic link to `/run/network'
$ cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback
Gnome is the windows manager ( the thing that puts the icons etc onto your screen) and has noting to do with networks. Your network manager might quite probably be NetworkManager.
This is the directory he was refering to. I do not run ubuntu but it probably has a number of files in it. He is suggesting you put a file in there to make it run the command to set you mac address
This is the one. Each interface definition can have any number of pre-up and post-up commands. On my Debian server I use a pre-up command to build a bridge interface out of a bunch of ethernet NICs, before applying the IP settings.
I use Ubuntu on my laptop with WICD for network management. I think I binned NM because it was sucking in one way or another, and now 4 years later WICD has all the wireless networks remembered for all the places I go so I've no great reason to go back to NM. I don't think /etc/network/interfaces would play well with this. Closer inspection reveals that WICD also has a pre-up, post-up, pre-down and post-down option just like /e/n/i so that's how I'd approach it on my system.
From that ps output you look to be running Network Manager. This page suggests that the two could be made to co-operate:
formatting link
but I'm not sure if you be able to get ifupdown to set the MAC and NM to handle the WLAN parameters at the same time...I guess it depends how sticky the MAC address setting is? Perhaps NetworkManager has its own equivalent of pre-up?
Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.