Open Solvik opened 4 years ago
interface = netifaces.gateways()['default'][netifaces.AF_INET][1]
will tell you which interface has the default route.
Doesn't seem to handle every case:
>>> import netifaces
>>> netifaces.gateways()
{'default': {}}
In my case IP are announced via exabgp
Netbox has the ability to flag an IP as
Primary address
for aDevice
Since it's tied to the user workflow, I'd say we could enable this guess with a config argument and use the following workflow
Primary adresss