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