You are not logged in.

#1 Today 08:54:19

alfredino
Member
Registered: Today
Posts: 7

MAC address spoofing

Hello,
I followed your guide about how to mask MAC address and I decided to use the Network Manager solution https://wiki.archlinux.org/title/MAC_ad … orkManager
It works pretty well with both random and stable version
nethernet.cloned-mac-address=random
wifi.cloned-mac-address=stable | random
My questions is related to the possibility to have a custom option for a specific network. I need this because in some WiFi, there is not password protection and the authentication is done by the pair MAC address-password.
Thank you

Offline

#2 Today 09:10:15

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,381

Re: MAC address spoofing

Note the second to last sentence in the section you linked

Arch Wiki wrote:

To configure MAC randomization for a specific connection (for example, if the network does not like random MAC addresses), edit the connection to set 802-11-wireless.cloned-mac-address to one of the modes (e.g. stable or random).

where "edit the connection" links to https://wiki.archlinux.org/title/Networ … connection

Offline

#3 Today 09:27:47

alfredino
Member
Registered: Today
Posts: 7

Re: MAC address spoofing

V1del wrote:

Note the second to last sentence in the section you linked

Arch Wiki wrote:

To configure MAC randomization for a specific connection (for example, if the network does not like random MAC addresses), edit the connection to set 802-11-wireless.cloned-mac-address to one of the modes (e.g. stable or random).

where "edit the connection" links to https://wiki.archlinux.org/title/Networ … connection

Correct. I can change the property to stable from GUI, but I am not sure how to make it via config files. My folder is empty /etc/NetworkManager/system-connections/.

Offline

#4 Today 10:07:15

mithrial
Member
Registered: 2017-03-05
Posts: 169

Re: MAC address spoofing

You need root privileges to read and list that directory.

Offline

#5 Today 10:50:38

alfredino
Member
Registered: Today
Posts: 7

Re: MAC address spoofing

mithrial wrote:

You need root privileges to read and list that directory.

Right, but it is empty. Do you have any suggestion about how to solve it? Any example?
Thank you

Offline

#6 Today 11:51:36

-thc
Member
Registered: 2017-03-15
Posts: 1,194

Re: MAC address spoofing

What's displayed when you enter

nmcli c

?

Offline

#7 Today 13:41:13

alfredino
Member
Registered: Today
Posts: 7

Re: MAC address spoofing

-thc wrote:

What's displayed when you enter

nmcli c

?

The list of network/WiFi (name, UUID, type). Can I customize the configuration so just 1-2 of these WiFi use stable and the rest random?

Offline

#8 Today 13:57:53

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,819

Re: MAC address spoofing

https://bbs.archlinux.org/viewtopic.php … 8#p2309768

sudo  nmcli -f NAME,DEVICE,FILENAME connection show

Edit: post the output verbatim, not "it shows things"

Last edited by seth (Today 13:59:13)

Offline

#9 Today 14:33:42

-thc
Member
Registered: 2017-03-15
Posts: 1,194

Re: MAC address spoofing

alfredino wrote:

The list of network/WiFi (name, UUID, type). Can I customize the configuration so just 1-2 of these WiFi use stable and the rest random?

That's remarkable. How can NetworkManager list all those WiFi connections and "/etc/NetworkManager/system-connections" is empty? Can somebody explain this?

Offline

#10 Today 14:36:19

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,819

Re: MAC address spoofing

Transient profiles in /var/run, command in #8 will tell…

Offline

#11 Today 14:38:53

-thc
Member
Registered: 2017-03-15
Posts: 1,194

Re: MAC address spoofing

Thanks  - never stumbled across transient NM profiles before.

I presume this is where "temporary" changes to NM profiles go? Yes. Just tested it.

Last edited by -thc (Today 14:55:03)

Offline

#12 Today 15:35:02

alfredino
Member
Registered: Today
Posts: 7

Re: MAC address spoofing

seth wrote:

https://bbs.archlinux.org/viewtopic.php … 8#p2309768

sudo  nmcli -f NAME,DEVICE,FILENAME connection show

Edit: post the output verbatim, not "it shows things"

Sorry, I reported just a few lines:

sudo  nmcli -f NAME,DEVICE,FILENAME connection show
OLINKO-OF7590013                 --            /run/NetworkManager/system-connections/netplan-NM-0c604421-54ef-44e2-8d28-a554c2d2b263-OLINKO-OF75>
Orange-h57EXx-2G-2.4G-ext        --            /run/NetworkManager/system-connections/netplan-NM-43d2f525-5c71-4e15-b79e-a997237b225a-Orange-h57E>
Orange Wi-Fi                     --            /run/NetworkManager/system-connections/netplan-NM-bbec9122-8c23-4b48-847c-4824530a788c-Orange%20Wi>
ls /etc/NetworkManager/system-connections/

For instance, if I want to config mac randomization as stable for Orange Wi-Fi, how can I do?
Thank you

Last edited by alfredino (Today 15:36:02)

Offline

#13 Today 16:15:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,381

Re: MAC address spoofing

Which utility do you use to interact with networkmanager? Chances are if not enabling system profile they might store it differently, e.g. plasma-nm will store minimally secrets in kwallet, potentially even entire connection metadata (which might be where you want to look if that happens to be what you're using) and they might expose this setting within their UI and should probably be changed there

Last edited by V1del (Today 16:15:42)

Offline

#14 Today 16:38:12

alfredino
Member
Registered: Today
Posts: 7

Re: MAC address spoofing

I am using mate desktop with network-manager-gnome package. I followed the instructions written by arch linux (first post) and using them via a crontab.

[device-mac-randomization]
wifi.scan-rand-mac-address=yes
 
[connection-mac-randomization]
ethernet.cloned-mac-address=random
wifi.cloned-mac-address=random
@reboot systemctl status NetworkManager

Offline

#15 Today 17:24:51

Beemo
Member
Registered: 2024-12-20
Posts: 129

Re: MAC address spoofing

Looking at the filenames, are you using netplan? Since the NM profile is runtime-generated, modifying it directly probably won't stick.
netplan does have a macaddress setting: https://netplan.readthedocs.io/en/lates … vice-types
The config is probably in /etc/netplan/

Disclaimer: I haven't used Mate, not sure if the entry point / top level config is indeed netplan

Last edited by Beemo (Today 17:28:37)

Offline

#16 Today 18:00:15

alfredino
Member
Registered: Today
Posts: 7

Re: MAC address spoofing

Not sure, but I do not think so. Otherwise, why does network manager configuration work well as I described in my first post? I do not know how to customize it for a specific network.

ls /etc/netplan/
01-network-manager-all.yaml                      90-NM-5b8970c6-75d5-468a-b2a4-fa86c16513e1.yaml  90-NM-b17f33b3-f9e3-4ede-86ad-c5e26d6d3841.yaml
50-cloud-init.yaml                               90-NM-5c76370f-e830-4e21-ac06-2220203563d6.yaml  90-NM-bb7562ba-75f5-409b-ae3e-6272e02e641a.yaml
90-NM-0901b545-d58c-418f-a994-18468a893c57.yaml 
cat /etc/netplan/01-network-manager-all.yaml 
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

Last edited by alfredino (Today 18:00:52)

Offline

#17 Today 18:30:52

Beemo
Member
Registered: 2024-12-20
Posts: 129

Re: MAC address spoofing

netplan can use NM as the backend / "renderer".
I just checked on Ubuntu MATE (where netplan is the top level), it seems at first the connection profile is purely transient*, but you can trigger netplan to create a file in /etc/netplan/ by changing the NM profile in any way. E.g.

$ nmcli con mod "Orange Wi-Fi" wifi.cloned-mac-address permanent

(Or you could always write the netplan config yourself)

* Since I tested it in a VM, I couldn't test Wi-Fi. I'd thought having username & password would warrant an on-disk netplan config, but maybe not.

Last edited by Beemo (Today 19:28:01)

Offline

#18 Today 18:58:53

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,381

Re: MAC address spoofing

Why do you need access to the actual file? If you use nmcli to manipulate the property, does that not stick across reboots? Is this even an Arch install?

Offline

#19 Today 19:04:02

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,819

Re: MAC address spoofing

If the profile is runtime created by something™ you'll have to rely on the config options of something™ to impact that ahead.
You could probably turn them into static profiles using https://wiki.archlinux.org/title/Networ … et_on_boot (nb. the impact on password security, notably when not using https://wiki.archlinux.org/title/Data-a … encryption )

Offline

#20 Today 19:10:29

Beemo
Member
Registered: 2024-12-20
Posts: 129

Re: MAC address spoofing

Because the OP asked

I can change the property to stable from GUI, but I am not sure how to make it via config files

The 2nd point is fair, I'll modify my answer.
The 3rd one is for OP, but my guess is no... (seeing 50-cloud-init.yaml which is something Ubuntu has) Though Arch does have the netplan package so maybe it's still a useful answer.

Offline

Board footer

Powered by FluxBB