]> git.ipfire.org Git - thirdparty/lldpd.git/blame - src/client/lldpcli.8
configure: make default PID location configurable
[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
17a90fc0
VB
169.Cd configure
170.Cd system hostname Ar name
171.Bd -ragged -offset XXXXXX
172Override system hostname with the provided value. By default, the
173system name is found from the resolved value of
174.Ic uname -n .
175.Ed
176
decaec0d
VB
177.Cd configure
178.Cd system description Ar description
179.Bd -ragged -offset XXXXXX
180Override chassis description with the provided value instead of using
181kernel name, node name, kernel version, build date and architecture.
182.Ed
183
3f70e118
VB
184.Cd configure
185.Cd system platform Ar description
186.Bd -ragged -offset XXXXXX
187Override platform description with the provided value instead of using
188kernel name. This value is currently only used for CDP.
189.Ed
190
f88442ac 191.Cd configure
48d0a4b0 192.Cd system interface pattern Ar pattern
0093777b 193.Bd -ragged -offset XXXXXX
48d0a4b0 194Set the pattern of valid interfaces to use. When not set,
0093777b
VB
195.Nm lldpd
196will listen on all available interfaces. This option can use
197wildcards. Several interfaces can be specified separated by commas.
198It is also possible to blacklist an interface by suffixing it with an
199exclamation mark. When an interface is both specified with and without
200an exclamation mark, it is blacklisted. For example, with
201.Em eth*,!eth1,!eth2
202.Nm lldpd
203will only listen to interfaces starting by
204.Em eth
205with the exception of
206.Em eth1
207and
208.Em eth2 .
209.Ed
210
bb37268d
VB
211.Cd configure
212.Cd system interface description
213.Bd -ragged -offset XXXXXX
214Some OS allows the user to set a description for an interface. Setting
215this option will enable
216.Nm lldpd
217to override this description with the name of the peer neighbor if one
218is found or with the number of neighbors found.
219.Ed
220
48d0a4b0
VB
221.Cd configure
222.Cd lldp tx-interval Ar interval
223.Bd -ragged -offset XXXXXX
224Change transmit delay to the specified value in seconds. The transmit
225delay is the delay between two transmissions of LLDP PDU. The default
226value is 30 seconds.
227.Ed
228
229.Cd configure
230.Cd lldp tx-hold Ar hold
231.Bd -ragged -offset XXXXXX
232Change transmit hold value to the specified value. This value is used
233to compute the TTL of transmitted packets which is the product of this
234value and of the transmit delay. The default value is 4 and therefore
235the default TTL is 120 seconds.
236.Ed
237
dfbd7185
RP
238.Cd configure
239.Cd system bond-slave-src-mac-type Ar value
240.Bd -ragged -offset XXXXXX
241Set the type of src mac in lldp frames sent on bond slaves
242
243Valid types are:
244.Bl -tag -width "XXX." -compact -offset XX
245.It Sy real
246Slave real mac
247.It Sy zero
248All zero mac
2746d430
VB
249.It Sy fixed
250An arbitrary fixed value (from a 3Com card)
dfbd7185
RP
251.It Sy local
252Real mac with locally administered bit set. If the real mac already
2746d430 253has the locally administered bit set, default to the fixed value.
dfbd7185
RP
254.El
255.Pp
256Default value for
257.Nm bond-slave-src-mac-type
258is
2746d430 259.Nm fixed
dfbd7185
RP
260.Ed
261
486a6133
VB
262.Cd configure med fast-start
263.Cd enable | tx-interval Ar interval
264.Bd -ragged -offset XXXXXX
265Configure LLDP-MED fast start mechanism. When a new LLDP-MED-enabled
266neighbor is detected, fast start allows
267.Nm lldpd
268to shorten the interval between two LLDPDU.
269.Cd enable
270should enable LLDP-MED fast start while
271.Cd tx-interval
272specifies the interval between two LLDPDU in seconds. The default
273interval is 1 second. Once 4 LLDPDU have been sent, the fast start
274mechanism is disabled until a new neighbor is detected.
275.Ed
276
277.Cd unconfigure med fast-start
278.Bd -ragged -offset XXXXXX
279Disable LLDP-MED fast start mechanism.
280.Ed
281
fe80711e 282.Cd configure
97772619 283.Op ports Ar ethX Op ,...
fe80711e
VB
284.Cd med location coordinate
285.Cd latitude Ar latitude
286.Cd longitude Ar longitude
287.Cd altitude Ar altitude Ar unit
288.Cd datum Ar datum
289.Bd -ragged -offset XXXXXX
290Advertise a coordinate based location on the given ports (or on all
291ports if no port is specified). The format of
292.Ar latitude
293is a decimal floating point number followed either by
294.Em N
295or
296.Em S .
297The format of
298.Ar longitude
299is a decimal floating point number followed either by
300.Em E
301or
302.Em W .
303.Ar altitude
304is a decimal floating point number followed either by
305.Em m
306when expressed in meters or
307.Em f
3fc1a10a
VB
308when expressed in floors. A space is expected between the floating
309point number and the unit.
fe80711e
VB
310.Ar datum
311is one of those values:
312.Bl -bullet -compact -offset XXXXXXXX
313.It
314WGS84
315.It
316NAD83
317.It
318NAD83/MLLW
319.El
320.Pp
321A valid use of this command is:
3fc1a10a 322.D1 configure ports eth0 med location coordinate latitude 48.85667N longitude 2.2014E altitude 117.47 m datum WGS84
fe80711e
VB
323.Ed
324
325.Cd configure
97772619 326.Op ports Ar ethX Op ,...
fe80711e
VB
327.Cd med location address
328.Cd country Ar country
329.Cd Op Ar type value Op ...
330.Bd -ragged -offset XXXXXX
331Advertise a civic address on the given ports (or on all ports if no
332port is specified).
333.Ar country
334is the two-letter code representing the country. The remaining
335arguments should be paired to form the address. The first member of
336each pair indicates the type of the second member which is a free-form
337text. Here is the list of valid types:
338.Bl -bullet -compact -offset XXXXXXXX
339.It
340language
341.It
342country-subdivision
343.It
344county
345.It
346city
347.It
348city-division
349.It
350block
351.It
352street
353.It
354direction
355.It
356trailing-street-suffix
357.It
358street-suffix
359.It
360number
361.It
362number-suffix
363.It
364landmark
365.It
366additional
367.It
368name
369.It
370zip
371.It
372building
373.It
374unit
375.It
376floor
377.It
378room
379.It
380place-type
381.It
382script
383.El
384.Pp
385A valid use of this command is:
386.D1 configure ports eth1 med location address US street Qo Commercial Road Qc city Qo Roseville Qc
387.Ed
388
389.Cd configure
97772619 390.Op ports Ar ethX Op ,...
fe80711e
VB
391.Cd med location elin
392.Ar number
393.Bd -ragged -offset XXXXXX
394Advertise the availability of an ELIN number. This is used for setting
395up emergency call. If the provided number is too small, it will be
396padded with 0. Here is an example of use:
397.D1 configure ports eth2 med location elin 911
398.Ed
399
400.Cd configure
97772619 401.Op ports Ar ethX Op ,...
fe80711e
VB
402.Cd med policy
403.Cd application Ar application
404.Op Cd unknown
405.Op Cd vlan Ar vlan
406.Op Cd priority Ar priority
407.Op Cd dscp Ar dscp
408.Bd -ragged -offset XXXXXX
409Advertise a specific network policy for the given ports (or for all
410ports if no port was provided). Only the application type is
411mandatory.
412.Ar application
413should be one of the following values:
414static const struct value_string port_med_policy_map[] = {
415.Bl -bullet -compact -offset XXXXXXXX
416.It
417voice
418.It
419voice-signaling
420.It
421guest-voice
422.It
423guest-voice-signaling
424.It
425softphone-voice
426.It
427video-conferencing
428.It
429streaming-video
430.It
431video-signaling
432.El
433.Pp
434The
435.Cd unknown
436flag tells that the network policy for the specified application type
437is required by the device but is currently unknown. This is used by
438Endpoint Devices, not by Network Connectivity Devices. If not
439specified, the network policy for the given application type is
440defined.
441.Pp
442When a VLAN is specified with
443.Cd vlan
444tells which 802.1q VLAN ID has to be advertised for the network
445policy. A valid value is between 1 and 4094.
446.Cd priority
447allows one to specify IEEE 802.1d / IEEE 802.1p Layer 2 Priority, also
448known as Class of Service (CoS), to be used for the specified
449application type. It should be one of those values:
450.Bl -bullet -compact -offset XXXXXXXX
451.It
452background
453.It
454spare
455.It
456best-effort
457.It
458excellent-effort
459.It
460controlled-load
461.It
462video
463.It
464voice
465.It
466network-control
467.El
468.Pp
469.Ar dscp
470represents the DSCP value to be advertised for the given network
471policy. DiffServ/Differentiated Services Code Point (DSCP) value as
472defined in IETF RFC 2474 for the specified application type. Value: 0
473(default per RFC 2475) through 63. Note: The class selector DSCP
474values are backwards compatible for devices that only support the old
475IP precedence Type of Service (ToS) format. (See the RFCs for what
476these values mean)
477.Pp
478A valid use of this command is:
479.D1 configure med policy application voice vlan 500 priority voice dscp 46
480.Ed
481
482.Cd configure
97772619 483.Op ports Ar ethX Op ,...
fe80711e
VB
484.Cd med power pse | pd
485.Cd source Ar source
486.Cd priority Ar priority
487.Cd value Ar value
488.Bd -ragged -offset XXXXXX
489Advertise the LLDP-MED POE-MDI TLV for the given ports or for all
490interfaces if no port is provided. One can act as a PD (power
491consumer) or a PSE (power provider). No check is done on the validity
492of the parameters while LLDP-MED requires some restrictions:
493.Bl -bullet
494.It
495PD shall never request more power than physical 802.3af class.
496.It
497PD shall never draw more than the maximum power advertised by PSE.
498.It
499PSE shall not reduce power allocated to PD when this power is in use.
500.It
501PSE may request reduced power using conservation mode
502.It
503Being PSE or PD is a global paremeter, not a per-port parameter.
504.Nm
505does not enforce this: a port can be set as PD or PSE. LLDP-MED also
506requires for a PSE to only have one power source (primary or
507backup). Again,
508.Nm
509does not enforce this. Each port can have its own power source. The
510same applies for PD and power priority. LLDP-MED MIB does not allow
511this kind of representation.
512.El
513.Pp
514Valid types are:
515.Bl -tag -width "XXX." -compact -offset XX
516.It Sy pse
517Power Sourcing Entity (power provider)
518.It Sy pd
519Power Device (power consumer)
520.El
521.Pp
522Valid sources are:
523.Bl -tag -width "XXXXXXX" -compact -offset XX
524.It Sy unknown
525Unknown
526.It Sy primary
527For PSE, the power source is the primary power source.
528.It Sy backup
529For PSE, the power source is the backup power source or a power
530conservation mode is asked (the PSE may be running on UPS for
531example).
532.It Sy pse
533For PD, the power source is the PSE.
534.It Sy local
535For PD, the power source is a local source.
536.It Sy both
537For PD, the power source is both the PSE and a local source.
538.El
539.Pp
540Valid priorities are:
541.Bl -tag -width "XXXXXXXXX" -compact -offset XX
542.It Sy unknown
543Unknown priority
544.It Sy critical
545Critical
546.It Sy high
547High
548.It Sy low
549Low
550.El
551.Pp
552.Ar value
553should be the total power in milliwatts required by the PD device or
554available by the PSE device.
555.Pp
556Here is an example of use:
557.D1 configure med power pd source pse priority high value 5000
558.Ed
559
560.Cd configure
97772619 561.Op ports Ar ethX Op ,...
fe80711e
VB
562.Cd dot3 power pse | pd
563.Op Cd supported
564.Op Cd enabled
565.Op Cd paircontrol
566.Cd powerpairs Ar powerpairs
567.Op Cd class Ar class
568.Op Cd type Ar type Cd source Ar source Cd priority Ar priority Cd requested Ar requested Cd allocated Ar allocated
569.Bd -ragged -offset XXXXXX
570Advertise Dot3 POE-MDI TLV for the given port or for all ports if none
571was provided. One can act as a PD (power consumer) or a PSE (power
572provider). This configuration is distinct of the configuration of the
573transmission of the LLDP-MED POE-MDI TLV but the user should ensure
574the coherency of those two configurations if they are used together.
575.Pp
576.Ar supported
577means that MDI power is supported on the given port while
578.Ar enabled
579means that MDI power is enabled.
580.Ar paircontrol
581is used to indicate if pair selection can be controlled. Valid values
582forr
583.Ar powerpairs
584are:
585.Bl -tag -width "XXXXXX" -compact -offset XX
586.It Sy signal
587The signal pairs only are in use.
588.It Sy spare
589The spare pairs only are in use.
590.El
591.Pp
592When specified,
593.Ar class
594is a number between 0 and 4.
595.Pp
596The remaining parameters are in conformance with 802.3at and are optional.
597.Ar type
598should be either 1 or 2, indicating which if the device conforms to
599802.3at type 1 or 802.3at type 2. Values ofr
600.Ar source
601and
602.Ar priority
603are the same as for LLDP-MED POE-MDI TLV.
604.Ar requested
605and
606.Ar allocated
607are expressed in milliwats.
608.Pp
609Here are two valid uses of this command:
610.D1 configure ports eth3 dot3 power pse supported enabled paircontrol powerpairs spare class 3
611.D1 configure dot3 power pd supported enabled powerpairs spare class 3 type 1 source pse priority low requested 10000 allocated 15000
612.Ed
613
e4ff3ed5
VB
614.Cd pause
615.Bd -ragged -offset XXXXXX
616Pause
617.Nm lldpd
618operations.
619.Nm lldpd
620will not send any more frames or receive ones. This can be undone with
621.Cd resume
622command.
623.Ed
624
625.Cd resume
626.Bd -ragged -offset XXXXXX
627Resume
628.Nm lldpd
629operations.
630.Nm lldpd
631will start to send and receive frames. This command is issued
632internally after processing configuration but can be used at any time
633if a manual
634.Cd pause
635command is issued.
636.Ed
637
fe80711e
VB
638.Ed
639.Sh FILES
640.Bl -tag -width "/var/run/lldpd.socketXX" -compact
641.It /var/run/lldpd.socket
642Unix-domain socket used for communication with
643.Xr lldpd 8 .
644.El
645.Sh SEE ALSO
646.Xr lldpd 8
647.Sh AUTHORS
648.An -nosplit
649The
650.Nm
651program was written by
652.An Vincent Bernat Aq bernat@luffy.cx .