Use platform-independent Python module to get a MAC address
jaklan opened this issue · 0 comments
jaklan commented
As in the title - there's no need to depend on iproute2
, which is not available on systems like macOS (and iproute2mac
doesn't support ip n s [IP]
command). There's a Python library:
https://github.com/GhostofGoes/getmac
which solves the issue in 2 lines:
from getmac import get_mac_address
get_mac_address(ip=self.__ip)