]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-centos7.rst
doc: move rpm build doc to dev docs
[mirror_frr.git] / doc / developer / building-frr-for-centos7.rst
1 CentOS 7
2 ========================================
3
4 This document describes installation from source. If you want to build an RPM,
5 see :ref:`packaging-redhat`.
6
7 CentOS 7 restrictions:
8 ----------------------
9
10 - MPLS is not supported on ``CentOS 7`` with default kernel. MPLS
11 requires Linux Kernel 4.5 or higher (LDP can be built, but may have
12 limited use without MPLS)
13
14 Install required packages
15 -------------------------
16
17 Add packages:
18
19 ::
20
21 sudo yum install git autoconf automake libtool make gawk \
22 readline-devel texinfo net-snmp-devel groff pkgconfig \
23 json-c-devel pam-devel bison flex pytest c-ares-devel \
24 python-devel systemd-devel python-sphinx
25
26 .. include:: building-libyang.rst
27
28 Get FRR, compile it and install it (from Git)
29 ---------------------------------------------
30
31 **This assumes you want to build and install FRR from source and not
32 using any packages**
33
34 Add frr groups and user
35 ^^^^^^^^^^^^^^^^^^^^^^^
36
37 ::
38
39 sudo groupadd -g 92 frr
40 sudo groupadd -r -g 85 frrvty
41 sudo useradd -u 92 -g 92 -M -r -G frrvty -s /sbin/nologin \
42 -c "FRR FRRouting suite" -d /var/run/frr frr
43
44 Download Source, configure and compile it
45 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46
47 (You may prefer different options on configure statement. These are just
48 an example.)
49
50 ::
51
52 git clone https://github.com/frrouting/frr.git frr
53 cd frr
54 ./bootstrap.sh
55 ./configure \
56 --bindir=/usr/bin \
57 --sbindir=/usr/lib/frr \
58 --sysconfdir=/etc/frr \
59 --libdir=/usr/lib/frr \
60 --libexecdir=/usr/lib/frr \
61 --localstatedir=/var/run/frr \
62 --with-moduledir=/usr/lib/frr/modules \
63 --enable-snmp=agentx \
64 --enable-multipath=64 \
65 --enable-user=frr \
66 --enable-group=frr \
67 --enable-vty-group=frrvty \
68 --enable-systemd=yes \
69 --disable-exampledir \
70 --disable-ldpd \
71 --enable-fpm \
72 --with-pkg-git-version \
73 --with-pkg-extra-version=-MyOwnFRRVersion
74 make
75 make check
76 sudo make install
77
78 Create empty FRR configuration files
79 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
81 ::
82
83 sudo mkdir /var/log/frr
84 sudo mkdir /etc/frr
85 sudo touch /etc/frr/zebra.conf
86 sudo touch /etc/frr/bgpd.conf
87 sudo touch /etc/frr/ospfd.conf
88 sudo touch /etc/frr/ospf6d.conf
89 sudo touch /etc/frr/isisd.conf
90 sudo touch /etc/frr/ripd.conf
91 sudo touch /etc/frr/ripngd.conf
92 sudo touch /etc/frr/pimd.conf
93 sudo touch /etc/frr/nhrpd.conf
94 sudo touch /etc/frr/eigrpd.conf
95 sudo touch /etc/frr/babeld.conf
96 sudo chown -R frr:frr /etc/frr/
97 sudo touch /etc/frr/vtysh.conf
98 sudo chown frr:frrvty /etc/frr/vtysh.conf
99 sudo chmod 640 /etc/frr/*.conf
100
101 Install daemon config file
102 ^^^^^^^^^^^^^^^^^^^^^^^^^^
103
104 ::
105
106 sudo install -p -m 644 redhat/daemons /etc/frr/
107 sudo chown frr:frr /etc/frr/daemons
108
109 Edit /etc/frr/daemons as needed to select the required daemons
110 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
111
112 Look for the section with ``watchfrr_enable=...`` and ``zebra=...`` etc.
113 Enable the daemons as required by changing the value to ``yes``
114
115 Enable IP & IPv6 forwarding
116 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
117
118 Create a new file ``/etc/sysctl.d/90-routing-sysctl.conf`` with the
119 following content:
120
121 ::
122
123 # Sysctl for routing
124 #
125 # Routing: We need to forward packets
126 net.ipv4.conf.all.forwarding=1
127 net.ipv6.conf.all.forwarding=1
128
129 Load the modifed sysctl's on the system:
130
131 ::
132
133 sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
134
135 Install frr Service and redhat init files
136 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
137
138 ::
139
140 sudo install -p -m 644 redhat/frr.service /usr/lib/systemd/system/frr.service
141 sudo install -p -m 755 redhat/frr.init /usr/lib/frr/frr
142
143 Register the systemd files
144 ^^^^^^^^^^^^^^^^^^^^^^^^^^
145
146 ::
147
148 sudo systemctl preset frr.service
149
150 Enable required frr at startup
151 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
152
153 ::
154
155 sudo systemctl enable frr
156
157 Reboot or start FRR manually
158 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
159
160 ::
161
162 sudo systemctl start frr