]> git.proxmox.com Git - mirror_frr.git/blame - doc/developer/building-frr-for-debian8.rst
Merge pull request #13546 from LabNConsulting/chopps/pylint-fix
[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 \
45da32d7 19 libreadline-dev texinfo libjson-c-dev pkg-config bison flex python3-pip \
ab140d61 20 libc-ares-dev python3-dev python3-sphinx build-essential \
5b08f6f9 21 libsnmp-dev libcap-dev libelf-dev libprotobuf-c-dev protobuf-c-compiler
278fb111 22
d1890d04
QY
23Install newer pytest (>3.0) from pip
24
25::
eb651bbc 26
45da32d7 27 sudo pip3 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 \
eb651bbc
MW
60 --localstatedir=/var/run/frr \
61 --sbindir=/usr/lib/frr \
62 --sysconfdir=/etc/frr \
eb651bbc
MW
63 --enable-multipath=64 \
64 --enable-user=frr \
65 --enable-group=frr \
66 --enable-vty-group=frrvty \
67 --enable-configfile-mask=0640 \
68 --enable-logfile-mask=0640 \
eb651bbc
MW
69 --enable-fpm \
70 --with-pkg-git-version \
76bd1499 71 --with-pkg-extra-version=-MyOwnFRRVersion
eb651bbc
MW
72 make
73 make check
74 sudo make install
278fb111 75
d1890d04 76Create empty FRR configuration files
75ca3b11 77^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
78
79::
aa1322f9 80
eb651bbc
MW
81 sudo install -m 755 -o frr -g frr -d /var/log/frr
82 sudo install -m 775 -o frr -g frrvty -d /etc/frr
83 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf
84 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf
85 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf
86 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf
87 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf
88 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf
89 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf
90 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf
aa1322f9 91 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf
97b02007 92 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf
eb651bbc 93 sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf
278fb111 94
d1890d04 95Enable IP & IPv6 forwarding
75ca3b11 96^^^^^^^^^^^^^^^^^^^^^^^^^^^
278fb111 97
d1890d04 98Edit ``/etc/sysctl.conf`` and uncomment the following values (ignore the
eb651bbc 99other settings)
278fb111 100
d1890d04
QY
101::
102
eb651bbc
MW
103 # Uncomment the next line to enable packet forwarding for IPv4
104 net.ipv4.ip_forward=1
278fb111 105
eb651bbc
MW
106 # Uncomment the next line to enable packet forwarding for IPv6
107 # Enabling this option disables Stateless Address Autoconfiguration
108 # based on Router Advertisements for this host
109 net.ipv6.conf.all.forwarding=1
278fb111 110
d1890d04
QY
111**Reboot** or use ``sysctl -p`` to apply the same config to the running
112system
86fb2ae8 113
d1890d04 114Troubleshooting
75ca3b11 115^^^^^^^^^^^^^^^
86fb2ae8
AF
116
117**Local state directory**
118
d1890d04
QY
119The local state directory must exist and have the correct permissions
120applied for the frrouting daemons to start. In the above ./configure
121example the local state directory is set to /var/run/frr
122(--localstatedir=/var/run/frr) Debian considers /var/run/frr to be
123temporary and this is removed after a reboot.
86fb2ae8
AF
124
125When using a different local state directory you need to create the new
126directory and change the ownership to the frr user, for example:
127
d1890d04
QY
128::
129
86fb2ae8
AF
130 mkdir /var/opt/frr
131 chown frr /var/opt/frr
132
133**Shared library error**
134
d1890d04
QY
135If you try and start any of the frrouting daemons you may see the below
136error due to the frrouting shared library directory not being found:
137
138::
86fb2ae8
AF
139
140 ./zebra: error while loading shared libraries: libfrr.so.0: cannot open shared object file: No such file or directory
141
d1890d04
QY
142The fix is to add the following line to /etc/ld.so.conf which will
143continue to reference the library directory after the system reboots. To
144load the library directory path immediately run the ldconfig command
145after adding the line to the file eg:
146
147::
86fb2ae8
AF
148
149 echo include /usr/local/lib >> /etc/ld.so.conf
150 ldconfig