]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_CentOS7.md
Merge remote-tracking branch 'origin/stable/2.0'
[mirror_frr.git] / doc / Building_FRR_on_CentOS7.md
1 Building FRR on CentOS 7 from Git Source
2 ========================================
3
4 CentOS 7 restrictions:
5 ----------------------
6
7 - MPLS is not supported on `CentOS 7` with default kernel. MPLS requires
8 Linux Kernel 4.5 or higher (LDP can be built, but may have limited use
9 without MPLS)
10
11 Install required packages
12 -------------------------
13
14 Add packages:
15
16 sudo yum install git autoconf automake libtool make gawk readline-devel \
17 texinfo net-snmp-devel groff pkgconfig json-c-devel pam-devel \
18 bison flex pytest c-ares-devel python-devel rpm-build
19
20 To build from git (in difference to building from distribution tar.gz as created by `make dist`), the python development libraries are needed. (Make sure you've installed EPEL libraries as shown above for this to work)
21
22 yum install python34-devel
23
24 Get FRR, compile it and install it (from Git)
25 ---------------------------------------------
26
27 **This assumes you want to build and install FRR from source and not using
28 any packages**
29
30 ### Add frr groups and user
31
32 sudo groupadd -g 92 frr
33 sudo groupadd -r -g 85 frrvt
34 sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \
35 -c "FRR FRRouting suite" -d /var/run/frr frr
36
37 ### Download Source, configure and compile it
38 (You may prefer different options on configure statement. These are just
39 an example.)
40
41 You may want to pay special attention to `/usr/lib64` paths and change
42 them if you are not building on a x86_64 architecture
43
44 git clone https://github.com/frrouting/frr.git frr
45 cd frr
46 ./bootstrap.sh
47 ./configure \
48 --sysconfdir=/etc/frr \
49 --libdir=/usr/lib64/frr \
50 --libexecdir=/usr/lib64/frr \
51 --localstatedir=/var/run/frr \
52 --enable-snmp=agentx \
53 --enable-multipath=64 \
54 --enable-ospfclient=yes \
55 --enable-ospfapi=yes \
56 --enable-user=frr \
57 --enable-group=frr \
58 --enable-vty-group=frrvt \
59 --enable-rtadv \
60 --disable-exampledir \
61 --enable-watchfrr \
62 --enable-tcp-zebra \
63 --enable-fpm \
64 --with-pkg-git-version \
65 --with-pkg-extra-version=-MyOwnFRRVersion
66 make
67 make check
68 sudo make install
69
70 ### Create empty FRR configuration files
71 sudo mkdir /var/log/frr
72 sudo mkdir /etc/frr
73 sudo touch /etc/frr/zebra.conf
74 sudo touch /etc/frr/bgpd.conf
75 sudo touch /etc/frr/ospfd.conf
76 sudo touch /etc/frr/ospf6d.conf
77 sudo touch /etc/frr/isisd.conf
78 sudo touch /etc/frr/ripd.conf
79 sudo touch /etc/frr/ripngd.conf
80 sudo touch /etc/frr/pimd.conf
81 sudo chown -R frr:frr /etc/frr/
82 sudo touch /etc/frr/vtysh.conf
83 sudo chown frr:frrvt /etc/frr/vtysh.conf
84 sudo chmod 640 /etc/frr/*.conf
85
86 ### Enable IP & IPv6 forwarding
87
88 Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the
89 following content:
90
91 # Sysctl for routing
92 #
93 # Routing: We need to forward packets
94 net.ipv4.conf.all.forwarding=1
95 net.ipv6.conf.all.forwarding=1
96
97 **Reboot** or use `sysctl` to apply the same config to the running system
98
99 ### Install Service files
100 sudo install -p -m 644 redhat/zebra.service /usr/lib/systemd/system/zebra.service
101 sudo install -p -m 644 redhat/isisd.service /usr/lib/systemd/system/isisd.service
102 sudo install -p -m 644 redhat/ripd.service /usr/lib/systemd/system/ripd.service
103 sudo install -p -m 644 redhat/ospfd.service /usr/lib/systemd/system/ospfd.service
104 sudo install -p -m 644 redhat/bgpd.service /usr/lib/systemd/system/bgpd.service
105 sudo install -p -m 644 redhat/ospf6d.service /usr/lib/systemd/system/ospf6d.service
106 sudo install -p -m 644 redhat/ripngd.service /usr/lib/systemd/system/ripngd.service
107 sudo install -p -m 644 redhat/pimd.service /usr/lib/systemd/system/pimd.service
108 sudo install -p -m 644 redhat/frr.sysconfig /etc/sysconfig/frr
109 sudo install -p -m 644 redhat/frr.logrotate /etc/logrotate.d/frr
110
111 ### Register the systemd files
112 sudo systemctl preset zebra.service
113 sudo systemctl preset ripd.service
114 sudo systemctl preset ospfd.service
115 sudo systemctl preset bgpd.service
116 sudo systemctl preset ospf6d.service
117 sudo systemctl preset ripngd.service
118 sudo systemctl preset pimd.service
119
120 ### Enable required daemons at startup
121 Only enable zebra and the daemons which are needed for your setup
122
123 sudo systemctl enable zebra
124 sudo systemctl enable ospfd
125 sudo systemctl enable bgpd
126 [...] etc (as needed)