]> git.proxmox.com Git - mirror_frr.git/blame - doc/Building_FRR_on_CentOS7.md
debian: add pkg-config to build-depends
[mirror_frr.git] / doc / Building_FRR_on_CentOS7.md
CommitLineData
278fb111
MW
1Building FRR on CentOS 7 from Git Source
2========================================
3
e3de326d
MW
4(As an alternative to this installation, you may prefer to create a FRR
5rpm package yourself and install that package instead. See instructions
6in redhat/README.rpm_build.md on how to build a rpm package)
7
278fb111
MW
8CentOS 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
15Install required packages
16-------------------------
ae32b152 17
278fb111
MW
18Add packages:
19
e3de326d
MW
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
278fb111
MW
24
25Get FRR, compile it and install it (from Git)
26---------------------------------------------
27
eb651bbc
MW
28**This assumes you want to build and install FRR from source and not using
29any packages**
278fb111
MW
30
31### Add frr groups and user
32
eb651bbc
MW
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 \
447a8fe9 36 -c "FRR FRRouting suite" -d /var/run/frr frr
278fb111
MW
37
38### Download Source, configure and compile it
eb651bbc
MW
39(You may prefer different options on configure statement. These are just
40an example.)
41
d6180888 42 git clone https://github.com/frrouting/frr.git frr
eb651bbc 43 cd frr
e3de326d 44 git checkout stable/3.0
eb651bbc
MW
45 ./bootstrap.sh
46 ./configure \
e3de326d
MW
47 --bindir=/usr/bin \
48 --sbindir=/usr/lib/frr \
eb651bbc 49 --sysconfdir=/etc/frr \
e3de326d
MW
50 --libdir=/usr/lib/frr \
51 --libexecdir=/usr/lib/frr \
eb651bbc 52 --localstatedir=/var/run/frr \
e3de326d
MW
53 --with-moduledir=/usr/lib/frr/modules \
54 --enable-pimd \
eb651bbc
MW
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 \
e3de326d 65 --disable-ldpd \
eb651bbc 66 --enable-fpm \
e3de326d 67 --enable-nhrpd \
eb651bbc 68 --with-pkg-git-version \
e3de326d 69 --with-pkg-extra-version=-MyOwnFRRVersion
eb651bbc
MW
70 make
71 make check
72 sudo make install
278fb111
MW
73
74### Create empty FRR configuration files
eb651bbc
MW
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
e3de326d 85 sudo touch /etc/frr/nhrpd.conf
eb651bbc
MW
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
278fb111 90
e3de326d
MW
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
97Look for the section with `watchfrr_enable=...` and `zebra=...` etc.
98Enable the daemons as required by changing the value to `yes`
99
278fb111
MW
100### Enable IP & IPv6 forwarding
101
eb651bbc
MW
102Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the
103following content:
278fb111
MW
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
e3de326d 111Load the modifed sysctl's on the system:
278fb111 112
e3de326d
MW
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
278fb111
MW
118
119### Register the systemd files
e3de326d
MW
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