summaryrefslogtreecommitdiffstats
path: root/src/daemon/lldpd.8.in
blob: 32d57a6df2fe3844dce119c091290fb56a5318ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
.\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
.\" Copyright (c) 2008 Vincent Bernat <bernat@luffy.cx>
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: August 21 2008 $
.Dt LLDPD 8
.Os
.Sh NAME
.Nm lldpd
.Nd LLDP daemon
.Sh SYNOPSIS
.Nm
.Op Fl dxcseiklrv
.Op Fl D Ar debug
.Op Fl p Ar pidfile
.Op Fl S Ar description
.Op Fl P Ar platform
.Op Fl X Ar socket
.Op Fl m Ar management
.Op Fl u Ar file
.Op Fl I Ar interfaces
.Op Fl C Ar interfaces
.Op Fl M Ar class
.Op Fl H Ar hide
.Op Fl L Ar lldpcli
.Op Fl O Ar configfile
.Sh DESCRIPTION
.Nm
is a daemon able to receive and send
.Em 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.
.Pp
.Nm
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
.Xr snmpd.conf 5 :
.Bd -literal -offset indent
master agentx
.Ed
.Pp
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.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl d
Do not daemonize.
If this option is specified,
.Nm
will run in the foreground. When specified one more time,
.Nm
will 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
.Fl D
flag.
.It Fl D Ar 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
.Fl d
flag to have some effect. Only debugging logs can be filtered. Here is
a list of allowed tokens with their description:
.Bl -tag -width "XXXXXXXXXX" -offset "XXXX" -compact
.It Sy main
Main daemon.
.It Sy interfaces
Discovery of local interfaces.
.It Sy lldp
LLDP PDU encoding/decoding.
.It Sy edp
EDP PDU encoding/decoding.
.It Sy cdp
CDP/FDP PDU encoding/decoding.
.It Sy sonmp
SONMP PDU encoding/decoding.
.It Sy event
Events management.
.It Sy libevent
Events management but for logs generated by libevent.
.It Sy privsep
Privilege separation.
.It Sy localchassis
Retrieval of information related to the local chassis.
.It Sy rpc
Client communication.
.It Sy control
Management of the Unix control socket.
.It Sy snmp
SNMP subagent.
.It Sy libsnmp
SNMP subagent but for logs generated by NetSNMP.
.It Sy decode
Generic PDU decoding.
.It Sy marshal
Low-level serialization mechanisms.
.It Sy alloc
Low-level allocation mechanisms.
.It Sy send
Sending PDU to some interface.
.It Sy receive
Receiving PDU from some interface.
.It Sy loop
Main loop.
.It Sy smartfilter
Smart filtering of different protocols on the same port.
.It Sy netlink
Netlink subsystem.
.El
.It Fl p Ar pidfile
Use the provided PID file to record
.Nm
PID instead of @LLDPD_PID_FILE@.
.It Fl 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'.
.It Fl S Ar 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
.Fl k
flag described above).
.It Fl P Ar platform
Override the CDP platform name with the provided value. The default
description is the kernel name (Linux).
.It Fl x
Enable SNMP subagent.
With this option,
.Nm
will enable an SNMP subagent using AgentX protocol. This allows you to
get information about local system and remote systems through SNMP.
.It Fl X Ar socket
Enable SNMP subagent using the specified socket.
.Nm
will enable an SNMP subagent using AgentX protocol for the given
socket. This option implies the previous one. The default socket is
usually
.Em /var/agentx/master .
You can specify a socket like
.Em tcp:127.0.0.1:705
for 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.
.It Fl 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.
.Fl cccc ) ,
CDPv1 will be disabled and CDPv2 will be enabled. If repeated once
again (i.e.
.Fl ccccc ) ,
CDPv1 will be disabled and CDPv2 will be forced.
.It Fl 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.
.It Fl 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.
.It Fl 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.
.It Fl 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.
.It Fl r
Receive-only mode. With this switch,
.Nm
will not send any frame. It will only listen to neighbors.
.It Fl m Ar 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 and one IPv6 addresses are chosen. Otherwise, many of them can be
selected. If you want to remove IPv6 addresses, you can use
.Em !*:* .
If an interface name is matched, the first IPv4 address and the first
IPv6 address associated to this interface will be chosen.
.It Fl u Ar file
Specify the Unix-domain socket used for communication with
.Xr lldpctl 8 .
.It Fl I Ar interfaces
Specify which interface to listen and send LLDPDU to. Without this
option,
.Nm
will 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, with
.Em eth*,!eth1,!eth2
.Nm
will only use interfaces starting by
.Em eth
with the exception of
.Em eth1
and
.Em eth2 .
While with
.Em *,!eth*,!!eth1
.Nm
will use all interfaces, except interfaces starting by
.Em eth
with the exception of
.Em eth1 .
When an exact match is found, it will circumvent some tests. For example, if
.Em eth0.12
is specified, it will be accepted even if this is a VLAN interface.
.It Fl C Ar interfaces
Specify which interfaces to use for computing chassis ID. Without this
option, all interfaces are considered.
.Nm
will 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
.Fl I
flag: you can exclude interfaces with an exclamation mark and use
globbing to specify several interfaces. If all interfaces are
removed (with
.Em !* ) ,
the system name is used as a chassis ID instead.
.It Fl M Ar class
Enable emission of LLDP-MED frame. 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 about this aspect. The
class should be one of the following value:
.Bl -tag -width "0:XX" -compact
.It Sy 1
Generic Endpoint (Class I)
.It Sy 2
Media Endpoint (Class II). In this case, the standard requires to
define at least one network policy through
.Nm lldpcli .
.It Sy 3
Communication Device Endpoints (Class III). In this case, the standard
requires to define at least one network policy through
.Nm lldpcli .
.It Sy 4
Network Connectivity Device
.El
.It Fl i
Disable LLDP-MED inventory TLV transmission.
.Nm
will 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 sensible information like serial numbers.
.It Fl H Ar hide
Filter neighbors. See section
.Sx FILTERING NEIGHBORS
for details.
.It Fl L Ar lldpcli
Provide an alternative path to
.Nm lldpcli
for configuration. If empty, does not use
.Nm lldpcli
for configuration.
.It Fl O Ar configfile
Override default configuration locations processed by
.Nm lldpcli
at start. If a directory is provided, each file contained in it will be read if ending by
.Sy .conf.
Order is alphabetical.
.It Fl v
Show
.Nm
version. When repeated, show more build information.
.El
.Sh FILTERING NEIGHBORS
In a heterogeneous network, you may see several different hosts on the
same port, even if there is only one physically plugged to 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
.Fl H Ar hide
parameter will allow you to tell
.Nm
to discard some frames that it receives and to avoid to send some
other frames.
.Pp
Incoming filtering and outgoing filtering are
unrelated. Incoming filtering will hide some remote ports to get you a
chance to know exactly what equipment is on the other side of the
network cable. Outgoing filtering will avoid to use 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,
.Nm
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
.Fl cc , ss , ee , ll
and
.Fl ff
).
.Pp
When enabling incoming filtering,
.Nm
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 mean that the remote switch speaks LLDP and does not
filter CDP. Therefore, we select LLDP. When enabling outgoing
filtering,
.Nm
will also try to select one protocol and only speaks this
protocol. The filtering is done per port. Each port may select a
different protocol.
.Pp
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 less
neighbors still apply. If
.Nm
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,
.Nm
will speak both CDP and LLDP on this port.
.Pp
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 the LLDP
table.
.Pp
The table below summarize all accepted values for the
.Fl H Ar hide
parameter. The default value is
.Em 15
which corresponds to the corner case described above. The
.Em filter
column means that filtering is enabled. The
.Em 1proto
column tells that only one protocol will be kept. The
.Em 1neigh
column tells that only one neighbor will be kept.
.Pp
.Bl -column -compact -offset indent "HXXX" "filterX" "1protoX" "1neighX" "filterX" "1protoX" "1neighX"
.It Ta Ta incoming Ta Ta outgoing Ta
.It Ta Em filter Ta Em 1proto Ta Em 1neigh Ta Em filter Ta Em 1proto Ta Em 1neigh
.It Em 0  Ta   Ta   Ta   Ta   Ta   Ta  
.It Em 1  Ta x Ta x Ta   Ta x Ta x Ta  
.It Em 2  Ta x Ta x Ta   Ta   Ta   Ta  
.It Em 3  Ta   Ta   Ta   Ta x Ta x Ta  
.It Em 4  Ta x Ta   Ta   Ta x Ta   Ta  
.It Em 5  Ta x Ta   Ta   Ta   Ta   Ta  
.It Em 6  Ta   Ta   Ta   Ta x Ta   Ta  
.It Em 7  Ta x Ta x Ta x Ta x Ta x Ta  
.It Em 8  Ta x Ta x Ta x Ta   Ta   Ta  
.It Em 9  Ta x Ta   Ta x Ta x Ta x Ta  
.It Em 10 Ta   Ta   Ta   Ta x Ta   Ta x
.It Em 11 Ta x Ta   Ta x Ta   Ta   Ta  
.It Em 12 Ta x Ta   Ta x Ta x Ta   Ta x
.It Em 13 Ta x Ta   Ta x Ta x Ta   Ta  
.It Em 14 Ta x Ta x Ta   Ta x Ta   Ta x
.It Em 15 Ta x Ta x Ta   Ta x Ta   Ta  
.It Em 16 Ta x Ta x Ta x Ta x Ta   Ta x
.It Em 17 Ta x Ta x Ta x Ta x Ta   Ta  
.It Em 18 Ta x Ta   Ta   Ta x Ta   Ta x
.It Em 19 Ta x Ta   Ta   Ta x Ta x Ta  
.El
.Sh FILES
.Bl -tag -width "@LLDPD_CTL_SOCKET@XX" -compact
.It @LLDPD_CTL_SOCKET@
Unix-domain socket used for communication with
.Xr lldpctl 8 .
.It @sysconfdir@/lldpd.conf
Configuration file for
.Nm .
Commands in this files are executed by
.Xr lldpcli 8
at start.
.It @sysconfdir@/lldpd.d
Directory containing configuration files whose commands are executed
by
.Xr lldpcli 8
at start.
.El
.Sh SEE ALSO
.Xr lldpctl 8 ,
.Xr lldpcli 8 ,
.Xr snmpd 8
.Sh HISTORY
The
.Nm
program is inspired from a preliminary work of Reyk Floeter.
.Sh AUTHORS
.An -nosplit
The
.Nm
program was written by
.An Pierre-Yves Ritschard Aq pyr@openbsd.org ,
and
.An Vincent Bernat Aq bernat@luffy.cx .