10

Usually I would be able to change my wifi mac address with the ifconfig command like :

ifconfig <iface> hw ether XX:XX:XX:XX:XX:XX

Ubuntu have however deprecated ifconfig in behalf of the "ip" command, so I was wondering if there is an way to get similar functionality using that command?

kimusan
  • 251
  • 1
  • 2
  • 9

2 Answers2

17

First run:

ip link show

This will list your network devices. Find the one you want to change. Next, run:

sudo ip link set dev <your device here> down

Then:

sudo ip link set dev <your device here> address <your new mac address>

Finally:

sudo ip link set dev <your device here> up
hiigaran
  • 6,253
  • 4
  • 28
  • 40
  • `ip -c a` is really handy as a first command, or just `ip a` which stands for `ip address` and gives you a slightly different display including IPv4 and IPv6 addresses. – pbhj Jun 08 '19 at 10:17
  • 1
    Will this change persist after the reboot? – John Smith Mar 31 '22 at 11:23
-4

To change the MAC (Media Access Control) address of an eth0 network interface, use the following command with argument “hw ether“. For example, see below.

[root@tecmint ~]# ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF

use this article, i hope this very helpfull for you!

snishalaka
  • 123
  • 3
  • 4
    The question was explicitely about an alternative to `ifconfig` because Ubuntu has switched to the `ip` command. – PerlDuck Aug 16 '18 at 14:20