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