]>
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 |
eb651bbc MW |
44 | ./bootstrap.sh |
45 | ./configure \ | |
46 | --enable-exampledir=/usr/share/doc/frr/examples/ \ | |
47 | --localstatedir=/var/run/frr \ | |
48 | --sbindir=/usr/lib/frr \ | |
49 | --sysconfdir=/etc/frr \ | |
50 | --enable-vtysh \ | |
51 | --enable-isisd \ | |
52 | --enable-pimd \ | |
53 | --enable-watchfrr \ | |
54 | --enable-ospfclient=yes \ | |
55 | --enable-ospfapi=yes \ | |
56 | --enable-multipath=64 \ | |
57 | --enable-user=frr \ | |
58 | --enable-group=frr \ | |
59 | --enable-vty-group=frrvty \ | |
60 | --enable-configfile-mask=0640 \ | |
61 | --enable-logfile-mask=0640 \ | |
62 | --enable-rtadv \ | |
eb651bbc | 63 | --enable-fpm \ |
aa1322f9 | 64 | --enable-ldpd \ |
eb651bbc MW |
65 | --with-pkg-git-version \ |
66 | --with-pkg-extra-version=-MyOwnFRRVersion | |
67 | make | |
68 | make check | |
69 | sudo make install | |
278fb111 MW |
70 | |
71 | ### Create empty FRR configuration files | |
aa1322f9 | 72 | |
eb651bbc MW |
73 | sudo install -m 755 -o frr -g frr -d /var/log/frr |
74 | sudo install -m 775 -o frr -g frrvty -d /etc/frr | |
75 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf | |
76 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf | |
77 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf | |
78 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf | |
79 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf | |
80 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf | |
81 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf | |
82 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf | |
aa1322f9 | 83 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf |
97b02007 | 84 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf |
eb651bbc | 85 | sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf |
278fb111 MW |
86 | |
87 | ### Enable IP & IPv6 forwarding | |
88 | ||
86fb2ae8 | 89 | Edit `/etc/sysctl.conf` and uncomment the following values (ignore the |
eb651bbc | 90 | other settings) |
278fb111 | 91 | |
eb651bbc MW |
92 | # Uncomment the next line to enable packet forwarding for IPv4 |
93 | net.ipv4.ip_forward=1 | |
278fb111 | 94 | |
eb651bbc MW |
95 | # Uncomment the next line to enable packet forwarding for IPv6 |
96 | # Enabling this option disables Stateless Address Autoconfiguration | |
97 | # based on Router Advertisements for this host | |
98 | net.ipv6.conf.all.forwarding=1 | |
278fb111 | 99 | |
02f3b051 | 100 | **Reboot** or use `sysctl -p` to apply the same config to the running system |
86fb2ae8 AF |
101 | |
102 | ### Troubleshooting | |
103 | ||
104 | **Local state directory** | |
105 | ||
106 | The local state directory must exist and have the correct permissions applied | |
107 | for the frrouting daemons to start. In the above ./configure example the | |
108 | local state directory is set to /var/run/frr (--localstatedir=/var/run/frr) | |
109 | Debian considers /var/run/frr to be temporary and this is removed after a | |
110 | reboot. | |
111 | ||
112 | When using a different local state directory you need to create the new | |
113 | directory and change the ownership to the frr user, for example: | |
114 | ||
115 | mkdir /var/opt/frr | |
116 | chown frr /var/opt/frr | |
117 | ||
118 | **Shared library error** | |
119 | ||
120 | If you try and start any of the frrouting daemons you may see the below error | |
121 | due to the frrouting shared library directory not being found: | |
122 | ||
123 | ./zebra: error while loading shared libraries: libfrr.so.0: cannot open shared object file: No such file or directory | |
124 | ||
125 | The fix is to add the following line to /etc/ld.so.conf which will continue to | |
126 | reference the library directory after the system reboots. To load the library | |
127 | directory path immediately run the ldconfig command after adding the line to | |
128 | the file eg: | |
129 | ||
130 | echo include /usr/local/lib >> /etc/ld.so.conf | |
131 | ldconfig |