]> git.proxmox.com Git - mirror_frr.git/blame - doc/developer/building-frr-for-debian8.rst
Merge pull request #4364 from FRRouting/doc-libsnmp-dev-debian9
[mirror_frr.git] / doc / developer / building-frr-for-debian8.rst
CommitLineData
d1890d04 1Debian 8
278fb111
MW
2========================================
3
4Debian 8 restrictions:
5----------------------
6
d1890d04
QY
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)
278fb111
MW
10
11Install required packages
12-------------------------
ae32b152 13
278fb111
MW
14Add packages:
15
d1890d04
QY
16::
17
7d9a2e6d 18 sudo apt-get install git autoconf automake libtool make \
b0252580 19 libreadline-dev texinfo libjson-c-dev pkg-config bison flex python-pip \
c1bcb969
QY
20 libc-ares-dev python3-dev python3-sphinx build-essential libsystemd-dev \
21 libsnmp-dev
278fb111 22
d1890d04
QY
23Install newer pytest (>3.0) from pip
24
25::
eb651bbc 26
76bd1499 27 sudo pip install pytest
278fb111 28
fc5a4adc
RW
29.. include:: building-libyang.rst
30
278fb111
MW
31Get FRR, compile it and install it (from Git)
32---------------------------------------------
33
d1890d04
QY
34**This assumes you want to build and install FRR from source and not
35using any packages**
36
37Add frr groups and user
75ca3b11 38^^^^^^^^^^^^^^^^^^^^^^^
278fb111 39
d1890d04 40::
278fb111 41
eb651bbc
MW
42 sudo addgroup --system --gid 92 frr
43 sudo addgroup --system --gid 85 frrvty
02f3b051
PH
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
278fb111 47
d1890d04 48Download Source, configure and compile it
75ca3b11 49^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04 50
eb651bbc
MW
51(You may prefer different options on configure statement. These are just
52an example.)
53
d1890d04
QY
54::
55
d6180888 56 git clone https://github.com/frrouting/frr.git frr
eb651bbc 57 cd frr
eb651bbc
MW
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 \
eb651bbc
MW
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 \
eb651bbc
MW
70 --enable-fpm \
71 --with-pkg-git-version \
76bd1499 72 --with-pkg-extra-version=-MyOwnFRRVersion
eb651bbc
MW
73 make
74 make check
75 sudo make install
278fb111 76
d1890d04 77Create empty FRR configuration files
75ca3b11 78^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
79
80::
aa1322f9 81
eb651bbc
MW
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
aa1322f9 92 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf
97b02007 93 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf
eb651bbc 94 sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf
278fb111 95
d1890d04 96Enable IP & IPv6 forwarding
75ca3b11 97^^^^^^^^^^^^^^^^^^^^^^^^^^^
278fb111 98
d1890d04 99Edit ``/etc/sysctl.conf`` and uncomment the following values (ignore the
eb651bbc 100other settings)
278fb111 101
d1890d04
QY
102::
103
eb651bbc
MW
104 # Uncomment the next line to enable packet forwarding for IPv4
105 net.ipv4.ip_forward=1
278fb111 106
eb651bbc
MW
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
278fb111 111
d1890d04
QY
112**Reboot** or use ``sysctl -p`` to apply the same config to the running
113system
86fb2ae8 114
d1890d04 115Troubleshooting
75ca3b11 116^^^^^^^^^^^^^^^
86fb2ae8
AF
117
118**Local state directory**
119
d1890d04
QY
120The local state directory must exist and have the correct permissions
121applied for the frrouting daemons to start. In the above ./configure
122example the local state directory is set to /var/run/frr
123(--localstatedir=/var/run/frr) Debian considers /var/run/frr to be
124temporary and this is removed after a reboot.
86fb2ae8
AF
125
126When using a different local state directory you need to create the new
127directory and change the ownership to the frr user, for example:
128
d1890d04
QY
129::
130
86fb2ae8
AF
131 mkdir /var/opt/frr
132 chown frr /var/opt/frr
133
134**Shared library error**
135
d1890d04
QY
136If you try and start any of the frrouting daemons you may see the below
137error due to the frrouting shared library directory not being found:
138
139::
86fb2ae8
AF
140
141 ./zebra: error while loading shared libraries: libfrr.so.0: cannot open shared object file: No such file or directory
142
d1890d04
QY
143The fix is to add the following line to /etc/ld.so.conf which will
144continue to reference the library directory after the system reboots. To
145load the library directory path immediately run the ldconfig command
146after adding the line to the file eg:
147
148::
86fb2ae8
AF
149
150 echo include /usr/local/lib >> /etc/ld.so.conf
151 ldconfig