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!
ifconfig
commands which are now deprecated. If anyone knows how these translate to theip
, that might be an answer to my question. – Petr Doležal Feb 26 '21 at 16:41