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