[[Link Layer Discovery Protocol|LLDP]] allows you to know exactly on which port is a server (and reciprocally).
# Installation
## MacOS
### Homebrew
```bash
brew install lldpd
```
> [!Note]
> It will tell you how to start lldpd, I forget what you run but brew will tell you.
# Usage
> [!Note]
> You have to start lldpd then you can use `lldpcli` to interact with the program.
## Launch the CLI
```bash
lldpcli
```
## See your neighbors
This command should allow you to see the information about what you are directly connected to (your neighbors)
```bash
show neighbors
```
example output:
```
LLDP neighbors:
Interface: en9, via: LLDP, RID: 1, Time: 0 day, 00:01:04
Chassis:
ChassisID: mac 94:18:65:4a:a2:4d
SysName: IDF-SWT-MT5397
SysDescr: NETGEAR 24-Port Gigabit PoE+ Smart Managed Pro Switch with 4 SFP Ports (GS728TPv2)
MgmtIP: 192.168.0.252
MgmtIface: 45
Capability: Bridge, on
Capability: Router, off
Port:
PortID: local g6
TTL: 120
```
also for more detail
```bash
show neighbors detail
```
output:
```
-------------------------------------------------------------------------------
Interface: eth0, via: LLDP, RID: 1, Time: 0 day, 00:00:10
Chassis:
ChassisID: mac 00:18:f3:03:4e:06
SysName: dev-01.example.com
SysDescr: Debian GNU/Linux 7.0 (wheezy) Linux 3.7-trunk-amd64 #1 SMP Debian 3.7.1-1~experimental.1 x86_64
MgmtIP: 192.168.20.127
Capability: Bridge, on
Capability: Router, on
Capability: Wlan, off
Port:
PortID: mac ea:b8:ab:aa:8c:da
PortDescr: eth1
PMD autoneg: supported: no, enabled: no
MAU oper type: 10GigBaseR - R PCS/PMA, unknown PMD.
LLDP-MED:
Device Type: Media Endpoint (Class II)
Capability: Capabilities
Capability: Policy
Capability: Location
Capability: MDI/PSE
Capability: MDI/PD
Capability: Inventory
Inventory:
Hardware Revision: System Version
Software Revision: 3.7-trunk-amd64
Firmware Revision: 2104
Serial Number: System Serial Number
Manufacturer: System manufacturer
Model: System Product Name
Asset ID: Asset-1234567890
-------------------------------------------------------------------------------
```