LinuxCommandLibrary

lldpctl

Show LLDP information about neighbors

TLDR

Start the lldp daemon

$ systemctl start lldpd
copy

Display collected neighbor data
$ sudo lldpctl
copy

Display help
$ lldpctl [[-h|--help]]
copy

SYNOPSIS

lldpctl [options] [device]

PARAMETERS

-d, --daemon
    Connect to a specific lldpd instance.

-f, --format
    Specify the output format (e.g., json, xml, plain).

-V, --version
    Display the version number.

-h, --help
    Display help message.

[device]
    The network device to query. If omitted, queries all devices.

-u, --usage
    Display a short usage message.

DESCRIPTION

The `lldpctl` command is a utility used to interact with the Link Layer Discovery Protocol (LLDP) agent. It allows you to view, query, and manage LLDP information gathered from network devices. This information is useful for network discovery, topology mapping, and troubleshooting. `lldpctl` can display details about neighboring devices, their capabilities, and network configurations, providing valuable insights into network connectivity. Using `lldpctl`, one can retrieve information such as the chassis ID, port ID, system name, system description, supported and enabled capabilities of network neighbors. It's an essential tool for network administrators to understand and manage network infrastructure, visualize network topology, and diagnose connectivity issues based on the gathered LLDP data. `lldpctl` interacts with the LLDP daemon (usually `lldpd`) to fetch and display information, and may also allow for some limited configuration or control of the daemon's behavior.

OUTPUT FORMATS

The `-f` or `--format` option allows you to specify the output format. Common formats include `json` (for machine-readable output), `xml`, and `plain` (for human-readable output). Choosing the appropriate format depends on how you intend to use the data. JSON is often used for scripting and automation, while plain text is suitable for quick viewing.

DEVICE SPECIFIC QUERIES

By specifying a device name (e.g., `eth0`, `wlan0`) as an argument to `lldpctl`, you can limit the query to that specific network interface. This allows you to focus on the neighbors connected to that particular interface. If no device is specified, `lldpctl` will query all interfaces configured for LLDP.

INTERPRETING OUTPUT

The output of `lldpctl` typically includes information such as the neighbor's chassis ID (usually its MAC address), port ID (the interface on the neighbor), system name, system description, and supported capabilities (e.g., bridge, router). Understanding these fields allows you to build a comprehensive view of your network topology. It's important to note that LLDP information depends on the support and configuration of the neighboring devices. If a device doesn't support LLDP or has it disabled, it won't appear in the `lldpctl` output.

HISTORY

The `lldpctl` command is part of the lldpd suite of tools, developed to provide Link Layer Discovery Protocol support on Linux and other Unix-like systems. LLDP is a standard protocol (IEEE 802.1AB) that allows network devices to advertise their identity, capabilities, and connectivity on a network. The lldpd project aims to provide a complete and compliant implementation of LLDP, including the daemon `lldpd` and the management utility `lldpctl`. Development focused on allowing easy network discovery. The usage increased with automation to check if neighbors are correctly connected.

SEE ALSO

lldpd(8)

Copied to clipboard