]> git.ipfire.org Git - thirdparty/lldpd.git/blob - content/installation.html
site: fix default value for chroot directory
[thirdparty/lldpd.git] / content / installation.html
1 ---
2 title: Installation
3 ---
4
5 `lldpd` supports several OS. You can install it from packages or from
6 sources. 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
16 with:
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
26 It will be installed and configured to start at boot. You can change
27 the options of `lldpd` in `/etc/default/lldpd`.
28
29 If the package is not recent enough, you can use the
30 [Debian backports][] on Debian. Follow the instructions available on
31 the website.
32
33 If it is still not recent enough, you can grab the appropriate Debian
34 package from [openSUSE Build Service][]. Follow the instructions
35 available on the website.
36
37 The last option is to to [build _lldpd_ from source][]. You can still
38 install and uninstall the package to get `_lldpd` user and group, as
39 well as a working init script.
40
41 ## Gentoo
42
43 `lldpd` is available in portage. Just issue the command `emerge lldpd`
44 to install it. You can also [build _lldpd_ from source][].
45
46 ## Fedora, RHEL, CentOS & SUSE
47
48 You can install the packages from [openSUSE Build Service][]. Follow
49 the instructions available on the website. Once installed, you can
50 change the options provided to `lldpd` in `/etc/sysconfig/lldpd`.
51
52 It is also possible to [build _lldpd_ from source][].
53
54 # BSD
55
56 `lldpd` is currently available in the ports tree of most BSDs[^ports].
57 Follow the instructions on how to install lldpd from ports by following
58 the documentation specific to the respective ports tree.
59
60 Some BSDs provide up-to-date binary packages using their respective
61 package management tools.
62
63 Though if you want to [build _lldpd_ from source][]. You can add
64 `_lldpd` user with `vipw` and add `_lldpd` group by adding it manually
65 in `/etc/group`. The user must not be able to login, have its home as
66 `/var/empty` and a disabled shell (like `/bin/false`).
67
68 [^ports]: It has been added to the ports tree of OpenBSD (net/lldpd),
69 FreeBSD (net-mgmt/lldpd) and NetBSD's pkgsrc (net/lldpd).
70 DragonFly uses the FreeBSD port with an overlay named DeltaPorts.
71
72 You may want to configure `lldpd` with
73 `--with-privsep-chroot=/var/empty` to avoid to create
74 `/var/run/lldpd`.
75
76 If `lldpcli` is not able to provide completion, you can use the `help`
77 command instead or install the GNU Readline library on your system.
78
79 # Mac OS X
80
81 The easiest way is to use the
82 [installer package for OS X][lastpkg]. You need at least Mac
83 OS X 10.6.
84
85 Alternatively, you can use [Homebrew][]. Check the website if you
86 don't have it, it is easy to install. Once installed, type in a
87 terminal:
88
89 ::console
90 $ brew install https://raw.github.com/vincentbernat/lldpd/master/osx/lldpd.rb
91 ######################################################################## 100.0%
92 ==> Downloading https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.tar.gz
93 ==> ./configure --prefix=/usr/local/Cellar/lldpd/{{ resource.meta.latestversion }} --with-xml --with-readline
94 [...]
95
96 Pay attention at the instructions at the end of the build: they
97 explain how to create `_lldpd` user and group and how to run `lldpd`
98 when the system starts.
99
100 At least, you can [build _lldpd_ from source][].
101
102 # Install from source
103
104 This is the last resort method. Other methods are usually simpler.
105
106 You first need to download the latest version
107 ([{{ resource.meta.latestversion }}][lasttgz]). You need a working build
108 environment.
109
110 ::console
111 $ tar zxvf ~/download/lldpd-{{ resource.meta.latestversion }}.tar.gz
112 $ cd lldpd-{{ resource.meta.latestversion }}
113 $ mkdir build
114 $ cd build
115 $ ../configure
116 checking for a BSD-compatible install... /usr/bin/install -c
117 checking whether build environment is sane... yes
118 checking for a thread-safe mkdir -p... /bin/mkdir -p
119 checking for gawk... gawk
120 [...]
121 ------------------ Summary ------------------
122 lldpd version {{ meta.resource.latestversion }}
123 Prefix.........: /usr/local
124 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
125 Linker.........: /usr/bin/ld -m elf_x86_64 -Wl,-z,relro -Wl,-z,now
126 Libevent.......: system
127 Optional features:
128 SNMP support...: no
129 CDP............: yes
130 FDP............: yes
131 EDP............: yes
132 SONMP..........: yes
133 LLDPMED........: yes
134 DOT1...........: yes
135 DOT3...........: yes
136 XML output.....: no
137 ---------------------------------------------
138
139 Check the above options and compile with:
140 make
141
142 If this steps fail, feel free to [file a bug report][]. The content
143 of `config.log` should be helpful. Otherwise, check if everything is
144 as you except and continue.
145
146 ::console
147 $ make
148 CC strlcpy.lo
149 CCLD libcompat.la
150 CC log.lo
151 [...]
152 make[1]: Leaving directory `/home/bernat/src/lldpd-{{ resource.meta.latestversion }}'
153
154 If this steps fail, feel free to [file a bug report][] too with the
155 output and some details on your platform. The `config.log` is also
156 useful in this case.
157
158 You can finish the installation with `make install`. Then, you still
159 have to complete the following steps by yourself. They are system
160 specifics:
161
162 - Create a `_lldpd` user and a `_lldpd` group. This is needed for
163 privilege seperation (increased security).
164 - Create the chroot (`/usr/local/var/run/lldpd` by default). It is just an
165 empty directory.
166 - Ensure that `lldpd` is started at boot.
167
168 `../configure` accepts several options. You can get them with
169 `../configure --help`. The most interesting ones are `--with-snmp` and
170 `--with-xml`.
171
172 [lasttgz]: https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.tar.gz "lldpd {{ resource.meta.latestversion }} version"
173 [lastpkg]: https://media.luffy.cx/files/lldpd/lldpd-{{ resource.meta.latestversion }}.pkg "lldpd {{ resource.meta.latestversion }} version for OSX"
174 [file a bug report]: https://github.com/vincentbernat/lldpd/issues "GitHub bug tracker for lldpd"
175 [Debian backports]: https://backports.debian.org "Debian Backports"
176 [openSUSE Build Service]: http://software.opensuse.org/download.html?project=home:vbernat&package=lldpd "lldpd on OSC"
177 [build _lldpd_ from source]: #install-from-source
178 [Homebrew]: http://brew.sh/ "Homebrew: the missing package manager for OS X"
179
180 {# Local Variables: #}
181 {# mode: markdown #}
182 {# indent-tabs-mode: nil #}
183 {# End: #}