I need to find the MAC address of the Network Interface Card which is assigned the default route in python. with Python. For now i tried solution:
process = os.popen('wmic nic get MACAddress')
result = process.read()
process.close()
print result.split(" \r\n")[1:-1][0]
or:
from uuid import getnode as get_mac
':'.join(("%012X" % mac)[i:i+2] for i in range(0, 12, 2))
It's working when i have only 1 lan, but when i have some wmware adapter with some MAC, sometime i get that MAC.
How to get the MAC Address of the default route?