'Why is the MAC address I get in code different from the actual MAC address in Linux

import uuid
uuid.UUID(int=uuid.getnode()).hex[-12:]

When I execute the code on the python command line, what I get is not the MAC address of eth0, but the MAC address of a docker network card. There is no such problem on other machines.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source