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)
As in the title - there's no need to depend on
iproute2
, which is not available on systems like macOS (andiproute2mac
doesn't supportip n s [IP]
command). There's a Python library: https://github.com/GhostofGoes/getmac which solves the issue in 2 lines: