]> git.ipfire.org Git - thirdparty/lldpd.git/blame - src/client/lldpcli.8.in
lldpcli: add display filter to show nbrs running specific protocols
[thirdparty/lldpd.git] / src / client / lldpcli.8.in
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
f84199dd
VB
221.Cd configure
222.Cd system interface promiscuous
223.Bd -ragged -offset XXXXXX
0a6f3866 224Enable promiscuous mode on managed interfaces.
f84199dd
VB
225.Pp
226When the interface is not managed any more (or when quitting
227.Nm ) ,
228the interface is left in promiscuous mode as it is difficult to know
229if someone else also put the interface in promiscuous mode.
230.Pp
231This option is known to be useful when the remote switch is a Cisco
0a6f3866
VB
2322960 and the local network card features VLAN hardware
233acceleration. In this case, you may not receive LLDP frames from the
234remote switch. The most plausible explanation for this is the frame is
235tagged with some VLAN (usually VLAN 1) and your network card is
236filtering VLAN. This is not the only available solution to work-around
237this problem. If you are concerned about performance issues, you can
238also tag the VLAN 1 on each interface instead.
239.Pp
240Currently, this option has no effect on anything else than Linux. On
241other OS, either disable VLAN acceleration, tag VLAN 1 or enable
242promiscuous mode manually on the interface.
f84199dd
VB
243.Ed
244
245.Cd unconfigure
246.Cd system interface promiscuous
247.Bd -ragged -offset XXXXXX
248Do not set promiscuous mode on managed interfaces. This option does
249not disable promiscuous mode on interfaces already using this mode.
250.Ed
251
622d14bb
VB
252.Cd configure
253.Cd system ip management pattern Ar pattern
254.Bd -ragged -offset XXXXXX
255Specify the management addresses of this system. As for interfaces
256(described above), this option can use wildcards and inversions.
257Without this option, the first IPv4 and the first IPv6 are used. If
258only negative patterns are provided, only one IPv4 and one IPv6
259addresses are chosen. Otherwise, many of them can be selected. If you
260want to blacklist IPv6 addresses, you can use
261.Em !*:* .
262.Ed
263
bef085b8
VB
264.Cd configure
265.Cd portidsubtype ifname
266.Cd ifname | macaddress
267.Bd -ragged -offset XXXXXX
268Force port ID subtype. By default,
269.Nm
270will use the MAC address as port identifier and the interface name as
271port description, unless the interface has an alias. In this case, the
272interface name will be used as port identifier and the description
273will be the interface alias. With this command, you can force the port
274identifier to be the interface name (with
275.Cd ifname )
276or the MAC address (with
277.Cd macaddress ) .
278.Ed
279
48d0a4b0
VB
280.Cd configure
281.Cd lldp tx-interval Ar interval
282.Bd -ragged -offset XXXXXX
283Change transmit delay to the specified value in seconds. The transmit
284delay is the delay between two transmissions of LLDP PDU. The default
285value is 30 seconds.
286.Ed
287
288.Cd configure
289.Cd lldp tx-hold Ar hold
290.Bd -ragged -offset XXXXXX
291Change transmit hold value to the specified value. This value is used
292to compute the TTL of transmitted packets which is the product of this
293value and of the transmit delay. The default value is 4 and therefore
294the default TTL is 120 seconds.
295.Ed
296
dfbd7185
RP
297.Cd configure
298.Cd system bond-slave-src-mac-type Ar value
299.Bd -ragged -offset XXXXXX
300Set the type of src mac in lldp frames sent on bond slaves
301
302Valid types are:
303.Bl -tag -width "XXX." -compact -offset XX
304.It Sy real
305Slave real mac
306.It Sy zero
307All zero mac
2746d430 308.It Sy fixed
8229c8eb
VB
309An arbitrary fixed value
310.Li ( 00:60:08:69:97:ef )
dfbd7185
RP
311.It Sy local
312Real mac with locally administered bit set. If the real mac already
0e29d794 313has the locally administered bit set, fallback to the fixed value.
dfbd7185
RP
314.El
315.Pp
316Default value for
317.Nm bond-slave-src-mac-type
318is
0e29d794
VB
319.Nm local .
320Some switches may complain when using one of the two other possible
321values (either because
322.Li 00:00:00:00:00:00
323is not a valid MAC or because the MAC address is flapping from one
324port to another). Using
8229c8eb 325.Sy local
0e29d794
VB
326might lead to a duplicate MAC address on the network (but this is
327quite unlikely).
dfbd7185
RP
328.Ed
329
486a6133
VB
330.Cd configure med fast-start
331.Cd enable | tx-interval Ar interval
332.Bd -ragged -offset XXXXXX
333Configure LLDP-MED fast start mechanism. When a new LLDP-MED-enabled
334neighbor is detected, fast start allows
335.Nm lldpd
336to shorten the interval between two LLDPDU.
337.Cd enable
338should enable LLDP-MED fast start while
339.Cd tx-interval
340specifies the interval between two LLDPDU in seconds. The default
341interval is 1 second. Once 4 LLDPDU have been sent, the fast start
342mechanism is disabled until a new neighbor is detected.
343.Ed
344
345.Cd unconfigure med fast-start
346.Bd -ragged -offset XXXXXX
347Disable LLDP-MED fast start mechanism.
348.Ed
349
fe80711e 350.Cd configure
97772619 351.Op ports Ar ethX Op ,...
fe80711e
VB
352.Cd med location coordinate
353.Cd latitude Ar latitude
354.Cd longitude Ar longitude
355.Cd altitude Ar altitude Ar unit
356.Cd datum Ar datum
357.Bd -ragged -offset XXXXXX
358Advertise a coordinate based location on the given ports (or on all
359ports if no port is specified). The format of
360.Ar latitude
361is a decimal floating point number followed either by
362.Em N
363or
364.Em S .
365The format of
366.Ar longitude
367is a decimal floating point number followed either by
368.Em E
369or
370.Em W .
371.Ar altitude
372is a decimal floating point number followed either by
373.Em m
374when expressed in meters or
375.Em f
3fc1a10a
VB
376when expressed in floors. A space is expected between the floating
377point number and the unit.
fe80711e
VB
378.Ar datum
379is one of those values:
380.Bl -bullet -compact -offset XXXXXXXX
381.It
382WGS84
383.It
384NAD83
385.It
386NAD83/MLLW
387.El
388.Pp
389A valid use of this command is:
3fc1a10a 390.D1 configure ports eth0 med location coordinate latitude 48.85667N longitude 2.2014E altitude 117.47 m datum WGS84
fe80711e
VB
391.Ed
392
393.Cd configure
97772619 394.Op ports Ar ethX Op ,...
fe80711e
VB
395.Cd med location address
396.Cd country Ar country
397.Cd Op Ar type value Op ...
398.Bd -ragged -offset XXXXXX
399Advertise a civic address on the given ports (or on all ports if no
400port is specified).
401.Ar country
402is the two-letter code representing the country. The remaining
403arguments should be paired to form the address. The first member of
404each pair indicates the type of the second member which is a free-form
405text. Here is the list of valid types:
406.Bl -bullet -compact -offset XXXXXXXX
407.It
408language
409.It
410country-subdivision
411.It
412county
413.It
414city
415.It
416city-division
417.It
418block
419.It
420street
421.It
422direction
423.It
424trailing-street-suffix
425.It
426street-suffix
427.It
428number
429.It
430number-suffix
431.It
432landmark
433.It
434additional
435.It
436name
437.It
438zip
439.It
440building
441.It
442unit
443.It
444floor
445.It
446room
447.It
448place-type
449.It
450script
451.El
452.Pp
453A valid use of this command is:
454.D1 configure ports eth1 med location address US street Qo Commercial Road Qc city Qo Roseville Qc
455.Ed
456
457.Cd configure
97772619 458.Op ports Ar ethX Op ,...
fe80711e
VB
459.Cd med location elin
460.Ar number
461.Bd -ragged -offset XXXXXX
462Advertise the availability of an ELIN number. This is used for setting
463up emergency call. If the provided number is too small, it will be
464padded with 0. Here is an example of use:
465.D1 configure ports eth2 med location elin 911
466.Ed
467
468.Cd configure
97772619 469.Op ports Ar ethX Op ,...
fe80711e
VB
470.Cd med policy
471.Cd application Ar application
472.Op Cd unknown
473.Op Cd vlan Ar vlan
474.Op Cd priority Ar priority
475.Op Cd dscp Ar dscp
476.Bd -ragged -offset XXXXXX
477Advertise a specific network policy for the given ports (or for all
478ports if no port was provided). Only the application type is
479mandatory.
480.Ar application
481should be one of the following values:
482static const struct value_string port_med_policy_map[] = {
483.Bl -bullet -compact -offset XXXXXXXX
484.It
485voice
486.It
487voice-signaling
488.It
489guest-voice
490.It
491guest-voice-signaling
492.It
493softphone-voice
494.It
495video-conferencing
496.It
497streaming-video
498.It
499video-signaling
500.El
501.Pp
502The
503.Cd unknown
504flag tells that the network policy for the specified application type
505is required by the device but is currently unknown. This is used by
506Endpoint Devices, not by Network Connectivity Devices. If not
507specified, the network policy for the given application type is
508defined.
509.Pp
510When a VLAN is specified with
511.Cd vlan
512tells which 802.1q VLAN ID has to be advertised for the network
513policy. A valid value is between 1 and 4094.
514.Cd priority
515allows one to specify IEEE 802.1d / IEEE 802.1p Layer 2 Priority, also
516known as Class of Service (CoS), to be used for the specified
517application type. It should be one of those values:
518.Bl -bullet -compact -offset XXXXXXXX
519.It
520background
521.It
522spare
523.It
524best-effort
525.It
526excellent-effort
527.It
528controlled-load
529.It
530video
531.It
532voice
533.It
534network-control
535.El
536.Pp
537.Ar dscp
538represents the DSCP value to be advertised for the given network
539policy. DiffServ/Differentiated Services Code Point (DSCP) value as
540defined in IETF RFC 2474 for the specified application type. Value: 0
541(default per RFC 2475) through 63. Note: The class selector DSCP
542values are backwards compatible for devices that only support the old
543IP precedence Type of Service (ToS) format. (See the RFCs for what
544these values mean)
545.Pp
546A valid use of this command is:
547.D1 configure med policy application voice vlan 500 priority voice dscp 46
548.Ed
549
550.Cd configure
97772619 551.Op ports Ar ethX Op ,...
fe80711e
VB
552.Cd med power pse | pd
553.Cd source Ar source
554.Cd priority Ar priority
555.Cd value Ar value
556.Bd -ragged -offset XXXXXX
557Advertise the LLDP-MED POE-MDI TLV for the given ports or for all
558interfaces if no port is provided. One can act as a PD (power
559consumer) or a PSE (power provider). No check is done on the validity
560of the parameters while LLDP-MED requires some restrictions:
561.Bl -bullet
562.It
563PD shall never request more power than physical 802.3af class.
564.It
565PD shall never draw more than the maximum power advertised by PSE.
566.It
567PSE shall not reduce power allocated to PD when this power is in use.
568.It
569PSE may request reduced power using conservation mode
570.It
571Being PSE or PD is a global paremeter, not a per-port parameter.
572.Nm
573does not enforce this: a port can be set as PD or PSE. LLDP-MED also
574requires for a PSE to only have one power source (primary or
575backup). Again,
576.Nm
577does not enforce this. Each port can have its own power source. The
578same applies for PD and power priority. LLDP-MED MIB does not allow
579this kind of representation.
580.El
581.Pp
582Valid types are:
583.Bl -tag -width "XXX." -compact -offset XX
584.It Sy pse
585Power Sourcing Entity (power provider)
586.It Sy pd
587Power Device (power consumer)
588.El
589.Pp
590Valid sources are:
591.Bl -tag -width "XXXXXXX" -compact -offset XX
592.It Sy unknown
593Unknown
594.It Sy primary
595For PSE, the power source is the primary power source.
596.It Sy backup
597For PSE, the power source is the backup power source or a power
598conservation mode is asked (the PSE may be running on UPS for
599example).
600.It Sy pse
601For PD, the power source is the PSE.
602.It Sy local
603For PD, the power source is a local source.
604.It Sy both
605For PD, the power source is both the PSE and a local source.
606.El
607.Pp
608Valid priorities are:
609.Bl -tag -width "XXXXXXXXX" -compact -offset XX
610.It Sy unknown
611Unknown priority
612.It Sy critical
613Critical
614.It Sy high
615High
616.It Sy low
617Low
618.El
619.Pp
620.Ar value
621should be the total power in milliwatts required by the PD device or
622available by the PSE device.
623.Pp
624Here is an example of use:
625.D1 configure med power pd source pse priority high value 5000
626.Ed
627
628.Cd configure
97772619 629.Op ports Ar ethX Op ,...
fe80711e
VB
630.Cd dot3 power pse | pd
631.Op Cd supported
632.Op Cd enabled
633.Op Cd paircontrol
634.Cd powerpairs Ar powerpairs
635.Op Cd class Ar class
636.Op Cd type Ar type Cd source Ar source Cd priority Ar priority Cd requested Ar requested Cd allocated Ar allocated
637.Bd -ragged -offset XXXXXX
638Advertise Dot3 POE-MDI TLV for the given port or for all ports if none
639was provided. One can act as a PD (power consumer) or a PSE (power
640provider). This configuration is distinct of the configuration of the
641transmission of the LLDP-MED POE-MDI TLV but the user should ensure
642the coherency of those two configurations if they are used together.
643.Pp
644.Ar supported
645means that MDI power is supported on the given port while
646.Ar enabled
647means that MDI power is enabled.
648.Ar paircontrol
649is used to indicate if pair selection can be controlled. Valid values
650forr
651.Ar powerpairs
652are:
653.Bl -tag -width "XXXXXX" -compact -offset XX
654.It Sy signal
655The signal pairs only are in use.
656.It Sy spare
657The spare pairs only are in use.
658.El
659.Pp
660When specified,
661.Ar class
662is a number between 0 and 4.
663.Pp
664The remaining parameters are in conformance with 802.3at and are optional.
665.Ar type
666should be either 1 or 2, indicating which if the device conforms to
667802.3at type 1 or 802.3at type 2. Values ofr
668.Ar source
669and
670.Ar priority
671are the same as for LLDP-MED POE-MDI TLV.
672.Ar requested
673and
674.Ar allocated
675are expressed in milliwats.
676.Pp
677Here are two valid uses of this command:
678.D1 configure ports eth3 dot3 power pse supported enabled paircontrol powerpairs spare class 3
679.D1 configure dot3 power pd supported enabled powerpairs spare class 3 type 1 source pse priority low requested 10000 allocated 15000
680.Ed
681
e4ff3ed5
VB
682.Cd pause
683.Bd -ragged -offset XXXXXX
684Pause
685.Nm lldpd
686operations.
687.Nm lldpd
688will not send any more frames or receive ones. This can be undone with
689.Cd resume
690command.
691.Ed
692
693.Cd resume
694.Bd -ragged -offset XXXXXX
695Resume
696.Nm lldpd
697operations.
698.Nm lldpd
699will start to send and receive frames. This command is issued
700internally after processing configuration but can be used at any time
701if a manual
702.Cd pause
703command is issued.
704.Ed
705
fe80711e
VB
706.Ed
707.Sh FILES
2cbc9cc5
VB
708.Bl -tag -width "@LLDPD_CTL_SOCKET@XX" -compact
709.It @LLDPD_CTL_SOCKET@
fe80711e
VB
710Unix-domain socket used for communication with
711.Xr lldpd 8 .
712.El
713.Sh SEE ALSO
714.Xr lldpd 8
715.Sh AUTHORS
716.An -nosplit
717The
718.Nm
719program was written by
720.An Vincent Bernat Aq bernat@luffy.cx .