]> git.ipfire.org Git - thirdparty/lldpd.git/blame - content/installation.html
installation: use media.luffy.cx for GPG
[thirdparty/lldpd.git] / content / installation.html
CommitLineData
075da3cc
VB
1---
2title: Installation
3---
4
5`lldpd` supports several OS. You can install it from packages or from
6sources. Once installed, you may want to look
7[how to use and configure it]([[usage.html]]).
8
9[TOC]
10
11# GNU/Linux
12
13## Debian and Ubuntu
14
15`lldpd` is already available in Debian and Ubuntu. You can install it
16with:
17
18 ::console
19 $ sudo apt-get install lldpd
20 Reading package lists... Done
21 Building dependency tree
22 Reading state information... Done
23 The following extra packages will be installed:
24 [...]
25
26It will be installed and configured to start at boot. You can change
27the options of `lldpd` in `/etc/default/lldpd`.
28
29If the package is not recent enough, you can use the
30[Debian backports][] on Debian. Follow the instructions available on
31the website.
32
33If it is still not recent enough, you can grab the appropriate Debian
34package from [openSUSE Build Service][]. Follow the instructions
35available on the website.
36
37The last option is to to [build _lldpd_ from source][]. You can still
38install and uninstall the package to get `_lldpd` user and group, as
39well as a working init script.
40
41## Gentoo
42
43`lldpd` is available in portage. Just issue the command `emerge lldpd`
44to install it. You can also [build _lldpd_ from source][].
45
82520b15
VB
46## Fedora, RHEL, CentOS
47
4d2b4a02
JPO
48`lldpd` is available in the main Fedora and RHEL 8 repositories.
49Just issue the command `dnf install lldpd` to install it.
50
51For older distro versions, like RHEL 7, it is available from the
52[EPEL](https://fedoraproject.org/wiki/EPEL) repository. In this case,
53you need to install the `epel-release` package before issuing the
54`yum install lldpd` command.
55
56Once the `lldpd` package is installed, you can change its options via
57the `/etc/sysconfig/lldpd` file.
82520b15
VB
58
59Alternatively, you can install the packages
60from [openSUSE Build Service][]. Follow the instructions available on
61the website.
62
63It is also possible to [build _lldpd_ from source][].
64
65## SUSE
075da3cc 66
dcadd7dd
VB
67On SLES 12, openSUSE Leap 42.3 or openSUSE Tumbleweed, `lldpd` is
68available directly with the following command:
69
70 ::console
71 $ sudo zypper install lldpd
72 The following 11 NEW packages are going to be installed:
73 libbsd0 libdb-4_8 libevent-2_0-5 libgdbm4 liblldpctl4 libsensors4 libsnmp30 libwrap0 lldpd perl snmp-mibs
74
75 11 new packages to install.
76 Overall download size: 8.7 MiB. Already cached: 0 B. After the operation, additional 47.8 MiB will be used.
77 Continue? [y/n/...? shows all options] (y): y
78 [...]
79 (11/11) Installing: lldpd-0.9.9-2.1.x86_64 ...............[done]
80
ef76685b 81It is also possible to [build _lldpd_ from source][].
075da3cc 82
beebba5b
VB
83## Docker
84
85You can use Docker to run `lldpd`:
86
ea89c335
VB
87 ::console
88 $ docker run --rm --net=host --uts=host \
beebba5b
VB
89 -v /etc/os-release:/etc/os-release \
90 --cap-add=NET_RAW --cap-add=NET_ADMIN \
91 --name lldpd \
92 ghcr.io/lldpd/lldpd:latest
93
94In place of `latest` which provides you with the latest stable
95version, you may use `1`, `1.0`, `{{ resource.meta.latestversion }}`
96to match specific versions.
97
98To execute `lldpcli`, use:
99
ea89c335
VB
100 ::console
101 $ docker exec lldpd lldpcli show neighbors
beebba5b
VB
102
103Or to get the command-line:
104
ea89c335
VB
105 ::console
106 $ docker exec -it lldpd lldpcli
beebba5b 107
075da3cc
VB
108# BSD
109
805fab11
MS
110`lldpd` is currently available in the ports tree of most BSDs[^ports].
111Follow the instructions on how to install lldpd from ports by following
112the documentation specific to the respective ports tree.
113
114Some BSDs provide up-to-date binary packages using their respective
115package management tools.
116
117Though if you want to [build _lldpd_ from source][]. You can add
075da3cc
VB
118`_lldpd` user with `vipw` and add `_lldpd` group by adding it manually
119in `/etc/group`. The user must not be able to login, have its home as
120`/var/empty` and a disabled shell (like `/bin/false`).
121
805fab11
MS
122[^ports]: It has been added to the ports tree of OpenBSD (net/lldpd),
123 FreeBSD (net-mgmt/lldpd) and NetBSD's pkgsrc (net/lldpd).
124 DragonFly uses the FreeBSD port with an overlay named DeltaPorts.
1bfe8cab 125
075da3cc
VB
126You may want to configure `lldpd` with
127`--with-privsep-chroot=/var/empty` to avoid to create
128`/var/run/lldpd`.
129
130If `lldpcli` is not able to provide completion, you can use the `help`
131command instead or install the GNU Readline library on your system.
132
84c6ed77 133# macOS
075da3cc 134
587b233b 135The easiest way is to use the
84c6ed77 136[installer package for macOS][lastpkg]. You need at least macOSĀ 10.6.
587b233b
VB
137
138Alternatively, you can use [Homebrew][]. Check the website if you
139don't have it, it is easy to install. Once installed, type in a
140terminal:
075da3cc
VB
141
142 ::console
aaa57e6d 143 $ brew install https://raw.github.com/lldpd/lldpd/master/osx/lldpd.rb
075da3cc 144 ######################################################################## 100.0%
91df8fcc 145 ==> Downloading https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.tar.gz
075da3cc
VB
146 ==> ./configure --prefix=/usr/local/Cellar/lldpd/{{ resource.meta.latestversion }} --with-xml --with-readline
147 [...]
148
149Pay attention at the instructions at the end of the build: they
150explain how to create `_lldpd` user and group and how to run `lldpd`
151when the system starts.
152
587b233b 153At least, you can [build _lldpd_ from source][].
075da3cc
VB
154
155# Install from source
156
052c3910
VB
157This is the last resort method. Other methods are usually simpler. You need a
158working build environment.
075da3cc 159
052c3910
VB
160First, download the tarball archive:
161
162 ::console
163 $ curl -sO https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.tar.gz
164 $ curl -sO https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.tar.gz.gpg
3b2d896b 165 $ curl -s https://media.luffy.cx/files/gpg.txt | gpg --import
052c3910
VB
166 gpg: key 95A42FE8353525F9: "Vincent Bernat <bernat@luffy.cx>" not changed
167 gpg: Total number processed: 1
168 gpg: unchanged: 1
169 $ gpg --verify lldpd-{{ resource.meta.latestversion }}.tar.gz.gpg lldpd-{{ resource.meta.latestversion }}.tar.gz
170 gpg: Signature made Fri Nov 11 14:31:37 2022 CET
171 gpg: using RSA key AEF2348766F371C689A7360095A42FE8353525F9
172 gpg: Good signature from "Vincent Bernat <bernat@luffy.cx>" [ultimate]
173
174Then, extract and build:
075da3cc
VB
175
176 ::console
2a7ce285 177 $ tar zxvf lldpd-{{ resource.meta.latestversion }}.tar.gz
075da3cc
VB
178 $ cd lldpd-{{ resource.meta.latestversion }}
179 $ mkdir build
180 $ cd build
181 $ ../configure
182 checking for a BSD-compatible install... /usr/bin/install -c
183 checking whether build environment is sane... yes
184 checking for a thread-safe mkdir -p... /bin/mkdir -p
185 checking for gawk... gawk
186 [...]
187 ------------------ Summary ------------------
188 lldpd version {{ meta.resource.latestversion }}
189 Prefix.........: /usr/local
190 C Compiler.....: gcc -g -O2 -fdiagnostics-show-option -std=gnu99 -pipe -Wall -W -Wextra -Wformat -Wformat-security -Wcast-align -Winline -fstack-protector -D_FORTIFY_SOURCE=2 -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare
191 Linker.........: /usr/bin/ld -m elf_x86_64 -Wl,-z,relro -Wl,-z,now
192 Libevent.......: system
193 Optional features:
194 SNMP support...: no
195 CDP............: yes
196 FDP............: yes
197 EDP............: yes
198 SONMP..........: yes
199 LLDPMED........: yes
200 DOT1...........: yes
201 DOT3...........: yes
202 XML output.....: no
203 ---------------------------------------------
204
205 Check the above options and compile with:
206 make
207
208If this steps fail, feel free to [file a bug report][]. The content
209of `config.log` should be helpful. Otherwise, check if everything is
32a1eabf 210as you expect and continue.
075da3cc
VB
211
212 ::console
213 $ make
214 CC strlcpy.lo
215 CCLD libcompat.la
216 CC log.lo
217 [...]
218 make[1]: Leaving directory `/home/bernat/src/lldpd-{{ resource.meta.latestversion }}'
219
220If this steps fail, feel free to [file a bug report][] too with the
221output and some details on your platform. The `config.log` is also
222useful in this case.
223
224You can finish the installation with `make install`. Then, you still
225have to complete the following steps by yourself. They are system
226specifics:
227
34039ed4
VB
228 - Ensure the `liblldpctl` library is correctly registered with the
229 system. The output of `make install` should give the appropriate
7928a8ed 230 steps. On Linux, this is `ldconfig`.
075da3cc
VB
231 - Create a `_lldpd` user and a `_lldpd` group. This is needed for
232 privilege seperation (increased security).
01984f7c 233 - Create the chroot (`/usr/local/var/run/lldpd` by default). It is just an
075da3cc
VB
234 empty directory.
235 - Ensure that `lldpd` is started at boot.
236
237`../configure` accepts several options. You can get them with
238`../configure --help`. The most interesting ones are `--with-snmp` and
239`--with-xml`.
240
31dfab3e
VB
241[lasttgz]: https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.tar.gz "lldpd {{ resource.meta.latestversion }} version"
242[lastpkg]: https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.pkg "lldpd {{ resource.meta.latestversion }} version for OSX"
aaa57e6d 243[file a bug report]: https://github.com/lldpd/lldpd/issues "GitHub bug tracker for lldpd"
31dfab3e 244[Debian backports]: https://backports.debian.org "Debian Backports"
075da3cc
VB
245[openSUSE Build Service]: http://software.opensuse.org/download.html?project=home:vbernat&package=lldpd "lldpd on OSC"
246[build _lldpd_ from source]: #install-from-source
84c6ed77 247[Homebrew]: http://brew.sh/ "Homebrew: the missing package manager for macOS"
82520b15 248[EPEL]: https://fedoraproject.org/wiki/EPEL "EPEL"
075da3cc
VB
249
250{# Local Variables: #}
251{# mode: markdown #}
252{# indent-tabs-mode: nil #}
253{# End: #}