]>
Commit | Line | Data |
---|---|---|
dd54a26c MW |
1 | Building FRR on Debian 9 from Git Source |
2 | ======================================== | |
3 | ||
4 | Install required packages | |
5 | ------------------------- | |
6 | ||
7 | Add packages: | |
8 | ||
9 | sudo apt-get install git autoconf automake libtool make \ | |
10 | libreadline-dev texinfo libjson-c-dev pkg-config bison flex \ | |
11 | python-pip libc-ares-dev python3-dev python-pytest | |
12 | ||
13 | Get FRR, compile it and install it (from Git) | |
14 | --------------------------------------------- | |
15 | ||
16 | **This assumes you want to build and install FRR from source and not using | |
17 | any packages** | |
18 | ||
19 | ### Add frr groups and user | |
20 | ||
21 | sudo addgroup --system --gid 92 frr | |
22 | sudo addgroup --system --gid 85 frrvty | |
23 | sudo adduser --system --ingroup frr --home /var/run/frr/ \ | |
24 | --gecos "FRR suite" --shell /bin/false frr | |
25 | sudo usermod -a -G frrvty frr | |
26 | ||
27 | ### Download Source, configure and compile it | |
28 | (You may prefer different options on configure statement. These are just | |
29 | an example.) | |
30 | ||
31 | git clone https://github.com/frrouting/frr.git frr | |
32 | cd frr | |
33 | git checkout stable/3.0 | |
34 | ./bootstrap.sh | |
35 | ./configure \ | |
36 | --enable-exampledir=/usr/share/doc/frr/examples/ \ | |
37 | --localstatedir=/var/run/frr \ | |
38 | --sbindir=/usr/lib/frr \ | |
39 | --sysconfdir=/etc/frr \ | |
40 | --enable-vtysh \ | |
41 | --enable-isisd \ | |
42 | --enable-pimd \ | |
43 | --enable-watchfrr \ | |
44 | --enable-ospfclient=yes \ | |
45 | --enable-ospfapi=yes \ | |
46 | --enable-multipath=64 \ | |
47 | --enable-user=frr \ | |
48 | --enable-group=frr \ | |
49 | --enable-vty-group=frrvty \ | |
50 | --enable-configfile-mask=0640 \ | |
51 | --enable-logfile-mask=0640 \ | |
52 | --enable-rtadv \ | |
53 | --enable-fpm \ | |
54 | --enable-ldpd \ | |
55 | --with-pkg-git-version \ | |
56 | --with-pkg-extra-version=-MyOwnFRRVersion | |
57 | make | |
58 | make check | |
59 | sudo make install | |
60 | ||
61 | ### Create empty FRR configuration files | |
62 | ||
63 | sudo install -m 755 -o frr -g frr -d /var/log/frr | |
64 | sudo install -m 775 -o frr -g frrvty -d /etc/frr | |
65 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf | |
66 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf | |
67 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf | |
68 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf | |
69 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf | |
70 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf | |
71 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf | |
72 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf | |
73 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf | |
74 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf | |
75 | sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf | |
76 | ||
77 | ### Enable IP & IPv6 forwarding | |
78 | ||
79 | Edit `/etc/sysctl.conf` and uncomment the following values (ignore the | |
80 | other settings) | |
81 | ||
82 | # Uncomment the next line to enable packet forwarding for IPv4 | |
83 | net.ipv4.ip_forward=1 | |
84 | ||
85 | # Uncomment the next line to enable packet forwarding for IPv6 | |
86 | # Enabling this option disables Stateless Address Autoconfiguration | |
87 | # based on Router Advertisements for this host | |
88 | net.ipv6.conf.all.forwarding=1 | |
89 | ||
90 | **Reboot** or use `sysctl -p` to apply the same config to the running system | |
91 | ||
92 | ### Troubleshooting | |
93 | ||
94 | **Local state directory** | |
95 | ||
96 | The local state directory must exist and have the correct permissions applied | |
97 | for the frrouting daemons to start. In the above ./configure example the | |
98 | local state directory is set to /var/run/frr (--localstatedir=/var/run/frr) | |
99 | Debian considers /var/run/frr to be temporary and this is removed after a | |
100 | reboot. | |
101 | ||
102 | When using a different local state directory you need to create the new | |
103 | directory and change the ownership to the frr user, for example: | |
104 | ||
105 | mkdir /var/opt/frr | |
106 | chown frr /var/opt/frr | |
107 | ||
108 | **Shared library error** | |
109 | ||
110 | If you try and start any of the frrouting daemons you may see the below error | |
111 | due to the frrouting shared library directory not being found: | |
112 | ||
113 | ./zebra: error while loading shared libraries: libfrr.so.0: cannot open shared object file: No such file or directory | |
114 | ||
115 | The fix is to add the following line to /etc/ld.so.conf which will continue to | |
116 | reference the library directory after the system reboots. To load the library | |
117 | directory path immediately run the ldconfig command after adding the line to | |
118 | the file eg: | |
119 | ||
120 | echo include /usr/local/lib >> /etc/ld.so.conf | |
121 | ldconfig |