]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_CentOS7.md
Merge branch 'stable/3.0' into tmp-3.0-master-merge
[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 --enable-tcp-zebra \
65 --disable-ldpd \
66 --enable-fpm \
67 --enable-nhrpd \
68 --enable-eigrpd \
69 --enable-babeld \
70 --with-pkg-git-version \
71 --with-pkg-extra-version=-MyOwnFRRVersion
72 make
73 make check
74 sudo make install
75
76 ### Create empty FRR configuration files
77 sudo mkdir /var/log/frr
78 sudo mkdir /etc/frr
79 sudo touch /etc/frr/zebra.conf
80 sudo touch /etc/frr/bgpd.conf
81 sudo touch /etc/frr/ospfd.conf
82 sudo touch /etc/frr/ospf6d.conf
83 sudo touch /etc/frr/isisd.conf
84 sudo touch /etc/frr/ripd.conf
85 sudo touch /etc/frr/ripngd.conf
86 sudo touch /etc/frr/pimd.conf
87 sudo touch /etc/frr/nhrpd.conf
88 sudo touch /etc/frr/eigrpd.conf
89 sudo touch /etc/frr/babeld.conf
90 sudo chown -R frr:frr /etc/frr/
91 sudo touch /etc/frr/vtysh.conf
92 sudo chown frr:frrvt /etc/frr/vtysh.conf
93 sudo chmod 640 /etc/frr/*.conf
94
95 ### Install daemon config file
96 sudo install -p -m 644 redhat/daemons /etc/frr/
97 sudo chown frr:frr /etc/frr/daemons
98
99 ### Edit /etc/frr/daemons as needed to select the required daemons
100
101 Look for the section with `watchfrr_enable=...` and `zebra=...` etc.
102 Enable the daemons as required by changing the value to `yes`
103
104 ### Enable IP & IPv6 forwarding
105
106 Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the
107 following content:
108
109 # Sysctl for routing
110 #
111 # Routing: We need to forward packets
112 net.ipv4.conf.all.forwarding=1
113 net.ipv6.conf.all.forwarding=1
114
115 Load the modifed sysctl's on the system:
116
117 sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
118
119 ### Install frr Service and redhat init files
120 sudo install -p -m 644 redhat/frr.service /usr/lib/systemd/system/frr.service
121 sudo install -p -m 755 redhat/frr.init /usr/lib/frr/frr
122
123 ### Register the systemd files
124 sudo systemctl preset frr.service
125
126 ### Enable required frr at startup
127 sudo systemctl enable frr
128
129 ### Reboot or start FRR manually
130 sudo systemctl start frr