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