diff --git a/napalm_base/base.py b/napalm_base/base.py index 01e1aa69..6e16a442 100644 --- a/napalm_base/base.py +++ b/napalm_base/base.py @@ -796,6 +796,7 @@ def get_interfaces_ip(self): addresses as keys. Each IP Address dictionary has the following keys: * prefix_length (int) + * primary_ip (boolean) Example:: @@ -803,35 +804,46 @@ def get_interfaces_ip(self): u'FastEthernet8': { u'ipv4': { u'10.66.43.169': { - 'prefix_length': 22 + 'prefix_length': 22, + 'primary_ip': True + }, + u'10.66.50.1': { + 'prefix_length': 24, + 'primary_ip': False } } }, u'Loopback555': { u'ipv4': { u'192.168.1.1': { - 'prefix_length': 24 + 'prefix_length': 24, + 'primary_ip': True } }, u'ipv6': { u'1::1': { - 'prefix_length': 64 + 'prefix_length': 64, + 'primary_ip': False }, u'2001:DB8:1::1': { - 'prefix_length': 64 + 'prefix_length': 64, + 'primary_ip': True }, u'2::': { - 'prefix_length': 64 + 'prefix_length': 64, + 'primary_ip': False }, u'FE80::3': { - 'prefix_length': u'N/A' + 'prefix_length': u'N/A', + 'primary_ip': False } } }, u'Tunnel0': { u'ipv4': { u'10.63.100.9': { - 'prefix_length': 24 + 'prefix_length': 24, + 'primary_ip': True } } } diff --git a/napalm_base/test/models.py b/napalm_base/test/models.py index 37bd84ff..2f783e2b 100644 --- a/napalm_base/test/models.py +++ b/napalm_base/test/models.py @@ -197,7 +197,8 @@ } interfaces_ip = { - 'prefix_length': int + 'prefix_length': int, + 'primary_key': bool } mac_address_table = {