]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_CentOS7.md
Merge pull request #1329 from opensourcerouting/debian9-pkg
[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
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 git checkout stable/3.0
45 ./bootstrap.sh
46 ./configure \
47 --bindir=/usr/bin \
48 --sbindir=/usr/lib/frr \
49 --sysconfdir=/etc/frr \
50 --libdir=/usr/lib/frr \
51 --libexecdir=/usr/lib/frr \
52 --localstatedir=/var/run/frr \
53 --with-moduledir=/usr/lib/frr/modules \
54 --enable-pimd \
55 --enable-snmp=agentx \
56 --enable-multipath=64 \
57 --enable-ospfclient=yes \
58 --enable-ospfapi=yes \
59 --enable-user=frr \
60 --enable-group=frr \
61 --enable-vty-group=frrvt \
62 --enable-rtadv \
63 --disable-exampledir \
64 --enable-watchfrr \
65 --disable-ldpd \
66 --enable-fpm \
67 --enable-nhrpd \
68 --with-pkg-git-version \
69 --with-pkg-extra-version=-MyOwnFRRVersion
70 make
71 make check
72 sudo make install
73
74 ### Create empty FRR configuration files
75 sudo mkdir /var/log/frr
76 sudo mkdir /etc/frr
77 sudo touch /etc/frr/zebra.conf
78 sudo touch /etc/frr/bgpd.conf
79 sudo touch /etc/frr/ospfd.conf
80 sudo touch /etc/frr/ospf6d.conf
81 sudo touch /etc/frr/isisd.conf
82 sudo touch /etc/frr/ripd.conf
83 sudo touch /etc/frr/ripngd.conf
84 sudo touch /etc/frr/pimd.conf
85 sudo touch /etc/frr/nhrpd.conf
86 sudo chown -R frr:frr /etc/frr/
87 sudo touch /etc/frr/vtysh.conf
88 sudo chown frr:frrvt /etc/frr/vtysh.conf
89 sudo chmod 640 /etc/frr/*.conf
90
91 ### Install daemon config file
92 sudo install -p -m 644 redhat/daemons /etc/frr/
93 sudo chown frr:frr /etc/frr/daemons
94
95 ### Edit /etc/frr/daemons as needed to select the required daemons
96
97 Look for the section with `watchfrr_enable=...` and `zebra=...` etc.
98 Enable the daemons as required by changing the value to `yes`
99
100 ### Enable IP & IPv6 forwarding
101
102 Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the
103 following content:
104
105 # Sysctl for routing
106 #
107 # Routing: We need to forward packets
108 net.ipv4.conf.all.forwarding=1
109 net.ipv6.conf.all.forwarding=1
110
111 Load the modifed sysctl's on the system:
112
113 sudo sysctl -p /etc/sysctl.d/90-routing-sysctl.conf
114
115 ### Install frr Service and redhat init files
116 sudo install -p -m 644 redhat/frr.service /usr/lib/systemd/system/frr.service
117 sudo install -p -m 755 redhat/frr.init /usr/lib/frr/frr
118
119 ### Register the systemd files
120 sudo systemctl preset frr.service
121
122 ### Enable required frr at startup
123 sudo systemctl enable frr
124
125 ### Reboot or start FRR manually
126 sudo systemctl start frr