]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-debian8.rst
doc: suggest the installation of the libcap development library
[mirror_frr.git] / doc / developer / building-frr-for-debian8.rst
1 Debian 8
2 ========================================
3
4 Debian 8 restrictions:
5 ----------------------
6
7 - MPLS is not supported on ``Debian 8`` with default kernel. MPLS
8 requires Linux Kernel 4.5 or higher (LDP can be built, but may have
9 limited use without MPLS)
10
11 Install required packages
12 -------------------------
13
14 Add packages:
15
16 ::
17
18 sudo apt-get install git autoconf automake libtool make \
19 libreadline-dev texinfo libjson-c-dev pkg-config bison flex python3-pip \
20 libc-ares-dev python3-dev python3-sphinx build-essential libsystemd-dev \
21 libsnmp-dev libcap-dev
22
23 Install newer pytest (>3.0) from pip
24
25 ::
26
27 sudo pip3 install pytest
28
29 .. include:: building-libyang.rst
30
31 Get FRR, compile it and install it (from Git)
32 ---------------------------------------------
33
34 **This assumes you want to build and install FRR from source and not
35 using any packages**
36
37 Add frr groups and user
38 ^^^^^^^^^^^^^^^^^^^^^^^
39
40 ::
41
42 sudo addgroup --system --gid 92 frr
43 sudo addgroup --system --gid 85 frrvty
44 sudo adduser --system --ingroup frr --home /var/run/frr/ \
45 --gecos "FRR suite" --shell /bin/false frr
46 sudo usermod -a -G frrvty frr
47
48 Download Source, configure and compile it
49 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50
51 (You may prefer different options on configure statement. These are just
52 an example.)
53
54 ::
55
56 git clone https://github.com/frrouting/frr.git frr
57 cd frr
58 ./bootstrap.sh
59 ./configure \
60 --enable-exampledir=/usr/share/doc/frr/examples/ \
61 --localstatedir=/var/run/frr \
62 --sbindir=/usr/lib/frr \
63 --sysconfdir=/etc/frr \
64 --enable-multipath=64 \
65 --enable-user=frr \
66 --enable-group=frr \
67 --enable-vty-group=frrvty \
68 --enable-configfile-mask=0640 \
69 --enable-logfile-mask=0640 \
70 --enable-fpm \
71 --with-pkg-git-version \
72 --with-pkg-extra-version=-MyOwnFRRVersion
73 make
74 make check
75 sudo make install
76
77 Create empty FRR configuration files
78 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79
80 ::
81
82 sudo install -m 755 -o frr -g frr -d /var/log/frr
83 sudo install -m 775 -o frr -g frrvty -d /etc/frr
84 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf
85 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf
86 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf
87 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf
88 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf
89 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf
90 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf
91 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf
92 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf
93 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf
94 sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf
95
96 Enable IP & IPv6 forwarding
97 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
99 Edit ``/etc/sysctl.conf`` and uncomment the following values (ignore the
100 other settings)
101
102 ::
103
104 # Uncomment the next line to enable packet forwarding for IPv4
105 net.ipv4.ip_forward=1
106
107 # Uncomment the next line to enable packet forwarding for IPv6
108 # Enabling this option disables Stateless Address Autoconfiguration
109 # based on Router Advertisements for this host
110 net.ipv6.conf.all.forwarding=1
111
112 **Reboot** or use ``sysctl -p`` to apply the same config to the running
113 system
114
115 Troubleshooting
116 ^^^^^^^^^^^^^^^
117
118 **Local state directory**
119
120 The local state directory must exist and have the correct permissions
121 applied for the frrouting daemons to start. In the above ./configure
122 example the local state directory is set to /var/run/frr
123 (--localstatedir=/var/run/frr) Debian considers /var/run/frr to be
124 temporary and this is removed after a reboot.
125
126 When using a different local state directory you need to create the new
127 directory and change the ownership to the frr user, for example:
128
129 ::
130
131 mkdir /var/opt/frr
132 chown frr /var/opt/frr
133
134 **Shared library error**
135
136 If you try and start any of the frrouting daemons you may see the below
137 error due to the frrouting shared library directory not being found:
138
139 ::
140
141 ./zebra: error while loading shared libraries: libfrr.so.0: cannot open shared object file: No such file or directory
142
143 The fix is to add the following line to /etc/ld.so.conf which will
144 continue to reference the library directory after the system reboots. To
145 load the library directory path immediately run the ldconfig command
146 after adding the line to the file eg:
147
148 ::
149
150 echo include /usr/local/lib >> /etc/ld.so.conf
151 ldconfig