1 Building FRR on CentOS 7 from Git Source
2 ========================================
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
11 Install required packages
12 -------------------------
16 sudo yum install git autoconf automake libtool make gawk readline-devel \
17 texinfo net-snmp-devel groff pkgconfig json-c-devel pam-devel \
20 Get FRR, compile it and install it (from Git)
21 ---------------------------------------------
23 **This assumes you want to build and install FRR from source and not using
26 ### Add frr groups and user
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
33 ### Download Source, configure and compile it
34 (You may prefer different options on configure statement. These are just
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
40 git clone https://github.com/freerangerouting/frr.git frr
42 git checkout stable/2.0
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 \
55 --enable-vty-group=frrvt \
57 --disable-exampledir \
61 --with-pkg-git-version \
62 --with-pkg-extra-version=-MyOwnFRRVersion
67 ### Create empty FRR configuration files
68 sudo mkdir /var/log/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
83 ### Enable IP & IPv6 forwarding
85 Create a new file `/etc/sysctl.d/90-routing-sysctl.conf` with the
90 # Routing: We need to forward packets
91 net.ipv4.conf.all.forwarding=1
92 net.ipv6.conf.all.forwarding=1
94 **Reboot** or use `sysctl` to apply the same config to the running system
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
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
117 ### Enable required daemons at startup
118 Only enable zebra and the daemons which are needed for your setup
120 sudo systemctl enable zebra
121 sudo systemctl enable ospfd
122 sudo systemctl enable bgpd
123 [...] etc (as needed)