]> git.proxmox.com Git - mirror_frr.git/blame - doc/developer/building-frr-on-ubuntu1604.rst
zebra/lib: code cleaning
[mirror_frr.git] / doc / developer / building-frr-on-ubuntu1604.rst
CommitLineData
d1890d04 1Ubuntu 16.04LTS
278fb111
MW
2===============================================
3
d1890d04
QY
4- MPLS is not supported on ``Ubuntu 16.04`` with default kernel. MPLS
5 requires Linux Kernel 4.5 or higher (LDP can be built, but may have
6 limited use without MPLS) For an updated Ubuntu Kernel, see
7 http://kernel.ubuntu.com/~kernel-ppa/mainline/
278fb111
MW
8
9Install required packages
10-------------------------
eb651bbc 11
278fb111
MW
12Add packages:
13
d1890d04
QY
14::
15
07c40b22
QY
16 apt-get install \
17 git autoconf automake libtool make gawk libreadline-dev texinfo dejagnu \
18 pkg-config libpam0g-dev libjson-c-dev bison flex python-pytest \
19 libc-ares-dev python3-dev libsystemd-dev python-ipaddr python3-sphinx \
20 install-info
eb651bbc 21
278fb111
MW
22Get FRR, compile it and install it (from Git)
23---------------------------------------------
24
d1890d04
QY
25**This assumes you want to build and install FRR from source and not
26using any packages**
27
28Add frr groups and user
75ca3b11 29^^^^^^^^^^^^^^^^^^^^^^^
278fb111 30
d1890d04 31::
278fb111 32
79871dbf 33 sudo groupadd -r -g 92 frr
eb651bbc 34 sudo groupadd -r -g 85 frrvty
02f3b051 35 sudo adduser --system --ingroup frr --home /var/run/frr/ \
278fb111 36 --gecos "FRR suite" --shell /sbin/nologin frr
02f3b051 37 sudo usermod -a -G frrvty frr
278fb111 38
d1890d04 39Download Source, configure and compile it
75ca3b11 40^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
41
42(You may prefer different options on configure statement. These are just
eb651bbc
MW
43an example.)
44
d1890d04
QY
45::
46
d6180888 47 git clone https://github.com/frrouting/frr.git frr
eb651bbc 48 cd frr
eb651bbc
MW
49 ./bootstrap.sh
50 ./configure \
8399fd9d 51 --prefix=/usr \
eb651bbc
MW
52 --enable-exampledir=/usr/share/doc/frr/examples/ \
53 --localstatedir=/var/run/frr \
54 --sbindir=/usr/lib/frr \
55 --sysconfdir=/etc/frr \
56 --enable-pimd \
57 --enable-watchfrr \
58 --enable-ospfclient=yes \
59 --enable-ospfapi=yes \
60 --enable-multipath=64 \
61 --enable-user=frr \
62 --enable-group=frr \
63 --enable-vty-group=frrvty \
64 --enable-configfile-mask=0640 \
65 --enable-logfile-mask=0640 \
66 --enable-rtadv \
eb651bbc 67 --enable-fpm \
c730652f 68 --enable-systemd=yes \
eb651bbc 69 --with-pkg-git-version \
76bd1499 70 --with-pkg-extra-version=-MyOwnFRRVersion
eb651bbc
MW
71 make
72 make check
73 sudo make install
278fb111 74
d1890d04 75Create empty FRR configuration files
75ca3b11 76^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
77
78::
278fb111 79
aa1322f9
PH
80 sudo install -m 755 -o frr -g frr -d /var/log/frr
81 sudo install -m 775 -o frr -g frrvty -d /etc/frr
82 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf
83 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf
84 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf
85 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf
86 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf
87 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf
88 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf
89 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf
90 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf
76bd1499 91 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf
aa1322f9 92 sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf
278fb111 93
d1890d04 94Enable IPv4 & IPv6 forwarding
75ca3b11 95^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
278fb111 96
d1890d04 97Edit ``/etc/sysctl.conf`` and uncomment the following values (ignore the
eb651bbc 98other settings)
278fb111 99
d1890d04
QY
100::
101
eb651bbc
MW
102 # Uncomment the next line to enable packet forwarding for IPv4
103 net.ipv4.ip_forward=1
278fb111 104
eb651bbc
MW
105 # Uncomment the next line to enable packet forwarding for IPv6
106 # Enabling this option disables Stateless Address Autoconfiguration
107 # based on Router Advertisements for this host
108 net.ipv6.conf.all.forwarding=1
278fb111 109
d1890d04 110Enable MPLS Forwarding (with Linux Kernel >= 4.5)
75ca3b11 111^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
278fb111 112
d1890d04
QY
113Edit ``/etc/sysctl.conf`` and the following lines. Make sure to add a
114line equal to ``net.mpls.conf.eth0.input`` or each interface used with
115MPLS
116
117::
278fb111 118
eb651bbc
MW
119 # Enable MPLS Label processing on all interfaces
120 net.mpls.conf.eth0.input=1
121 net.mpls.conf.eth1.input=1
122 net.mpls.conf.eth2.input=1
123 net.mpls.platform_labels=100000
278fb111 124
d1890d04 125Add MPLS kernel modules
75ca3b11 126^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
127
128Add the following lines to ``/etc/modules-load.d/modules.conf``:
278fb111 129
d1890d04 130::
278fb111 131
eb651bbc
MW
132 # Load MPLS Kernel Modules
133 mpls-router
134 mpls-iptunnel
278fb111 135
d1890d04
QY
136**Reboot** or use ``sysctl -p`` to apply the same config to the running
137system
8399fd9d 138
d1890d04 139Install the systemd service (if rebooted from last step, change directory back to frr directory)
75ca3b11 140^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8399fd9d 141
d1890d04 142::
8399fd9d 143
17fd4846
QY
144 sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service
145 sudo install -m 644 tools/etc/default/frr /etc/default/frr
146 sudo install -m 644 tools/etc/frr/daemons /etc/frr/daemons
a6e895a9
DS
147 sudo install -m 644 tools/etc/frr/daemons.conf /etc/frr/daemons.conf
148 sudo install -m 644 tools/etc/frr/frr.conf /etc/frr/frr.conf
17fd4846 149 sudo install -m 644 -o frr -g frr tools/etc/frr/vtysh.conf /etc/frr/vtysh.conf
8399fd9d 150
d1890d04 151Enable daemons
75ca3b11 152^^^^^^^^^^^^^^
d1890d04
QY
153
154| Edit ``/etc/frr/daemons`` and change the value from "no" to "yes" for
155 those daemons you want to start by systemd.
156| For example.
8399fd9d 157
d1890d04 158::
8399fd9d
HWC
159
160 zebra=yes
161 bgpd=yes
162 ospfd=yes
163 ospf6d=yes
164 ripd=yes
165 ripngd=yes
166 isisd=yes
167
d1890d04 168Enable the systemd service
75ca3b11 169^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
170
171- systemctl enable frr
172
173Start the systemd service
75ca3b11 174^^^^^^^^^^^^^^^^^^^^^^^^^
8399fd9d 175
d1890d04
QY
176- systemctl start frr
177- use ``systemctl status frr`` to check its status.