]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_CentOS7.md
Rename: FreeRangeRouting FRRouting
[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
19
20 Get FRR, compile it and install it (from Git)
21 ---------------------------------------------
22
23 **This assumes you want to build and install FRR from source and not using
24 any packages**
25
26 ### Add frr groups and user
27
28 sudo groupadd -g 92 frr
29 sudo groupadd -r -g 85 frrvt
30 sudo useradd -u 92 -g 92 -M -r -G frrvt -s /sbin/nologin \
31 -c "FRR FRRouting suite" -d /var/run/frr frr
32
33 ### Download Source, configure and compile it
34 (You may prefer different options on configure statement. These are just
35 an example.)
36
37 You may want to pay special attention to `/usr/lib64` paths and change
38 them if you are not building on a x86_64 architecture
39
40 git clone https://github.com/freerangerouting/frr.git frr
41 cd frr
42 git checkout stable/2.0
43 ./bootstrap.sh
44 ./configure \
45 --sysconfdir=/etc/frr \
46 --libdir=/usr/lib64/frr \
47 --libexecdir=/usr/lib64/frr \
48 --localstatedir=/var/run/frr \
49 --enable-snmp=agentx \
50 --enable-multipath=64 \
51 --enable-ospfclient=yes \
52 --enable-ospfapi=yes \
53 --enable-user=frr \
54 --enable-group=frr \
55 --enable-vty-group=frrvt \
56 --enable-rtadv \
57 --disable-exampledir \
58 --enable-watchfrr \
59 --enable-tcp-zebra \
60 --enable-fpm \
61 --with-pkg-git-version \
62 --with-pkg-extra-version=-MyOwnFRRVersion
63 make
64 make check
65 sudo make install
66
67 ### Create empty FRR configuration files
68 sudo mkdir /var/log/frr
69 sudo mkdir /etc/frr
70 sudo touch /etc/frr/zebra.conf
71 sudo touch /etc/frr/bgpd.conf
72 sudo touch /etc/frr/ospfd.conf
73 sudo touch /etc/frr/ospf6d.conf
74 sudo touch /etc/frr/isisd.conf
75 sudo touch /etc/frr/ripd.conf
76 sudo touch /etc/frr/ripngd.conf
77 sudo touch /etc/frr/pimd.conf
78 sudo chown -R frr:frr /etc/frr/
79 sudo touch /etc/frr/vtysh.conf
80 sudo chown frr:frrvt /etc/frr/vtysh.conf
81 sudo chmod 640 /etc/frr/*.conf
82
83 ### Enable IP & IPv6 forwarding
84
85 Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the
86 following content:
87
88 # Sysctl for routing
89 #
90 # Routing: We need to forward packets
91 net.ipv4.conf.all.forwarding=1
92 net.ipv6.conf.all.forwarding=1
93
94 **Reboot** or use `sysctl` to apply the same config to the running system
95
96 ### Install Service files
97 sudo install -p -m 644 redhat/zebra.service /usr/lib/systemd/system/zebra.service
98 sudo install -p -m 644 redhat/isisd.service /usr/lib/systemd/system/isisd.service
99 sudo install -p -m 644 redhat/ripd.service /usr/lib/systemd/system/ripd.service
100 sudo install -p -m 644 redhat/ospfd.service /usr/lib/systemd/system/ospfd.service
101 sudo install -p -m 644 redhat/bgpd.service /usr/lib/systemd/system/bgpd.service
102 sudo install -p -m 644 redhat/ospf6d.service /usr/lib/systemd/system/ospf6d.service
103 sudo install -p -m 644 redhat/ripngd.service /usr/lib/systemd/system/ripngd.service
104 sudo install -p -m 644 redhat/pimd.service /usr/lib/systemd/system/pimd.service
105 sudo install -p -m 644 redhat/frr.sysconfig /etc/sysconfig/frr
106 sudo install -p -m 644 redhat/frr.logrotate /etc/logrotate.d/frr
107
108 ### Register the systemd files
109 sudo systemctl preset zebra.service
110 sudo systemctl preset ripd.service
111 sudo systemctl preset ospfd.service
112 sudo systemctl preset bgpd.service
113 sudo systemctl preset ospf6d.service
114 sudo systemctl preset ripngd.service
115 sudo systemctl preset pimd.service
116
117 ### Enable required daemons at startup
118 Only enable zebra and the daemons which are needed for your setup
119
120 sudo systemctl enable zebra
121 sudo systemctl enable ospfd
122 sudo systemctl enable bgpd
123 [...] etc (as needed)