LLDPCLI(8) | System Manager's Manual | LLDPCLI(8) |
NAME¶
lldpcli
, lldpctl
— control LLDP daemon
SYNOPSIS¶
lldpcli |
[-dv ] [-u
socket] [-f
format] [-c
file] [command ...] |
lldpctl |
[-dv ] [-u
socket] [-f
format] [interfaces ...] |
DESCRIPTION¶
The lldpcli
program controls
lldpd(8) daemon.
When no command is specified, lldpcli
will
start an interactive shell which can be used to input arbitrary commands as
if they were specified on the command line. This interactive shell should
provide completion and history support.
The options are as follows:
-d
- Enable more debugging information. This flag can be repeated.
-u
socket- Specify the Unix-domain socket used for communication with lldpd(8).
-v
- Show
lldpcli
version. When repeated, show more build information. -f
format- Choose the output format. Currently plain, xml, json, json0 and keyvalue formats are available. The default is plain. json0 is more verbose than json but the structure of the JSON object is not affected by the number of interfaces or the number of neighbors. It is therefore easier to parse.
-c
file- Read the given configuration file. This option may be repeated several
times. If a directory is provided, each file contained in it will be read
if ending by
.conf
. Order is alphabetical.
When invoked as lldpctl
,
lldpcli
will display detailed information about each
neighbors on the specified interfaces or on all interfaces if none are
specified. This command is mostly kept for backward compatibility with older
versions.
The following commands are supported by
lldpcli
. When there is no ambiguity, the keywords
can be abbreviated. For example, show neighbors ports eth0
summary
and sh neigh p eth0 sum
are the same
command.
exit
lldpcli
.help
[...]
lldpcli
was compiled without readline support but
help
command is always available.show neighbors
[ports
ethX [,...]] [details
|
summary
] [hidden
]
summary
, only
the name and the port description of each remote host will be displayed. On
the other hand, with details
, all available
information will be displayed, giving a verbose view. When using
hidden
, also display remote ports hidden by the smart
filter. When specifying one or several ports, the information displayed is
limited to the given list of ports.show interfaces
[ports
ethX [,...]] [details
|
summary
] [hidden
]
summary
, only the name and the port description of
each local interface will be displayed. On the other hand, with
details
, all available information will be displayed,
giving a verbose view. When using hidden
, also display
local ports hidden by the smart filter. When specifying one or several ports,
the information displayed is limited to the given list of ports.show chassis
[details
| summary
]
summary
, most details are skipped. On the other hand,
with details
, all available information will be
displayed, giving a verbose view.watch
[ports ethX
[,...]] [details
| summary
]
[hidden
] [limit
X]
hidden
,
summary
and details
have the
same meaning than previously described. If limit
is
specified, lldpcli
will exit after receiving the
specified number of events.show configuration
show statistics
[ports
ethX [,...]] [summary
]
summary
the statistics of each port is summed.update
configure
system
hostname
name
uname -n
. As a special value, use "." (dot)
to use the short hostname instead of a FQDN.unconfigure
system
hostname
configure
system
description
description
unconfigure
system
description
configure
system
chassisid
description
unconfigure
system
chassisid
configure
system
platform
description
unconfigure
system
platform
configure
system
interface pattern
pattern
lldpd
will use all available
physical interfaces. This option can use wildcards. Several interfaces can be
specified separated by commas. It is also possible to blacklist an interface
by suffixing it with an exclamation mark. It is possible to whitelist an
interface by suffixing it with two exclamation marks. A whitelisted interface
beats a blacklisted interfaces which beats a simple matched interface. For
example, with
eth*,!eth1,!eth2
lldpd
will only use interfaces starting by
eth with the exception of eth1 and
eth2. While
with
*,!eth*,!!eth1
lldpcli
will use all interfaces, except interfaces
starting by eth with the exception of
eth1. When an exact match is found, it will circumvent some
tests. For example, if
eth0.12
is specified, it will be accepted even if this is a VLAN interface.unconfigure
system
interface pattern
configure
system
interface permanent
pattern
lldpd
. By default,
lldpd
disregard any data about interfaces when they
are removed from the system (statistics, custom configuration). This option
allows one to specify a pattern similar to the interface pattern. If an
interface disappear but matches the pattern, its data is kept in memory and
reused if the interface reappear at some point. For example, on Linux, one
could use the pattern
eth*,eno*,enp*,
which should match fixed interfaces on most systems.unconfigure
system
interface permanent
configure
system
interface description
lldpd
to
override this description with the name of the peer neighbor if one is found
or with the number of neighbors found.unconfigure
system
interface description
configure
system
interface promiscuous
When the interface is not managed any more (or when quitting
lldpd
), the interface is left in promiscuous mode as
it is difficult to know if someone else also put the interface in
promiscuous mode.
This option is known to be useful when the remote switch is a Cisco 2960 and the local network card features VLAN hardware acceleration. In this case, you may not receive LLDP frames from the remote switch. The most plausible explanation for this is the frame is tagged with some VLAN (usually VLAN 1) and your network card is filtering VLAN. This is not the only available solution to work-around this problem. If you are concerned about performance issues, you can also tag the VLAN 1 on each interface instead.
Currently, this option has no effect on anything else than Linux. On other OS, either disable VLAN acceleration, tag VLAN 1 or enable promiscuous mode manually on the interface.
unconfigure
system
interface promiscuous
configure
system ip
management pattern
pattern
unconfigure
system ip
management pattern
configure
system
bond-slave-src-mac-type
value
Valid types are:
Default value for bond-slave-src-mac-type
is local
. Some switches may complain when using one
of the two other possible values (either because
00:00:00:00:00:00
is not a valid MAC or because the
MAC address is flapping from one port to another). Using
local might lead to a duplicate MAC address on the network
(but this is quite unlikely).
configure
lldp
agent-type
nearest-bridge
|
nearest-non-tpmr-bridge
|
nearest-customer-bridge
01:80:c2:00:00:0e
MAC address is used and limit the
propagation of the LLDPDU to the nearest bridge
(nearest-bridge
). To instruct
lldpd
to use the
01:80:c2:00:00:03
MAC address instead, use
nearest-nontpmr-bridge
instead. To use the
01:80:c2:00:00:00
MAC address instead, use
nearest-customer-bridge
instead.configure
lldp
portidsubtype
ifname
|
macaddress
configure
[ports
ethX [,...]] lldp
portidsubtype
local
value
lldpd
will use the MAC address as port identifier and
the interface name as port description, unless the interface has an alias. In
this case, the interface name will be used as port identifier and the
description will be the interface alias. With this command, you can force the
port identifier to be the interface name (with
ifname
), the MAC address (with
macaddress
) or a local value (with
value
). In the latest case, the local value should be
provided.configure
[ports
ethX [,...]] lldp
portdescription
description
configure
lldp
tx-interval
interval
configure
lldp
tx-hold
hold
configure
[ports
ethX [,...]] lldp
status
rx-and-tx |
rx-only | tx-only |
disabled
-r
flag), setting any transmit mode won't have any
effect.configure
lldp
custom-tlv
[add
|
replace
] oui
oui subtype
subtype [oui-info
content]
unconfigure
lldp
custom-tlv
[oui
oui]
[subtype
subtype]
configure med fast-start
enable
| tx-interval
interval
lldpd
to shorten the interval between two LLDPDU.
enable
should enable LLDP-MED fast start while
tx-interval
specifies the interval between two LLDPDU
in seconds. The default interval is 1 second. Once 4 LLDPDU have been sent,
the fast start mechanism is disabled until a new neighbor is detected.unconfigure med fast-start
configure
[ports
ethX [,...]] med location
coordinate
latitude
latitude longitude
longitude altitude
altitude unit
datum
datum
- WGS84
- NAD83
- NAD83/MLLW
A valid use of this command is:
configure
[ports
ethX [,...]] med location
address
country
country
[type value [...]]
- language
- country-subdivision
- county
- city
- city-division
- block
- street
- direction
- trailing-street-suffix
- street-suffix
- number
- number-suffix
- landmark
- additional
- name
- zip
- building
- unit
- floor
- room
- place-type
- script
A valid use of this command is:
configure
[ports
ethX [,...]] med location elin
number
configure
[ports
ethX [,...]] med policy
application
application
[unknown
] [tagged
]
[vlan
vlan]
[priority
priority]
[dscp
dscp]
- voice
- voice-signaling
- guest-voice
- guest-voice-signaling
- softphone-voice
- video-conferencing
- streaming-video
- video-signaling
The unknown
flag tells that the network
policy for the specified application type is required by the device but is
currently unknown. This is used by Endpoint Devices, not by Network
Connectivity Devices. If not specified, the network policy for the given
application type is defined.
When a VLAN is specified with vlan tells
which 802.1q VLAN ID has to be advertised for the network policy. A valid
value is between 1 and 4094. tagged
tells the VLAN
should be tagged for the specified application type.
priority allows one to specify IEEE 802.1d / IEEE 802.1p Layer 2 Priority, also known as Class of Service (CoS), to be used for the specified application type. This field is usually ignored if no VLAN is specified. The names match 802.1D-2004 standard (table G-2). Some more recent standards may use different labels. Only the numeric values should be relied upon. The accepted labels are:
dscp represents the DSCP value to be advertised for the given network policy. DiffServ/Differentiated Services Code Point (DSCP) value as defined in IETF RFC 2474 for the specified application type. Value: 0 (default per RFC 2475) through 63. Note: The class selector DSCP values are backwards compatible for devices that only support the old IP precedence Type of Service (ToS) format. (See the RFCs for what these values mean)
A valid use of this command is:
configure
[ports
ethX [,...]] med power pse
|
pd
source
source priority
priority value
value
- PD shall never request more power than physical 802.3af class.
- PD shall never draw more than the maximum power advertised by PSE.
- PSE shall not reduce power allocated to PD when this power is in use.
- PSE may request reduced power using conservation mode
- Being PSE or PD is a global parameter, not a per-port parameter.
lldpcli
does not enforce this: a port can be set as PD or PSE. LLDP-MED also requires for a PSE to only have one power source (primary or backup). Again,lldpcli
does not enforce this. Each port can have its own power source. The same applies for PD and power priority. LLDP-MED MIB does not allow this kind of representation.
Valid types are:
Valid sources are:
- unknown
- Unknown
- primary
- For PSE, the power source is the primary power source.
- backup
- For PSE, the power source is the backup power source or a power conservation mode is asked (the PSE may be running on UPS for example).
- pse
- For PD, the power source is the PSE.
- local
- For PD, the power source is a local source.
- both
- For PD, the power source is both the PSE and a local source.
Valid priorities are:
value should be the total power in milliwatts required by the PD device or available by the PSE device.
Here is an example of use:
configure
[ports
ethX [,...]] dot3 power pse
|
pd
[supported
]
[enabled
] [paircontrol
]
powerpairs
powerpairs
[class
class]
[type
type
source
source
priority
priority
requested
requested
allocated
allocated]
supported means that MDI power is supported on the given port while enabled means that MDI power is enabled. paircontrol is used to indicate if pair selection can be controlled. Valid values for powerpairs are:
When specified, class is a number between 0 and 4.
The remaining parameters are in conformance with 802.3at and are optional. type should be either 1 or 2, indicating which if the device conforms to 802.3at type 1 or 802.3at type 2. Values of source and priority are the same as for LLDP-MED POE-MDI TLV. requested and allocated are expressed in milliwats.
Here are two valid uses of this command:
pause
lldpd
operations.
lldpd
will not send any more frames or receive ones.
This can be undone with resume
command.resume
lldpd
operations.
lldpd
will start to send and receive frames. This
command is issued internally after processing configuration but can be used at
any time if a manual pause
command is issued.FILES¶
- /run/lldpd/lldpd.socket
- Unix-domain socket used for communication with lldpd(8).
SEE ALSO¶
AUTHORS¶
The lldpcli
program was written by
Vincent Bernat ⟨bernat@luffy.cx⟩.
July 16, 2008 | Linux 5.14.0-427.18.1.el9_4.x86_64 |