]> git.ipfire.org Git - thirdparty/lldpd.git/blame - content/installation.html
content: fix typo
[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
48`lldpd` is available from [EPEL][]. First, you need to install the
49`epel-release` package, then just install with `yum install lldpd` or
50`dnf install lldpd`. Once installed, you can change the options
51provided to `lldpd` in `/etc/sysconfig/lldpd`.
52
53Alternatively, you can install the packages
54from [openSUSE Build Service][]. Follow the instructions available on
55the website.
56
57It is also possible to [build _lldpd_ from source][].
58
59## SUSE
075da3cc 60
dcadd7dd
VB
61On SLES 12, openSUSE Leap 42.3 or openSUSE Tumbleweed, `lldpd` is
62available directly with the following command:
63
64 ::console
65 $ sudo zypper install lldpd
66 The following 11 NEW packages are going to be installed:
67 libbsd0 libdb-4_8 libevent-2_0-5 libgdbm4 liblldpctl4 libsensors4 libsnmp30 libwrap0 lldpd perl snmp-mibs
68
69 11 new packages to install.
70 Overall download size: 8.7 MiB. Already cached: 0 B. After the operation, additional 47.8 MiB will be used.
71 Continue? [y/n/...? shows all options] (y): y
72 [...]
73 (11/11) Installing: lldpd-0.9.9-2.1.x86_64 ...............[done]
74
75You can also install the packages from [openSUSE Build
76Service][]. Follow the instructions available on the website.
ef76685b
VB
77
78It is also possible to [build _lldpd_ from source][].
075da3cc
VB
79
80# BSD
81
805fab11
MS
82`lldpd` is currently available in the ports tree of most BSDs[^ports].
83Follow the instructions on how to install lldpd from ports by following
84the documentation specific to the respective ports tree.
85
86Some BSDs provide up-to-date binary packages using their respective
87package management tools.
88
89Though if you want to [build _lldpd_ from source][]. You can add
075da3cc
VB
90`_lldpd` user with `vipw` and add `_lldpd` group by adding it manually
91in `/etc/group`. The user must not be able to login, have its home as
92`/var/empty` and a disabled shell (like `/bin/false`).
93
805fab11
MS
94[^ports]: It has been added to the ports tree of OpenBSD (net/lldpd),
95 FreeBSD (net-mgmt/lldpd) and NetBSD's pkgsrc (net/lldpd).
96 DragonFly uses the FreeBSD port with an overlay named DeltaPorts.
1bfe8cab 97
075da3cc
VB
98You may want to configure `lldpd` with
99`--with-privsep-chroot=/var/empty` to avoid to create
100`/var/run/lldpd`.
101
102If `lldpcli` is not able to provide completion, you can use the `help`
103command instead or install the GNU Readline library on your system.
104
84c6ed77 105# macOS
075da3cc 106
587b233b 107The easiest way is to use the
84c6ed77 108[installer package for macOS][lastpkg]. You need at least macOSĀ 10.6.
587b233b
VB
109
110Alternatively, you can use [Homebrew][]. Check the website if you
111don't have it, it is easy to install. Once installed, type in a
112terminal:
075da3cc
VB
113
114 ::console
115 $ brew install https://raw.github.com/vincentbernat/lldpd/master/osx/lldpd.rb
116 ######################################################################## 100.0%
91df8fcc 117 ==> Downloading https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.tar.gz
075da3cc
VB
118 ==> ./configure --prefix=/usr/local/Cellar/lldpd/{{ resource.meta.latestversion }} --with-xml --with-readline
119 [...]
120
121Pay attention at the instructions at the end of the build: they
122explain how to create `_lldpd` user and group and how to run `lldpd`
123when the system starts.
124
587b233b 125At least, you can [build _lldpd_ from source][].
075da3cc
VB
126
127# Install from source
128
129This is the last resort method. Other methods are usually simpler.
130
131You first need to download the latest version
2a7ce285
VB
132([{{ resource.meta.latestversion }}][lasttgz]) (do not download it
133from GitHub, you would get an incomplete archive). You need a working
134build environment.
075da3cc
VB
135
136 ::console
2a7ce285 137 $ tar zxvf lldpd-{{ resource.meta.latestversion }}.tar.gz
075da3cc
VB
138 $ cd lldpd-{{ resource.meta.latestversion }}
139 $ mkdir build
140 $ cd build
141 $ ../configure
142 checking for a BSD-compatible install... /usr/bin/install -c
143 checking whether build environment is sane... yes
144 checking for a thread-safe mkdir -p... /bin/mkdir -p
145 checking for gawk... gawk
146 [...]
147 ------------------ Summary ------------------
148 lldpd version {{ meta.resource.latestversion }}
149 Prefix.........: /usr/local
150 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
151 Linker.........: /usr/bin/ld -m elf_x86_64 -Wl,-z,relro -Wl,-z,now
152 Libevent.......: system
153 Optional features:
154 SNMP support...: no
155 CDP............: yes
156 FDP............: yes
157 EDP............: yes
158 SONMP..........: yes
159 LLDPMED........: yes
160 DOT1...........: yes
161 DOT3...........: yes
162 XML output.....: no
163 ---------------------------------------------
164
165 Check the above options and compile with:
166 make
167
168If this steps fail, feel free to [file a bug report][]. The content
169of `config.log` should be helpful. Otherwise, check if everything is
32a1eabf 170as you expect and continue.
075da3cc
VB
171
172 ::console
173 $ make
174 CC strlcpy.lo
175 CCLD libcompat.la
176 CC log.lo
177 [...]
178 make[1]: Leaving directory `/home/bernat/src/lldpd-{{ resource.meta.latestversion }}'
179
180If this steps fail, feel free to [file a bug report][] too with the
181output and some details on your platform. The `config.log` is also
182useful in this case.
183
184You can finish the installation with `make install`. Then, you still
185have to complete the following steps by yourself. They are system
186specifics:
187
34039ed4
VB
188 - Ensure the `liblldpctl` library is correctly registered with the
189 system. The output of `make install` should give the appropriate
190 steps. On Linux, this is `ldconfig -a`.
075da3cc
VB
191 - Create a `_lldpd` user and a `_lldpd` group. This is needed for
192 privilege seperation (increased security).
01984f7c 193 - Create the chroot (`/usr/local/var/run/lldpd` by default). It is just an
075da3cc
VB
194 empty directory.
195 - Ensure that `lldpd` is started at boot.
196
197`../configure` accepts several options. You can get them with
198`../configure --help`. The most interesting ones are `--with-snmp` and
199`--with-xml`.
200
31dfab3e
VB
201[lasttgz]: https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.tar.gz "lldpd {{ resource.meta.latestversion }} version"
202[lastpkg]: https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.pkg "lldpd {{ resource.meta.latestversion }} version for OSX"
1cb3eaac 203[file a bug report]: https://github.com/vincentbernat/lldpd/issues "GitHub bug tracker for lldpd"
31dfab3e 204[Debian backports]: https://backports.debian.org "Debian Backports"
075da3cc
VB
205[openSUSE Build Service]: http://software.opensuse.org/download.html?project=home:vbernat&package=lldpd "lldpd on OSC"
206[build _lldpd_ from source]: #install-from-source
84c6ed77 207[Homebrew]: http://brew.sh/ "Homebrew: the missing package manager for macOS"
82520b15 208[EPEL]: https://fedoraproject.org/wiki/EPEL "EPEL"
075da3cc
VB
209
210{# Local Variables: #}
211{# mode: markdown #}
212{# indent-tabs-mode: nil #}
213{# End: #}