Artik 710 os 2.12.5 eth0 fixed mac address

network

#1

Hi, I tried all the possibilities in Network Manager manual but it seems that the os does not get the new configuration inputs.

Please give me a working alternative for setting a fixed mac address for eth0 interface.

Thanks,
Paul


#4

Will getting the PermHwAddress property solve the issue for you? More information here: https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.Wired.html#gdbus-property-org-freedesktop-NetworkManager-Device-Wired.PermHwAddress

Here is how this would look like in a shell script:

First we will get the object path of the eth0 device and store it in variable:

DEVICE_PATH=$(dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.GetDeviceByIpIface string:"eth0" | grep "object path" | cut -d '"' -f2)

Then you may get the MAC with:

dbus-send --system --print-reply --dest=org.freedesktop.NetworkManager $DEVICE_PATH org.freedesktop.DBus.Properties.Get string:"org.freedesktop.NetworkManager.Device.Wired" string:"PermHwAddress" | grep "variant" | cut -d '"' -f2

With Python or JS the code will be cleaner.