My router can do port-forwarding based on MAC addresses. That is, a specific MAC will get a specific IP, for which I can configure a set of ports to be forwarded. In order to easily change that set of ports, I'd like to have different connections in the Network manager.
How do I change the MAC address for a network connection?
First, go to the networking indicator and select "Edit connection" to configure a new connection:
Click 'add' and choose a name for the spoofed MAC network connection.
After selecting your interface "eth0" in the top dropdown, you can simply choose any MAC address you like:
And after connecting to it, you'll be using your new MAC address.
Running
ip link ls
will show you the new interface, including it's spoofed MAC:And now you can easily switch MAC-addresses by connecting to one of the new connections.
You can also change mac address on ubuntu or linux mint via the terminal
Go to your ubuntu or linux mint terminal, edit /etc/network/interfaces file
You should see something like this with dhcp enabled for your network interface. Usually its eth0 for ubuntu or linux mint wired network and wlan0 for ubuntu or linux mint wireless network.
At the end of /etc/network/interfaces file, add this line to give your system’s network interface new MAC address.
Save /etc/network/interfaces file with the new config, then restart your system network.
or
You could try
macchanger
available in the repositories. Install withsudo apt-get install macchanger
or through Ubuntu Software center.Granted this a CLI utility.
Install
macchanger
and have it run every time the network connects by using a udev rule. Create the following file:Replace XX:XX:XX:XX:XX:XX with the Mac Address you want. (Note: some addresses are invalid)
Without requiring
ifconfig
ormacchanger
:In Ubuntu 14.04 many of the solutions proposed were not working for me, and the macchanger one didn't provide many details, so I'm writing here what worked for me (if your wifi network interface is called
wlan0
), simply:UPDATE: In Ubuntu 16.04 my solution above doesn't work anymore, however, the accepted answer works (the accepted answer wasn't working for me in Ubuntu 14.04 back then).