Our thinking


Network discovery using LLDP on macOS

In trying to find the IP address of a switch on the network, I first turned (without much hope) to performing a Bonjour discovery on the network, but as expected the switch was not advertising itself via this protocol.

In the manual for the switch, it says that the switch supports LLDP to display information about the configuration.

I installed lldpd using MacPorts (it’s also available in Homebrew) and was then able to run sudo lldpcli show neighbors to view information about devices I’m connected to on the LAN.

This returned information like the following:

kai@hobbes ~ % sudo lldpcli show neighbors
-----------------------------------------------------------------------------
LLDP neighbors:
-----------------------------------------------------------------------------
Interface:    en0, via: LLDP, RID: 2, Time: 0 day, 00:07:09
  Chassis:     
    ChassisID:    mac b4:fb:e4:e4:6e:f8
    SysName:      Charcoal
    SysDescr:     UAP-nanoHD, 6.7.17.15512
    MgmtIP:       10.10.30.196
    MgmtIface:    25
    MgmtIP:       fe80::b6fb:e4ff:fee4:6ef8
    MgmtIface:    2
    Capability:   Bridge, on
    Capability:   Router, on
    Capability:   Wlan, on
    Capability:   Station, off
  Port:        
    PortID:       mac b4:fb:e4:e4:6e:fa
    PortDescr:    rai0
    TTL:          120
-----------------------------------------------------------------------------
Interface:    en7, via: LLDP, RID: 1, Time: 0 day, 00:07:19
  Chassis:     
    ChassisID:    mac 8c:85:c1:1d:2f:a4
    SysName:      CN13KPJ0CH
    SysDescr:     HPE Networking Instant On Switch 48p Gigabit CL4 PoE 4p SFP+ 370W 1930 JL686A, InstantOn_1930_3.2.0.0 (8)
    MgmtIP:       10.10.30.135
    MgmtIface:    100000
    MgmtIP:       fe80::8e85:c1ff:fe1d:2fa4
    MgmtIface:    100000
    Capability:   Bridge, on
  Port:        
    PortID:       ifname 30
    PortDescr:    30
    TTL:          120
  Unknown TLVs:
    TLV:          OUI: 00,12,0F, SubType: 5, Len: 10 00,11,00,11,00,11,00,11,00,11
-----------------------------------------------------------------------------

This helpfully shows me that I’m connected to a Ubiquiti Unifi Nano HD access point and an HPE Aruba 1930 switch. The IP address of the switch is 10.10.30.135 and now all I need to do is work out the admin login credentials…

Leave a Reply