]> git.ipfire.org Git - thirdparty/lldpd.git/blame - src/client/lldpcli.8
lib: `lldpctl_k_config_receiveonly` is a read-only property
[thirdparty/lldpd.git] / src / client / lldpcli.8
CommitLineData
fe80711e
VB
1.\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
2.\" Copyright (c) 2008 Vincent Bernat <bernat@luffy.cx>
3.\"
4.\" Permission to use, copy, modify, and/or distribute this software for any
5.\" purpose with or without fee is hereby granted, provided that the above
6.\" copyright notice and this permission notice appear in all copies.
7.\"
8.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15.\"
16.Dd $Mdocdate: July 16 2008 $
17.Dt LLDPCLI 8
18.Os
19.Sh NAME
20.Nm lldpcli ,
21.Nm lldpctl
22.Nd control LLDP daemon
23.Sh SYNOPSIS
24.Nm
25.Op Fl dv
0262adbb 26.Op Fl u Ar file
fe80711e 27.Op Fl f Ar format
6402fd2c 28.Op Fl c Ar file
fe80711e
VB
29.Op Ar command ...
30.Nm lldpctl
31.Op Fl dv
0262adbb 32.Op Fl u Ar file
fe80711e
VB
33.Op Fl f Ar format
34.Op Ar interfaces ...
35.Sh DESCRIPTION
36The
37.Nm
38program controls
39.Xr lldpd 8
40daemon.
41.Pp
42When no command is specified,
43.Nm
44will start an interactive shell which can be used to input arbitrary
45commands as if they were specified on the command line. This
46interactive shell should provide completion and history support.
47.Pp
48The options are as follows:
49.Bl -tag -width Ds
50.It Fl d
51Enable more debugging information.
0262adbb
ZM
52.It Fl u
53Specify the Unix-domain socket used for communication with
54.Xr lldpd 8 .
fe80711e
VB
55.It Fl v
56Show
57.Nm
58version.
59.It Fl f Ar format
60Choose the output format. Currently
61.Em plain ,
62.Em xml ,
63.Em json
64and
65.Em keyvalue
66formats are available. The default is
67.Em plain .
6402fd2c
VB
68.It Fl c Ar file
69Read the given configuration file. This option may be repeated several
70times. If a directory is provided, each file contained in it will be
71read if ending by
72.Li .conf .
73Order is alphabetical.
fe80711e 74.El
fe80711e
VB
75.Pp
76When invoked as
77.Nm lldpctl ,
78.Nm
79will display detailed information about each neighbors on the
80specified interfaces or on all interfaces if none are specified. This
81command is mostly kept for backward compatibility with older versions.
fe80711e
VB
82.Pp
83The following commands are supported by
84.Nm .
85When there is no ambiguity, the keywords can be abbreviated. For
86example,
87.Cd show neighbors ports eth0 summary
88and
89.Cd sh neigh p eth0 sum
90are the same command.
fe80711e
VB
91.Bd -ragged -offset XX
92.Cd exit
93.Bd -ragged -offset XXXXXX
94Quit
95.Nm .
96.Ed
97
72706acd
VB
98.Cd help Op ...
99.Bd -ragged -offset XXXXXX
100Display general help or help about a command. Also, you can get help
101using the completion or by pressing the
102.Ic ?
103key. However, completion and inline help may be unavailable if
104.Nm
105was compiled without readline support but
106.Cd help
107command is always available.
108.Ed
109
fe80711e 110.Cd show neighbors
97772619 111.Op ports Ar ethX Op ,...
fe80711e
VB
112.Op Cd details | summary
113.Op Cd hidden
114.Bd -ragged -offset XXXXXX
115Display information about each neighbor known by
116.Xr lldpd 8
117daemon. With
118.Cd summary ,
119only a the name and the port description of each remote host will be
120displayed. On the other hand, with
121.Cd details ,
122all available information will be displayed, giving a verbose
123view. When using
124.Cd hidden ,
125also display remote ports hidden by the smart filter. When specifying
126one or several ports, the information displayed is limited to the
127given list of ports.
128.Ed
129
130.Cd watch
97772619 131.Op ports Ar ethX Op ,...
fe80711e
VB
132.Op Cd details | summary
133.Op Cd hidden
134.Bd -ragged -offset XXXXXX
135Watch for any neighbor changes and report them as soon as they
136happen. When specifying ports, the changes are only reported when
137happening on the given ports.
138.Cd hidden , summary
139and
140.Cd details
141have the same meaning than previously described.
142.Ed
143
144.Cd show configuration
145.Bd -ragged -offset XXXXXX
146Display global configuration of
147.Xr lldpd 8
148daemon.
149.Ed
150
885aa4f4
VB
151.Cd show statistics
152.Op ports Ar ethX Op ,...
153.Op Cd summary
154.Bd -ragged -offset XXXXXX
155Report LLDP-related statistics, like the number of LLDPDU transmitted,
156received, discarded or unrecognized. When specifying ports, only the
157statistics from the given port are reported. With
158.Cd summary
159the statistics of each port is summed.
160.Ed
161
fe80711e
VB
162.Cd update
163.Bd -ragged -offset XXXXXX
164Make
165.Xr lldpd 8
166update its information and send new LLDP PDU on all interfaces.
167.Ed
168
decaec0d
VB
169.Cd configure
170.Cd system description Ar description
171.Bd -ragged -offset XXXXXX
172Override chassis description with the provided value instead of using
173kernel name, node name, kernel version, build date and architecture.
174.Ed
175
3f70e118
VB
176.Cd configure
177.Cd system platform Ar description
178.Bd -ragged -offset XXXXXX
179Override platform description with the provided value instead of using
180kernel name. This value is currently only used for CDP.
181.Ed
182
f88442ac 183.Cd configure
48d0a4b0 184.Cd system interface pattern Ar pattern
0093777b 185.Bd -ragged -offset XXXXXX
48d0a4b0 186Set the pattern of valid interfaces to use. When not set,
0093777b
VB
187.Nm lldpd
188will listen on all available interfaces. This option can use
189wildcards. Several interfaces can be specified separated by commas.
190It is also possible to blacklist an interface by suffixing it with an
191exclamation mark. When an interface is both specified with and without
192an exclamation mark, it is blacklisted. For example, with
193.Em eth*,!eth1,!eth2
194.Nm lldpd
195will only listen to interfaces starting by
196.Em eth
197with the exception of
198.Em eth1
199and
200.Em eth2 .
201.Ed
202
48d0a4b0
VB
203.Cd configure
204.Cd lldp tx-interval Ar interval
205.Bd -ragged -offset XXXXXX
206Change transmit delay to the specified value in seconds. The transmit
207delay is the delay between two transmissions of LLDP PDU. The default
208value is 30 seconds.
209.Ed
210
211.Cd configure
212.Cd lldp tx-hold Ar hold
213.Bd -ragged -offset XXXXXX
214Change transmit hold value to the specified value. This value is used
215to compute the TTL of transmitted packets which is the product of this
216value and of the transmit delay. The default value is 4 and therefore
217the default TTL is 120 seconds.
218.Ed
219
486a6133
VB
220.Cd configure med fast-start
221.Cd enable | tx-interval Ar interval
222.Bd -ragged -offset XXXXXX
223Configure LLDP-MED fast start mechanism. When a new LLDP-MED-enabled
224neighbor is detected, fast start allows
225.Nm lldpd
226to shorten the interval between two LLDPDU.
227.Cd enable
228should enable LLDP-MED fast start while
229.Cd tx-interval
230specifies the interval between two LLDPDU in seconds. The default
231interval is 1 second. Once 4 LLDPDU have been sent, the fast start
232mechanism is disabled until a new neighbor is detected.
233.Ed
234
235.Cd unconfigure med fast-start
236.Bd -ragged -offset XXXXXX
237Disable LLDP-MED fast start mechanism.
238.Ed
239
fe80711e 240.Cd configure
97772619 241.Op ports Ar ethX Op ,...
fe80711e
VB
242.Cd med location coordinate
243.Cd latitude Ar latitude
244.Cd longitude Ar longitude
245.Cd altitude Ar altitude Ar unit
246.Cd datum Ar datum
247.Bd -ragged -offset XXXXXX
248Advertise a coordinate based location on the given ports (or on all
249ports if no port is specified). The format of
250.Ar latitude
251is a decimal floating point number followed either by
252.Em N
253or
254.Em S .
255The format of
256.Ar longitude
257is a decimal floating point number followed either by
258.Em E
259or
260.Em W .
261.Ar altitude
262is a decimal floating point number followed either by
263.Em m
264when expressed in meters or
265.Em f
3fc1a10a
VB
266when expressed in floors. A space is expected between the floating
267point number and the unit.
fe80711e
VB
268.Ar datum
269is one of those values:
270.Bl -bullet -compact -offset XXXXXXXX
271.It
272WGS84
273.It
274NAD83
275.It
276NAD83/MLLW
277.El
278.Pp
279A valid use of this command is:
3fc1a10a 280.D1 configure ports eth0 med location coordinate latitude 48.85667N longitude 2.2014E altitude 117.47 m datum WGS84
fe80711e
VB
281.Ed
282
283.Cd configure
97772619 284.Op ports Ar ethX Op ,...
fe80711e
VB
285.Cd med location address
286.Cd country Ar country
287.Cd Op Ar type value Op ...
288.Bd -ragged -offset XXXXXX
289Advertise a civic address on the given ports (or on all ports if no
290port is specified).
291.Ar country
292is the two-letter code representing the country. The remaining
293arguments should be paired to form the address. The first member of
294each pair indicates the type of the second member which is a free-form
295text. Here is the list of valid types:
296.Bl -bullet -compact -offset XXXXXXXX
297.It
298language
299.It
300country-subdivision
301.It
302county
303.It
304city
305.It
306city-division
307.It
308block
309.It
310street
311.It
312direction
313.It
314trailing-street-suffix
315.It
316street-suffix
317.It
318number
319.It
320number-suffix
321.It
322landmark
323.It
324additional
325.It
326name
327.It
328zip
329.It
330building
331.It
332unit
333.It
334floor
335.It
336room
337.It
338place-type
339.It
340script
341.El
342.Pp
343A valid use of this command is:
344.D1 configure ports eth1 med location address US street Qo Commercial Road Qc city Qo Roseville Qc
345.Ed
346
347.Cd configure
97772619 348.Op ports Ar ethX Op ,...
fe80711e
VB
349.Cd med location elin
350.Ar number
351.Bd -ragged -offset XXXXXX
352Advertise the availability of an ELIN number. This is used for setting
353up emergency call. If the provided number is too small, it will be
354padded with 0. Here is an example of use:
355.D1 configure ports eth2 med location elin 911
356.Ed
357
358.Cd configure
97772619 359.Op ports Ar ethX Op ,...
fe80711e
VB
360.Cd med policy
361.Cd application Ar application
362.Op Cd unknown
363.Op Cd vlan Ar vlan
364.Op Cd priority Ar priority
365.Op Cd dscp Ar dscp
366.Bd -ragged -offset XXXXXX
367Advertise a specific network policy for the given ports (or for all
368ports if no port was provided). Only the application type is
369mandatory.
370.Ar application
371should be one of the following values:
372static const struct value_string port_med_policy_map[] = {
373.Bl -bullet -compact -offset XXXXXXXX
374.It
375voice
376.It
377voice-signaling
378.It
379guest-voice
380.It
381guest-voice-signaling
382.It
383softphone-voice
384.It
385video-conferencing
386.It
387streaming-video
388.It
389video-signaling
390.El
391.Pp
392The
393.Cd unknown
394flag tells that the network policy for the specified application type
395is required by the device but is currently unknown. This is used by
396Endpoint Devices, not by Network Connectivity Devices. If not
397specified, the network policy for the given application type is
398defined.
399.Pp
400When a VLAN is specified with
401.Cd vlan
402tells which 802.1q VLAN ID has to be advertised for the network
403policy. A valid value is between 1 and 4094.
404.Cd priority
405allows one to specify IEEE 802.1d / IEEE 802.1p Layer 2 Priority, also
406known as Class of Service (CoS), to be used for the specified
407application type. It should be one of those values:
408.Bl -bullet -compact -offset XXXXXXXX
409.It
410background
411.It
412spare
413.It
414best-effort
415.It
416excellent-effort
417.It
418controlled-load
419.It
420video
421.It
422voice
423.It
424network-control
425.El
426.Pp
427.Ar dscp
428represents the DSCP value to be advertised for the given network
429policy. DiffServ/Differentiated Services Code Point (DSCP) value as
430defined in IETF RFC 2474 for the specified application type. Value: 0
431(default per RFC 2475) through 63. Note: The class selector DSCP
432values are backwards compatible for devices that only support the old
433IP precedence Type of Service (ToS) format. (See the RFCs for what
434these values mean)
435.Pp
436A valid use of this command is:
437.D1 configure med policy application voice vlan 500 priority voice dscp 46
438.Ed
439
440.Cd configure
97772619 441.Op ports Ar ethX Op ,...
fe80711e
VB
442.Cd med power pse | pd
443.Cd source Ar source
444.Cd priority Ar priority
445.Cd value Ar value
446.Bd -ragged -offset XXXXXX
447Advertise the LLDP-MED POE-MDI TLV for the given ports or for all
448interfaces if no port is provided. One can act as a PD (power
449consumer) or a PSE (power provider). No check is done on the validity
450of the parameters while LLDP-MED requires some restrictions:
451.Bl -bullet
452.It
453PD shall never request more power than physical 802.3af class.
454.It
455PD shall never draw more than the maximum power advertised by PSE.
456.It
457PSE shall not reduce power allocated to PD when this power is in use.
458.It
459PSE may request reduced power using conservation mode
460.It
461Being PSE or PD is a global paremeter, not a per-port parameter.
462.Nm
463does not enforce this: a port can be set as PD or PSE. LLDP-MED also
464requires for a PSE to only have one power source (primary or
465backup). Again,
466.Nm
467does not enforce this. Each port can have its own power source. The
468same applies for PD and power priority. LLDP-MED MIB does not allow
469this kind of representation.
470.El
471.Pp
472Valid types are:
473.Bl -tag -width "XXX." -compact -offset XX
474.It Sy pse
475Power Sourcing Entity (power provider)
476.It Sy pd
477Power Device (power consumer)
478.El
479.Pp
480Valid sources are:
481.Bl -tag -width "XXXXXXX" -compact -offset XX
482.It Sy unknown
483Unknown
484.It Sy primary
485For PSE, the power source is the primary power source.
486.It Sy backup
487For PSE, the power source is the backup power source or a power
488conservation mode is asked (the PSE may be running on UPS for
489example).
490.It Sy pse
491For PD, the power source is the PSE.
492.It Sy local
493For PD, the power source is a local source.
494.It Sy both
495For PD, the power source is both the PSE and a local source.
496.El
497.Pp
498Valid priorities are:
499.Bl -tag -width "XXXXXXXXX" -compact -offset XX
500.It Sy unknown
501Unknown priority
502.It Sy critical
503Critical
504.It Sy high
505High
506.It Sy low
507Low
508.El
509.Pp
510.Ar value
511should be the total power in milliwatts required by the PD device or
512available by the PSE device.
513.Pp
514Here is an example of use:
515.D1 configure med power pd source pse priority high value 5000
516.Ed
517
518.Cd configure
97772619 519.Op ports Ar ethX Op ,...
fe80711e
VB
520.Cd dot3 power pse | pd
521.Op Cd supported
522.Op Cd enabled
523.Op Cd paircontrol
524.Cd powerpairs Ar powerpairs
525.Op Cd class Ar class
526.Op Cd type Ar type Cd source Ar source Cd priority Ar priority Cd requested Ar requested Cd allocated Ar allocated
527.Bd -ragged -offset XXXXXX
528Advertise Dot3 POE-MDI TLV for the given port or for all ports if none
529was provided. One can act as a PD (power consumer) or a PSE (power
530provider). This configuration is distinct of the configuration of the
531transmission of the LLDP-MED POE-MDI TLV but the user should ensure
532the coherency of those two configurations if they are used together.
533.Pp
534.Ar supported
535means that MDI power is supported on the given port while
536.Ar enabled
537means that MDI power is enabled.
538.Ar paircontrol
539is used to indicate if pair selection can be controlled. Valid values
540forr
541.Ar powerpairs
542are:
543.Bl -tag -width "XXXXXX" -compact -offset XX
544.It Sy signal
545The signal pairs only are in use.
546.It Sy spare
547The spare pairs only are in use.
548.El
549.Pp
550When specified,
551.Ar class
552is a number between 0 and 4.
553.Pp
554The remaining parameters are in conformance with 802.3at and are optional.
555.Ar type
556should be either 1 or 2, indicating which if the device conforms to
557802.3at type 1 or 802.3at type 2. Values ofr
558.Ar source
559and
560.Ar priority
561are the same as for LLDP-MED POE-MDI TLV.
562.Ar requested
563and
564.Ar allocated
565are expressed in milliwats.
566.Pp
567Here are two valid uses of this command:
568.D1 configure ports eth3 dot3 power pse supported enabled paircontrol powerpairs spare class 3
569.D1 configure dot3 power pd supported enabled powerpairs spare class 3 type 1 source pse priority low requested 10000 allocated 15000
570.Ed
571
e4ff3ed5
VB
572.Cd pause
573.Bd -ragged -offset XXXXXX
574Pause
575.Nm lldpd
576operations.
577.Nm lldpd
578will not send any more frames or receive ones. This can be undone with
579.Cd resume
580command.
581.Ed
582
583.Cd resume
584.Bd -ragged -offset XXXXXX
585Resume
586.Nm lldpd
587operations.
588.Nm lldpd
589will start to send and receive frames. This command is issued
590internally after processing configuration but can be used at any time
591if a manual
592.Cd pause
593command is issued.
594.Ed
595
fe80711e
VB
596.Ed
597.Sh FILES
598.Bl -tag -width "/var/run/lldpd.socketXX" -compact
599.It /var/run/lldpd.socket
600Unix-domain socket used for communication with
601.Xr lldpd 8 .
602.El
603.Sh SEE ALSO
604.Xr lldpd 8
605.Sh AUTHORS
606.An -nosplit
607The
608.Nm
609program was written by
610.An Vincent Bernat Aq bernat@luffy.cx .