0

Background

I have a laptop with which I use to connect to a wifi. Normally, if I connect to some wifi, the laptop presents itself with its default MAC-address and I can display it using

ip a

where I can see the wifi device (wlp0s20f3), its IP-addresses and the presented MAC address (18:1d:ea:6d:be:00). This would be the MAC-address that I'd be using for people who have a wifi with MAC-address white list, etc.

Now imagine a Wifi, that limits the connection usage based on the MAC-address alone. To get around it, I could simply present a new virtual MAC-address once in a while and the Wifi would simply think it's a completely new device connecting.

Question

How can I create a new virtual wifi connection with a different MAC-address using the command line? Ideally with the ip command, not the deprecated ifconfig or other network-tools?

So far I found out I can create a new virtual interface using

ip link add link wlp0s20f3 address 00:11:11:11:11:11 wlp0s20f3.1 type macvlan
sudo ip link set wlp0s20f3.1 up

But how do I present it to the wifi now?

Note: I want something I can set up temporarily and delete it later. Please include the commands to undo the setup as well. Thanks!

Petr Doležal
  • 311
  • 1
  • 9
  • 3
    Sounds dishonest to me. – David Feb 26 '21 at 16:12
  • 1
    Does this answer your question? [Change MAC address via Terminal](https://askubuntu.com/questions/439459/change-mac-address-via-terminal) – user68186 Feb 26 '21 at 16:22
  • Sadly no, that uses the old `ifconfig` commands which are now [deprecated](https://serverfault.com/a/503807). If anyone knows how these translate to the `ip`, that might be an answer to my question. – Petr Doležal Feb 26 '21 at 16:41
  • Actually it also completely overwrites the original MAC-address which is far from ideal. I prefer a new connection that can be easily erased without doing too much damage. – Petr Doležal Feb 26 '21 at 16:44
  • 3
    Does this answer your question? [How do I change / spoof my MAC address and easily switch between multiple ones?](https://askubuntu.com/questions/81648/how-do-i-change-spoof-my-mac-address-and-easily-switch-between-multiple-ones) (specifically [this answer](https://askubuntu.com/questions/81648/how-do-i-change-spoof-my-mac-address-and-easily-switch-between-multiple-ones/1258805#1258805)) Seems easily reversible by running the same commands with the original MAC address or likely even just a reboot. – Pixelated Fish Feb 26 '21 at 16:52
  • Thanks for digging this up. It does, partially. I'd still prefer to create a new virtual device, because I know it should be possible. I just don't understand exactly how to work with the ARP tables and similar. – Petr Doležal Feb 26 '21 at 17:44

0 Answers0