diff --git a/napalm/nxos/nxos.py b/napalm/nxos/nxos.py index e4e96153e..905e760c2 100644 --- a/napalm/nxos/nxos.py +++ b/napalm/nxos/nxos.py @@ -807,7 +807,7 @@ def get_ntp_stats(self): def get_interfaces_ip(self): interfaces_ip = {} - ipv4_command = 'show ip interface' + ipv4_command = 'show ip interface vrf all' ipv4_interf_table_vrf = self._get_command_table(ipv4_command, 'TABLE_intf', 'ROW_intf') for interface in ipv4_interf_table_vrf: @@ -857,7 +857,7 @@ def get_interfaces_ip(self): 'prefix_length': secondary_address_prefix }) - ipv6_command = 'show ipv6 interface' + ipv6_command = 'show ipv6 interface vrf all' ipv6_interf_table_vrf = self._get_command_table(ipv6_command, 'TABLE_intf', 'ROW_intf') for interface in ipv6_interf_table_vrf: diff --git a/napalm/nxos_ssh/nxos_ssh.py b/napalm/nxos_ssh/nxos_ssh.py index b52d516e1..c6d849f07 100644 --- a/napalm/nxos_ssh/nxos_ssh.py +++ b/napalm/nxos_ssh/nxos_ssh.py @@ -1036,7 +1036,7 @@ def get_arp_table(self): """ arp_table = [] - command = 'show ip arp vrf default | exc INCOMPLETE' + command = 'show ip arp vrf all | exc INCOMPLETE' output = self.device.send_command(command) separator = r"^Address\s+Age.*Interface.*$" @@ -1140,8 +1140,8 @@ def get_interfaces_ip(self): } """ interfaces_ip = {} - ipv4_command = 'show ip interface vrf default' - ipv6_command = 'show ipv6 interface vrf default' + ipv4_command = 'show ip interface vrf all' + ipv6_command = 'show ipv6 interface vrf all' output_v4 = self.device.send_command(ipv4_command) output_v6 = self.device.send_command(ipv6_command) @@ -1154,11 +1154,14 @@ def get_interfaces_ip(self): interface = line.split(',')[0] continue if 'IP address' in line: - ip_address = line.split(',')[0].split()[2] try: - prefix_len = int(line.split()[5].split('/')[1]) - except ValueError: - prefix_len = 'N/A' + ip_address = line.split(',')[0].split()[2] + try: + prefix_len = int(line.split()[5].split('/')[1]) + except ValueError: + prefix_len = 'N/A' + except IndexError: + continue val = {'prefix_length': prefix_len} v4_interfaces.setdefault(interface, {})[ip_address] = val