MikroTik RouterOS IP Neighbors: Network Discovery and Mapping
MikroTik RouterOS IP Neighbors: Network Discovery and Mapping
Section titled âMikroTik RouterOS IP Neighbors: Network Discovery and MappingâRouterOS Version: 6.44+ (slave interface support), 7.x (enhanced LLDP) Difficulty: Beginner Estimated Time: 20 minutes
Overview
Section titled âOverviewâNeighbor Discovery enables your MikroTik router to automatically find and identify other devices in the same Layer 2 broadcast domain. The router can use three protocols: MNDP (MikroTik Neighbor Discovery Protocol), CDP (Cisco Discovery Protocol), and LLDP (Link Layer Discovery Protocol).
This feature is valuable for network mapping, troubleshooting connectivity, and integration with management tools like MikroTikâs The Dude. The neighbor list shows each discovered deviceâs identity, IP/MAC addresses, platform, software version, and the local interface where it was found.
Security warning: By default, discovery is enabled on all interfaces, which means your router broadcasts its identity, version, and IP addresses. On WAN or untrusted interfaces, this is an information leak that aids attackers. Always disable discovery on external-facing ports.
Understanding the Protocols
Section titled âUnderstanding the Protocolsâ| Protocol | Standard | Best For |
|---|---|---|
| MNDP | MikroTik proprietary | All-MikroTik networks |
| CDP | Cisco proprietary | Mixed MikroTik/Cisco networks |
| LLDP | IEEE 802.1AB | Multi-vendor environments (recommended) |
Recommendation: For networks with devices from multiple vendors, use LLDP as itâs the industry standard supported by most enterprise equipment.
Viewing Discovered Neighbors
Section titled âViewing Discovered NeighborsâThe neighbor list is read-only - RouterOS populates it automatically from discovery packets received on participating interfaces.
Basic Neighbor List
Section titled âBasic Neighbor Listâ/ip neighbor printExample Output:
# INTERFACE ADDRESS MAC-ADDRESS IDENTITY PLATFORM VERSION 0 ether2 192.168.88.2 4C:5E:0C:12:34:56 MikroTik-SW1 MikroTik 7.12 1 ether3 192.168.88.3 4C:5E:0C:78:90:AB MikroTik-AP1 MikroTik 7.12 2 ether4 192.168.88.10 00:1A:2B:3C:4D:5E Cisco-Switch Cisco 15.2Detailed Neighbor Information
Section titled âDetailed Neighbor Informationâ/ip neighbor print detailThis shows additional properties including:
age- Time since last discovery packetboard- Hardware model (MikroTik devices)uptime- Device uptime (MikroTik devices)discovered-by- Which protocol found this neighborsystem-caps- LLDP-reported capabilities
Filter by Protocol
Section titled âFilter by Protocolâ# Show only LLDP-discovered neighbors/ip neighbor print where discovered-by=lldp
# Show only neighbors on specific interface/ip neighbor print where interface=ether2Configuration Steps
Section titled âConfiguration StepsâStep 1: View Current Discovery Settings
Section titled âStep 1: View Current Discovery Settingsâ/ip neighbor discovery-settings printDefault Output:
discover-interface-list: static mode: tx-and-rx protocol: cdp,lldp,mndpStep 2: Disable Discovery on WAN Interface (Security)
Section titled âStep 2: Disable Discovery on WAN Interface (Security)âCreate an interface list for exclusion and configure discovery to skip it:
# Create exclusion list/interface list add name=no-discovery
# Add WAN interface to exclusion list/interface list member add interface=ether1-wan list=no-discovery
# Configure discovery to exclude that list/ip neighbor discovery-settings set discover-interface-list=!no-discoveryThe ! prefix means âall interfaces EXCEPT those in this list.â
Step 3: Verify WAN is Excluded
Section titled âStep 3: Verify WAN is Excludedâ# Check interface list membership/interface list member print where list=no-discovery
# Verify no neighbors discovered on WAN/ip neighbor print where interface=ether1-wanThe second command should return no results if properly configured.
Common Configuration Scenarios
Section titled âCommon Configuration ScenariosâEnable Discovery Only on Specific Interfaces
Section titled âEnable Discovery Only on Specific InterfacesâFor maximum security, explicitly list which interfaces participate:
# Create inclusion list/interface list add name=discovery-allowed/interface list member add interface=ether2 list=discovery-allowed/interface list member add interface=ether3 list=discovery-allowed/interface list member add interface=bridge-lan list=discovery-allowed
# Set discovery to use only that list/ip neighbor discovery-settings set discover-interface-list=discovery-allowedDisable Discovery Completely
Section titled âDisable Discovery Completelyâ/ip neighbor discovery-settings set discover-interface-list=noneUse Only LLDP (Recommended for Multi-Vendor)
Section titled âUse Only LLDP (Recommended for Multi-Vendor)âDisable MNDP and CDP to prevent duplicate entries and ensure compatibility:
/ip neighbor discovery-settings set protocol=lldpReceive-Only Mode (Passive Discovery)
Section titled âReceive-Only Mode (Passive Discovery)âDiscover neighbors without advertising your own router:
/ip neighbor discovery-settings set mode=rx-onlyThis is useful when you want to see whatâs on the network without exposing your routerâs information.
Configure LLDP for VoIP Phones (LLDP-MED)
Section titled âConfigure LLDP for VoIP Phones (LLDP-MED)âTell LLDP-MED capable phones which VLAN to use for voice traffic:
/ip neighbor discovery-settings set lldp-med-net-policy-vlan=100Enable LLDP VLAN Information
Section titled âEnable LLDP VLAN InformationâFor switches that need VLAN details in LLDP packets:
/ip neighbor discovery-settings set protocol=lldp lldp-vlan-info=yesLLDP TLV Options
Section titled âLLDP TLV OptionsâLLDP messages contain Type-Length-Value (TLV) fields. RouterOS allows configuring which optional TLVs to include:
| Setting | Default | Description |
|---|---|---|
lldp-poe-power | yes | Include Power over Ethernet information |
lldp-mac-phy-config | no | Include MAC/PHY configuration (speed/duplex) |
lldp-max-frame-size | no | Include maximum frame size (MTU) |
lldp-vlan-info | no | Include IEEE 802.1 VLAN TLVs |
lldp-dcbx | no | Data Center Bridging Exchange capabilities |
lldp-med-net-policy-vlan | disabled | VLAN ID for LLDP-MED devices |
Example enabling additional TLVs:
/ip neighbor discovery-settings set lldp-mac-phy-config=yes lldp-max-frame-size=yesVerification
Section titled âVerificationâCheck 1: Verify Discovery Settings
Section titled âCheck 1: Verify Discovery Settingsâ/ip neighbor discovery-settings printExpected: Appropriate interface list (not âallâ if WAN should be excluded).
Check 2: View All Neighbors
Section titled âCheck 2: View All Neighborsâ/ip neighbor printExpected: Neighbors only on allowed interfaces.
Check 3: Verify WAN Exclusion
Section titled âCheck 3: Verify WAN Exclusionâ/ip neighbor print where interface~"wan"Expected: No results (if WAN properly excluded).
Check 4: Check Interface List Configuration
Section titled âCheck 4: Check Interface List Configurationâ/interface list member printExpected: WAN/untrusted interfaces in exclusion list.
Check 5: Verify Specific Neighbor Details
Section titled âCheck 5: Verify Specific Neighbor Detailsâ/ip neighbor print detail where identity~"Switch"Expected: Full details including discovery protocol, age, capabilities.
Troubleshooting
Section titled âTroubleshootingâProblem: âNeighbors not appearing in listâ
Section titled âProblem: âNeighbors not appearing in listââCause: Interface not in discover-interface-list, or mode set to tx-only.
Solution:
- Check discovery settings:
/ip neighbor discovery-settings print - Verify interface is in the discovery list
- Ensure mode includes
rx:mode=tx-and-rxormode=rx-only
Problem: âSame device appears multiple timesâ
Section titled âProblem: âSame device appears multiple timesââCause: Multiple protocols (CDP, MNDP, LLDP) all discovering the same device.
Solution: Enable only one protocol:
/ip neighbor discovery-settings set protocol=lldpProblem: âThird-party switch not discovering MikroTikâ
Section titled âProblem: âThird-party switch not discovering MikroTikââCause: Remote device only speaks LLDP, but MikroTik sending CDP/MNDP.
Solution: Ensure LLDP is enabled:
/ip neighbor discovery-settings set protocol=lldpOr enable all protocols:
/ip neighbor discovery-settings set protocol=cdp,lldp,mndpProblem: âDiscovery not working on bridge portsâ
Section titled âProblem: âDiscovery not working on bridge portsââCause: RouterOS version before 6.44.
Solution: Upgrade to RouterOS 6.44 or later. In older versions, discovery only worked on the master bridge interface, not individual ports.
Problem: âVoIP phones not getting voice VLANâ
Section titled âProblem: âVoIP phones not getting voice VLANââCause: LLDP-MED VLAN not configured.
Solution:
/ip neighbor discovery-settings set lldp-med-net-policy-vlan=100Replace 100 with your voice VLAN ID.
Problem: âRouter memory usage high from neighbor entriesâ
Section titled âProblem: âRouter memory usage high from neighbor entriesââCause: Large broadcast domain with many devices (pre-6.45 had no limit).
Solution: Upgrade to RouterOS 6.45+, which limits entries to (RAM in MB) Ă 16 per interface. Or restrict discovery to fewer interfaces.
Common Pitfalls
Section titled âCommon Pitfallsâ1. Discovery Enabled on WAN (Security Risk)
Section titled â1. Discovery Enabled on WAN (Security Risk)âWrong: Default configuration on internet-facing router
discover-interface-list: allRight: Exclude WAN interfaces
/interface list add name=no-discovery/interface list member add interface=ether1-wan list=no-discovery/ip neighbor discovery-settings set discover-interface-list=!no-discovery2. Expecting Manual Neighbor Entries
Section titled â2. Expecting Manual Neighbor EntriesâWrong: Trying to add static neighbor entries
/ip neighbor add address=192.168.1.1 # This command doesn't existRight: The neighbor list is automatically populated - itâs read-only. You cannot manually add entries.
3. Confusing with IPv6 Neighbor Discovery
Section titled â3. Confusing with IPv6 Neighbor DiscoveryâWrong: Expecting /ip neighbor to show IPv6 ND table
/ip neighbor print # Shows discovery protocols, not ARP/NDRight: IPv6 Neighbor Discovery (ICMPv6 NDP) is separate:
/ipv6 neighbor print # Shows IPv6 neighbor cache (like ARP for IPv6)4. Using tx-only Mode and Expecting to See Neighbors
Section titled â4. Using tx-only Mode and Expecting to See NeighborsâWrong:
/ip neighbor discovery-settings set mode=tx-only/ip neighbor print # Empty - not receiving discovery packetsRight: Use tx-and-rx or rx-only to see neighbors:
/ip neighbor discovery-settings set mode=tx-and-rxSecurity Best Practices
Section titled âSecurity Best Practicesâ1. Disable on All External Interfaces
Section titled â1. Disable on All External Interfacesâ/interface list add name=external/interface list member add interface=ether1-wan list=external/interface list member add interface=pppoe-out1 list=external/interface list member add interface=wlan-guest list=external/ip neighbor discovery-settings set discover-interface-list=!external2. Use Receive-Only on Semi-Trusted Networks
Section titled â2. Use Receive-Only on Semi-Trusted NetworksâFor networks where you want visibility but donât want to advertise:
/ip neighbor discovery-settings set mode=rx-only3. Firewall-Based Blocking (Alternative)
Section titled â3. Firewall-Based Blocking (Alternative)âIf you canât use interface lists, block at the firewall:
# Block LLDP multicast/interface bridge filter add chain=input dst-mac-address=01:80:C2:00:00:0E/FF:FF:FF:FF:FF:FF action=drop
# Block MNDP/ip firewall filter add chain=input protocol=udp dst-port=5678 action=drop4. Information Exposed
Section titled â4. Information ExposedâDiscovery broadcasts reveal:
- System identity name
- RouterOS version
- Hardware model (board)
- All IP addresses on the interface
- System uptime
- MAC addresses
Attackers can use this to identify vulnerable versions or plan targeted attacks.
Related Features
Section titled âRelated Featuresâ- MAC Server (
/tool mac-server) - Uses neighbor discovery for MAC-Telnet/WinBox access - The Dude - Network monitoring tool that uses discovery for mapping
- IPv6 Neighbor Discovery (
/ipv6 neighbor) - Separate feature for IPv6 address resolution - ARP (
/ip arp) - IPv4 address resolution (different from neighbor discovery) - Interface Lists (
/interface list) - Control discovery scope
References
Section titled âReferencesâ- MikroTik Neighbor Discovery Documentation
- IEEE 802.1AB - LLDP Standard
- LLDP-MED - Media Endpoint Discovery
Related Topics
Section titled âRelated TopicsâNetwork Discovery
Section titled âNetwork DiscoveryâInterface Management
Section titled âInterface Managementâ- Interface Lists - control discovery scope
- Bridge Configuration - Layer 2 connectivity
Security
Section titled âSecurityâ- IP Services - management access control
- Firewall Basics - block discovery protocols