Correct way to get MAC address in a snap

Hi,

In the app I am snapping I have to get the computer MAC address and I can’t find a correct way to get it.

I already tried in different ways :

  • With ip command but got blocked by AppArmor.
  • By looking in /sys/class/net/enp1s0/address file which contains it but got blocked by AppArmor too.

I understand that it is normal to get blocked because I didn’t specify the correct interface but I don’t know which one I should use, any idea ? By the way do you have a better way to get the address ?

Thank you,

You should be able to get it with the network-observe interface, if I’m remembering correctly…

1 Like

Well… you are remembering correctly, it works! Thank you :slight_smile:

2 Likes