LLDPD(8)
โจ NAME โจ
okay so this is the LLDPD(8) page from the System Managerโs Manual, and the main character is lldpd โ the LLDP daemon. periodt. ๐
๐ก SYNOPSIS ๐ก
lldpd [-dxcseiklrv] [-D debug] [-p pidfile] [-S description]
[-P platform] [-X socket] [-m management] [-u file]
[-I interfaces] [-C interfaces] [-M class] [-H hide] [-L lldpcli]
[-O configfile]
๐ DESCRIPTION ๐
lldpd is a daemon that is literally able to receive and send LLDP frames. The Link Layer Discovery Protocol is a vendor-neutral Layer 2 protocol that allows a network device to advertise its identity and capabilities on the local network. iconic behavior, no cap. ๐
lldpd also implements an SNMP subagent using AgentX protocol to interface to a regular SNMP agent like Net-SNMP. To enable this subagent, you need something like that in your snmpd.conf(5):
master agentx
This daemon implements both reception and sending. It will collect various information to send LLDP frames to all Ethernet interfaces, including management address, speed and VLAN names. ๐ฆ
The options are as follows:
๐ OPTIONS ๐
-dโ Do not daemonize. If this option is specified,lldpdwill run in the foreground. When specified one more time,lldpdwill not log to syslog but only to stderr. Then, this option can be specified many times to increase verbosity. When specified four times, debug logs will be enabled. They can be filtered with the-Dflag. ๐-D debugโ This option allows the user to filter out debugging information by specifying allowed tokens. This option can be repeated several times to allow several tokens. This option must be combined with the-dflag to have some effect. Only debugging logs can be filtered. Here is a list of allowed tokens with their description:mainโ Main daemon.interfacesโ Discovery of local interfaces.lldpโ LLDP PDU encoding/decoding.edpโ EDP PDU encoding/decoding.cdpโ CDP/FDP PDU encoding/decoding.sonmpโ SONMP PDU encoding/decoding.eventโ Events management.libeventโ Events management but for logs generated by libevent.privsepโ Privilege separation.localchassisโ Retrieval of information related to the local chassis.rpcโ Client communication.controlโ Management of the Unix control socket.snmpโ SNMP subagent.libsnmpโ SNMP subagent but for logs generated by NetSNMP.decodeโ Generic PDU decoding.marshalโ Low-level serialization mechanisms.allocโ Low-level allocation mechanisms.sendโ Sending PDU to some interface.receiveโ Receiving PDU from some interface.loopโ Main loop.smartfilterโ Smart filtering of different protocols on the same port.netlinkโ Netlink subsystem.
-p pidfileโ Use the provided PID file to recordlldpdPID instead of/run/lldpd/lldpd.pid. ๐ซถ-kโ Disable advertising of kernel release, version and machine. Kernel name (ie: Linux) will still be shared, and Inventory software version will be set to'Unknown'. ๐-S descriptionโ Override system description with the provided description. The default description is the kernel name, the node name, the kernel version, the build date and the architecture (except if you use the-kflag described above). ๐ธ-P platformโ Override the CDP platform name with the provided value. The default description is the kernel name (Linux). ๐ฆ-xโ Enable SNMP subagent. With this option,lldpdwill enable an SNMP subagent using AgentX protocol. This allows you to get information about the local system and remote systems through SNMP. ๐-X socketโ Enable SNMP subagent using the specified socket.lldpdwill enable an SNMP subagent using AgentX protocol for the given socket. This option implies the previous one. The default socket is usually/var/agentx/master. You can specify a socket liketcp:127.0.0.1:705for example. Since the process that will open this socket is enclosed in a chroot, you need to specify an IP address (not a hostname) when using a TCP or UDP socket. ๐ฅ-cโ Enable the support of CDP protocol to deal with Cisco routers that do not speak LLDP. If repeated, CDPv1 packets will be sent even when there is no CDP peer detected. If repeated once again, CDPv2 packets will be sent even when there is no CDP peer detected. If repeated once again (i.e.-cccc), CDPv1 will be disabled and CDPv2 will be enabled. If repeated once again (i.e.-ccccc), CDPv1 will be disabled and CDPv2 will be forced. ๐-fโ Enable the support of FDP protocol to deal with Foundry routers that do not speak LLDP. If repeated, FDP packets will be sent even when there is no FDP peer detected. ๐-sโ Enable the support of SONMP protocol to deal with Nortel routers and switches that do not speak LLDP. If repeated, SONMP packets will be sent even when there is no SONMP peer detected. ๐-eโ Enable the support of EDP protocol to deal with Extreme routers and switches that do not speak LLDP. If repeated, EDP packets will be sent even when there is no EDP peer detected. โญ-lโ Force to send LLDP packets even when there is no LLDP peer detected but there is a peer speaking another protocol detected. By default, LLDP packets are sent when there is a peer speaking LLDP detected or when there is no peer at all. If repeated, LLDP is disabled. ๐-rโ Receive-only mode. With this switch,lldpdwill not send any frame. It will only listen to neighbors. ๐-m managementโ Specify the management addresses of this system. As for interfaces (described below), this option can use wildcards and inversions. Without this option, the first IPv4 and the first IPv6 are used. If an exact IP address is provided, it is used as a management address without any check. If only negative patterns are provided, only one IPv4 address and one IPv6 address are chosen. Otherwise, many of them can be selected. If you want to remove IPv6 addresses, you can use!*:*. If an interface name is matched, the first IPv4 address and the first IPv6 address associated to this interface will be chosen. ๐-u fileโ Specify the Unix-domain socket used for communication withlldpctl(8). ๐ง-I interfacesโ Specify which interface to listen upon and send LLDPDU from. Without this option,lldpdwill use all available physical interfaces. This option can use wildcards. Several interfaces can be specified separated by commas. It is also possible to remove an interface by prefixing it with an exclamation mark. It is possible to allow an interface by prefixing it with two exclamation marks. An allowed interface beats a forbidden interface which beats a simple matched interface. For example, witheth*,!eth1,!eth2lldpdwill only use interfaces starting withethwith the exception ofeth1andeth2. While with*,!eth*,!!eth1lldpdwill use all interfaces, except interfaces starting withethwith the exception ofeth1. When an exact match is found, it will circumvent some tests. For example, ifeth0.12is specified, it will be accepted even if this is a VLAN interface. ๐-C interfacesโ Specify which interfaces to use for computing chassis ID. Without this option, all interfaces are considered.lldpdwill take the first MAC address from all the considered interfaces to compute the chassis ID. The logic of this option is the same as for-Iflag: you can exclude interfaces with an exclamation mark and use globbing to specify several interfaces. If all interfaces are removed (with!*), the system name is used as a chassis ID instead. ๐ฆ-M classโ Enable emission of LLDP-MED frames. Depending on the selected class, the standard defines which set of TLV should be transmitted. See section 10.2.1. Some devices may be strict in this aspect. The class should be one of the following values:1โ Generic Endpoint (Class I)2โ Media Endpoint (Class II). In this case, the standard requires to define at least one network policy vialldpcli.3โ Communication Device Endpoints (Class III). In this case, the standard requires to define at least one network policy vialldpcli.4โ Network Connectivity Device
-iโ Disable LLDP-MED inventory TLV transmission.lldpdwill still receive (and publish using SNMP if enabled) those LLDP-MED TLV but will not send them. Use this option if you don't want to transmit sensitive information like serial numbers. ๐ญ-H hideโ Filter neighbors. See section โFILTERING NEIGHBORSโ for details. ๐ซถ-L lldpcliโ Provide an alternative path tolldpclifor configuration. If empty, does not uselldpclifor configuration. ๐-O configfileโ Override default configuration locations processed bylldpcliat start. If a directory is provided, each file therein suffixed with.confwill be read. Order is alphabetical. ๐ธ-vโ Showlldpdversion. When repeated, show more build information. โญ
๐ FILTERING NEIGHBORS ๐
okay so bestie, picture this: in a heterogeneous network, you may see several different hosts on the same port, even if there is only one physically plugged into this port. For example, if you have a Nortel switch running LLDP which is plugged to a Cisco switch running CDP and your host is plugged to the Cisco switch, you will see the Nortel switch as well because LLDP frames are forwarded by the Cisco switch. This may not be what you want. The -H hide parameter allows you to tell lldpd to discard some frames that it receives and to avoid sending some other frames.
Incoming filtering and outgoing filtering are unrelated. Incoming filtering will hide some remote ports to give you a chance to know exactly what equipment is on the other side of the link. Outgoing filtering will avoid using some protocols to avoid flooding your network with a protocol that is not handled by the nearest equipment. Keep in mind that even without filtering, lldpd will speak protocols for which at least one frame has been received and LLDP otherwise (there are other options to change this behaviour, for example -cc, -ss, -ee, -ll and -ff).
When enabling incoming filtering, lldpd will try to select one protocol, and filter out neighbors using other protocols. To select this protocol, the rule is to take the less used protocol. If on one port, you get 12 CDP neighbors and 1 LLDP neighbor, this means that the remote switch speaks LLDP and does not filter CDP. Therefore, we select LLDP. When enabling outgoing filtering, lldpd will also try to select one protocol and only speak this protocol. The filtering is done per port. Each port may select a different protocol.
There are two additional criteria when enabling filtering: allowing one or several protocols to be selected (in case of a tie) and allowing one or several neighbors to be selected. Even when allowing several protocols, the rule of selecting the protocols with the fewest neighbors still applies. If lldpd selects LLDP and CDP, this means they have the same number of neighbors. The selection of the neighbor is random. Incoming filtering will select a set of neighbors to be displayed while outgoing filtering will use the selected set of neighbors to decide which protocols to use: if a selected neighbor speaks LLDP and another one CDP, lldpd will speak both CDP and LLDP on this port.
There are some corner cases. A typical example is a switch speaking two protocols (CDP and LLDP for example). You want to get the information from the best protocol but you want to speak both protocols because some tools use the CDP table and some other tools use the LLDP table. iykyk.
The table below summarizes all accepted values for the -H hide parameter. The default value is 15 which corresponds to the corner case described above. The filter column means that filtering is enabled. The 1proto column tells that only one protocol will be kept. The 1neigh column tells that only one neighbor will be kept.
Hereโs the whole tea, decoded value by value โ an em dash means that side has nothing set:
0โ incoming: โ; outgoing: โ.1โ incoming:filter,1proto; outgoing:filter,1proto.2โ incoming:filter,1proto; outgoing: โ.3โ incoming: โ; outgoing:filter,1proto.4โ incoming:filter; outgoing:filter.5โ incoming:filter; outgoing: โ.6โ incoming: โ; outgoing:filter.7โ incoming:filter,1proto,1neigh; outgoing:filter,1proto.8โ incoming:filter,1proto,1neigh; outgoing: โ.9โ incoming:filter,1neigh; outgoing:filter,1proto.10โ incoming: โ; outgoing:filter,1neigh.11โ incoming:filter,1neigh; outgoing: โ.12โ incoming:filter,1neigh; outgoing:filter,1neigh.13โ incoming:filter,1neigh; outgoing:filter.14โ incoming:filter,1proto; outgoing:filter,1neigh.15โ incoming:filter,1proto; outgoing:filter. โ the default, matching that corner case above ๐16โ incoming:filter,1proto,1neigh; outgoing:filter,1neigh.17โ incoming:filter,1proto,1neigh; outgoing:filter.18โ incoming:filter; outgoing:filter,1neigh.19โ incoming:filter; outgoing:filter,1proto.
๐ FILES ๐
/run/lldpd/lldpd.socketโ Unix-domain socket used for communication withlldpctl(8)./etc/lldpd.confโ Configuration file forlldpd. Commands in these files are executed bylldpcli(8)at start./etc/lldpd.dโ Directory containing configuration files whose commands are executed bylldpcli(8)at start.
๐ SEE ALSO ๐
๐ HISTORY ๐
The lldpd program is inspired from a preliminary work of Reyk Floeter.
๐ AUTHORS ๐
The lldpd program was written by Pierre-Yves Ritschard <pyr@openbsd.org>, and Vincent Bernat <bernat@luffy.cx>.
๐ Thatโs the LLDPD(8) page, bestie โ source/version Debian, dated August 21, 2008. Now go be iconic with your neighbors ๐
โจ
๐ฆ where this page comes from
- alpine 3.24: lldpd-doc 1.0.23-r0 ยท ISC
- Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
- Copyright (c) 2008 Vincent Bernat <bernat@luffy.cx>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms