This creates a .rsc (RouterOS Script) file in the router's Files menu.
/ip neighbor discovery-settings discover-interface-list=LAN
If you only need your firewall rules or your IP addresses, you don't need the whole file. Navigate to the submenu and run export: