Change network mac address using "ip" command

15,096

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
Share:
15,096

Related videos on Youtube

kimusan
Author by

kimusan

Software developer by daytime, keyboard hacker by night time. Always om the lookout for new fun projects to work on.

Updated on September 18, 2022

Comments

  • kimusan
    kimusan over 1 year

    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?

  • PerlDuck
    PerlDuck over 5 years
    The question was explicitely about an alternative to ifconfig because Ubuntu has switched to the ip command.
  • pbhj
    pbhj almost 5 years
    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.
  • John Smith
    John Smith about 2 years
    Will this change persist after the reboot?