]> git.proxmox.com Git - mirror_frr.git/blame - doc/Building_FRR_on_CentOS6.md
Rename: FreeRangeRouting FRRouting
[mirror_frr.git] / doc / Building_FRR_on_CentOS6.md
CommitLineData
278fb111
MW
1Building FRR on CentOS 6 from Git Source
2========================================
3
4Instructions are tested with `CentOS 6.8` on `x86_64` platform
5
6CentOS 6 restrictions:
7----------------------
8
eb651bbc
MW
9- PIMd is not supported on `CentOS 6`. Upgrade to `CentOS 7` if PIMd is
10 needed
11- MPLS is not supported on `CentOS 6`. MPLS requires Linux Kernel 4.5 or
12 higher (LDP can be built, but may have limited use without MPLS)
278fb111
MW
13
14Install required packages
15-------------------------
eb651bbc 16
278fb111
MW
17Add packages:
18
eb651bbc
MW
19 sudo yum install git autoconf automake libtool make gawk readline-devel \
20 texinfo net-snmp-devel groff pkgconfig json-c-devel pam-devel \
21 flex pytest
278fb111 22
eb651bbc
MW
23Install newer version of bison (CentOS 6 package source is too old) from
24CentOS 7
278fb111 25
eb651bbc
MW
26 curl -O http://vault.centos.org/7.0.1406/os/Source/SPackages/bison-2.7-4.el7.src.rpm
27 rpmbuild --rebuild ./bison-2.7-4.el7.src.rpm
28 sudo yum install ./rpmbuild/RPMS/x86_64/bison-2.7-4.el6.x86_64.rpm
29 rm -rf rpmbuild
278fb111
MW
30
31Install newer version of autoconf and automake (Package versions are too old)
32
eb651bbc
MW
33 curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
34 tar xvf autoconf-2.69.tar.gz
35 cd autoconf-2.69
36 ./configure --prefix=/usr
37 make
38 sudo make install
39 cd ..
40
41 curl -O http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
42 tar xvf automake-1.15.tar.gz
43 cd automake-1.15
44 ./configure --prefix=/usr
45 make
46 sudo make install
47 cd ..
48
49Install `Python 2.7` in parallel to default 2.6 (needed for `make check` to
50run unittests).
278fb111
MW
51Pick correct EPEL based on CentOS version used. Then install current `pytest`
52
eb651bbc
MW
53 rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
54 rpm -ivh https://centos6.iuscommunity.org/ius-release.rpm
55 yum install python27 python27-pip
56 pip2.7 install pytest
278fb111 57
eb651bbc
MW
58Please note that `CentOS 6` needs to keep python pointing to version 2.6
59for `yum` to keep working, so don't create a symlink for python2.7 to python
60
278fb111
MW
61Get FRR, compile it and install it (from Git)
62---------------------------------------------
63
eb651bbc
MW
64**This assumes you want to build and install FRR from source and not using
65any packages**
278fb111
MW
66
67### Add frr groups and user
68
eb651bbc
MW
69 sudo groupadd -g 92 frr
70 sudo groupadd -r -g 85 frrvt
71 sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \
447a8fe9 72 -c "FRR FRRouting suite" -d /var/run/frr frr
278fb111
MW
73
74### Download Source, configure and compile it
eb651bbc
MW
75(You may prefer different options on configure statement. These are just
76an example.)
77
78You may want to pay special attention to `/usr/lib64` paths and change
79them if you are not building on a x86_64 architecture
80
81 git clone https://github.com/freerangerouting/frr.git frr
82 cd frr
83 git checkout stable/2.0
84 ./bootstrap.sh
85 ./configure \
86 --sysconfdir=/etc/frr \
87 --libdir=/usr/lib64/frr \
88 --libexecdir=/usr/lib64/frr \
89 --localstatedir=/var/run/frr \
90 --disable-pimd \
91 --enable-snmp=agentx \
92 --enable-multipath=64 \
93 --enable-ospfclient=yes \
94 --enable-ospfapi=yes \
95 --enable-user=frr \
96 --enable-group=frr \
97 --enable-vty-group=frrvt \
98 --enable-rtadv \
99 --disable-exampledir \
100 --enable-watchfrr \
101 --enable-tcp-zebra \
102 --enable-fpm \
103 --with-pkg-git-version \
104 --with-pkg-extra-version=-MyOwnFRRVersion
105 make
106 make check PYTHON=/usr/bin/python2.7
107 sudo make install
278fb111
MW
108
109### Create empty FRR configuration files
eb651bbc
MW
110 sudo mkdir /var/log/frr
111 sudo mkdir /etc/frr
112 sudo touch /etc/frr/zebra.conf
113 sudo touch /etc/frr/bgpd.conf
114 sudo touch /etc/frr/ospfd.conf
115 sudo touch /etc/frr/ospf6d.conf
116 sudo touch /etc/frr/isisd.conf
117 sudo touch /etc/frr/ripd.conf
118 sudo touch /etc/frr/ripngd.conf
119 sudo chown -R frr:frr /etc/frr/
120 sudo touch /etc/frr/vtysh.conf
121 sudo chown frr:frrvt /etc/frr/vtysh.conf
122 sudo chmod 640 /etc/frr/*.conf
278fb111
MW
123
124### Enable IP & IPv6 forwarding
125
eb651bbc
MW
126Edit `/etc/sysctl.conf` and set the following values (ignore the other
127settings)
278fb111 128
eb651bbc
MW
129 # Controls IP packet forwarding
130 net.ipv4.ip_forward = 1
131 net.ipv6.conf.all.forwarding=1
278fb111 132
eb651bbc
MW
133 # Controls source route verification
134 net.ipv4.conf.default.rp_filter = 0
278fb111
MW
135
136**Reboot** or use `sysctl` to apply the same config to the running system
137
138### Add init.d startup files
eb651bbc
MW
139 sudo cp redhat/bgpd.init /etc/init.d/bgpd
140 sudo cp redhat/isisd.init /etc/init.d/isisd
141 sudo cp redhat/ospfd.init /etc/init.d/ospfd
142 sudo cp redhat/ospf6d.init /etc/init.d/ospf6d
143 sudo cp redhat/ripngd.init /etc/init.d/ripngd
144 sudo cp redhat/ripd.init /etc/init.d/ripd
145 sudo cp redhat/zebra.init /etc/init.d/zebra
146 sudo chkconfig --add zebra
147 sudo chkconfig --add ripd
148 sudo chkconfig --add ripngd
149 sudo chkconfig --add ospf6d
150 sudo chkconfig --add ospfd
151 sudo chkconfig --add bgpd
152 sudo chkconfig --add isisd
278fb111
MW
153
154### Enable required daemons at startup
155Only enable zebra and the daemons which are needed for your setup
156
eb651bbc
MW
157 sudo chkconfig zebra on
158 sudo chkconfig ospfd on
159 sudo chkconfig bgpd on
160 [...] etc (as needed)