diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index b65813a43..111cd5d3a 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -2633,6 +2633,14 @@ def process_mac_fields(vlan, mac, mac_type, interface): r"Displaying entries from active supervisor:\s+\w+\s+\[\d\]:", line ): continue + elif re.search(r"EHWIC:.*", line): + # Skip module - process_mac_fields doesn't care. + continue + elif re.search( + r"Destination Address.*Address.*Type.*VLAN.*Destination.*Port", line + ): + # If there are multiple modules, this line gets repeated for each module. + continue else: raise ValueError("Unexpected output from: {}".format(repr(line))) diff --git a/test/ios/mocked_data/test_get_mac_address_table/isr_multiple_ehwic_format/expected_result.json b/test/ios/mocked_data/test_get_mac_address_table/isr_multiple_ehwic_format/expected_result.json new file mode 100644 index 000000000..21b3456ad --- /dev/null +++ b/test/ios/mocked_data/test_get_mac_address_table/isr_multiple_ehwic_format/expected_result.json @@ -0,0 +1,18 @@ +[{ + "static": false, + "active": true, + "vlan": 2, + "mac": "11:11:22:22:33:33", + "interface": "GigabitEthernet0/0/1", + "moves": -1, + "last_move": -1.0 +}, +{ + "static": false, + "active": true, + "vlan": 1, + "mac": "33:33:22:22:11:11", + "interface": "GigabitEthernet0/1/1", + "moves": -1, + "last_move": -1.0 +}] diff --git a/test/ios/mocked_data/test_get_mac_address_table/isr_multiple_ehwic_format/show_mac_address_table.txt b/test/ios/mocked_data/test_get_mac_address_table/isr_multiple_ehwic_format/show_mac_address_table.txt new file mode 100644 index 000000000..3ef491283 --- /dev/null +++ b/test/ios/mocked_data/test_get_mac_address_table/isr_multiple_ehwic_format/show_mac_address_table.txt @@ -0,0 +1,9 @@ +EHWIC: 0 +Destination Address Address Type VLAN Destination Port +------------------- ------------ ---- ----------------- +1111.2222.3333 Dynamic 2 GigabitEthernet0/0/1 + +EHWIC: 1 +Destination Address Address Type VLAN Destination Port +------------------- ------------ ---- ----------------- +3333.2222.1111 Dynamic 1 GigabitEthernet0/1/1