]>
Commit | Line | Data |
---|---|---|
eb651bbc | 1 | Building FRR on Ubuntu 16.04LTS from Git Source |
278fb111 MW |
2 | =============================================== |
3 | ||
eb651bbc | 4 | - MPLS is not supported on `Ubuntu 16.04` with default kernel. MPLS requires |
278fb111 MW |
5 | Linux Kernel 4.5 or higher (LDP can be built, but may have limited use |
6 | without MPLS) | |
eb651bbc MW |
7 | For an updated Ubuntu Kernel, see |
8 | http://kernel.ubuntu.com/~kernel-ppa/mainline/ | |
278fb111 MW |
9 | |
10 | Install required packages | |
11 | ------------------------- | |
eb651bbc | 12 | |
278fb111 MW |
13 | Add packages: |
14 | ||
eb651bbc MW |
15 | apt-get install git autoconf automake libtool make gawk libreadline-dev \ |
16 | texinfo dejagnu pkg-config libpam0g-dev libjson-c-dev bison flex \ | |
ae32b152 | 17 | python-pytest libc-ares-dev python3-dev |
eb651bbc | 18 | |
278fb111 MW |
19 | Get FRR, compile it and install it (from Git) |
20 | --------------------------------------------- | |
21 | ||
eb651bbc MW |
22 | **This assumes you want to build and install FRR from source and not using |
23 | any packages** | |
278fb111 MW |
24 | |
25 | ### Add frr groups and user | |
26 | ||
eb651bbc MW |
27 | sudo groupadd -g 92 frr |
28 | sudo groupadd -r -g 85 frrvty | |
02f3b051 | 29 | sudo adduser --system --ingroup frr --home /var/run/frr/ \ |
278fb111 | 30 | --gecos "FRR suite" --shell /sbin/nologin frr |
02f3b051 | 31 | sudo usermod -a -G frrvty frr |
278fb111 MW |
32 | |
33 | ### Download Source, configure and compile it | |
eb651bbc MW |
34 | (You may prefer different options on configure statement. These are just |
35 | an example.) | |
36 | ||
d6180888 | 37 | git clone https://github.com/frrouting/frr.git frr |
eb651bbc | 38 | cd frr |
eb651bbc MW |
39 | ./bootstrap.sh |
40 | ./configure \ | |
c3982458 | 41 | --prefix=/usr \ |
eb651bbc MW |
42 | --enable-exampledir=/usr/share/doc/frr/examples/ \ |
43 | --localstatedir=/var/run/frr \ | |
44 | --sbindir=/usr/lib/frr \ | |
45 | --sysconfdir=/etc/frr \ | |
46 | --enable-pimd \ | |
47 | --enable-watchfrr \ | |
48 | --enable-ospfclient=yes \ | |
49 | --enable-ospfapi=yes \ | |
50 | --enable-multipath=64 \ | |
51 | --enable-user=frr \ | |
52 | --enable-group=frr \ | |
53 | --enable-vty-group=frrvty \ | |
54 | --enable-configfile-mask=0640 \ | |
55 | --enable-logfile-mask=0640 \ | |
56 | --enable-rtadv \ | |
57 | --enable-tcp-zebra \ | |
58 | --enable-fpm \ | |
eb651bbc MW |
59 | --with-pkg-git-version \ |
60 | --with-pkg-extra-version=-MyOwnFRRVersion | |
61 | make | |
62 | make check | |
63 | sudo make install | |
278fb111 MW |
64 | |
65 | ### Create empty FRR configuration files | |
66 | ||
aa1322f9 PH |
67 | sudo install -m 755 -o frr -g frr -d /var/log/frr |
68 | sudo install -m 775 -o frr -g frrvty -d /etc/frr | |
69 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf | |
70 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf | |
71 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf | |
72 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf | |
73 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf | |
74 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf | |
75 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf | |
76 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf | |
77 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf | |
97b02007 | 78 | sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf |
aa1322f9 | 79 | sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf |
278fb111 MW |
80 | |
81 | ### Enable IP & IPv6 forwarding | |
82 | ||
eb651bbc MW |
83 | Edit `/etc/sysctl.conf` and uncomment the following values (ignore the |
84 | other settings) | |
278fb111 | 85 | |
eb651bbc MW |
86 | # Uncomment the next line to enable packet forwarding for IPv4 |
87 | net.ipv4.ip_forward=1 | |
278fb111 | 88 | |
eb651bbc MW |
89 | # Uncomment the next line to enable packet forwarding for IPv6 |
90 | # Enabling this option disables Stateless Address Autoconfiguration | |
91 | # based on Router Advertisements for this host | |
92 | net.ipv6.conf.all.forwarding=1 | |
278fb111 MW |
93 | |
94 | ### Enable MPLS Forwarding (with Linux Kernel >= 4.5) | |
95 | ||
eb651bbc MW |
96 | Edit `/etc/sysctl.conf` and the following lines. Make sure to add a line |
97 | equal to `net.mpls.conf.eth0.input` or each interface used with MPLS | |
278fb111 | 98 | |
eb651bbc MW |
99 | # Enable MPLS Label processing on all interfaces |
100 | net.mpls.conf.eth0.input=1 | |
101 | net.mpls.conf.eth1.input=1 | |
102 | net.mpls.conf.eth2.input=1 | |
103 | net.mpls.platform_labels=100000 | |
278fb111 MW |
104 | |
105 | ### Add MPLS kernel modules | |
106 | ||
107 | Add the following lines to `/etc/modules-load.d/modules.conf`: | |
108 | ||
eb651bbc MW |
109 | # Load MPLS Kernel Modules |
110 | mpls-router | |
111 | mpls-iptunnel | |
278fb111 | 112 | |
02f3b051 | 113 | **Reboot** or use `sysctl -p` to apply the same config to the running system |
c3982458 HWC |
114 | |
115 | ||
8395883b | 116 | ### Install the systemd service |
c3982458 HWC |
117 | |
118 | sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service | |
119 | sudo install -m 644 cumulus/etc/default/frr /etc/default/frr | |
120 | sudo install -m 644 cumulus/etc/frr/daemons /etc/frr/daemons | |
121 | sudo install -m 644 cumulus/etc/frr/debian.conf /etc/frr/debian.conf | |
122 | sudo install -m 644 cumulus/etc/frr/Frr.conf /etc/frr/Frr.conf | |
123 | sudo install -m 644 -o frr -g frr cumulus/etc/frr/vtysh.conf /etc/frr/vtysh.conf | |
124 | ||
8395883b | 125 | ### Enable daemons |
c3982458 HWC |
126 | |
127 | Edit `/etc/frr/daemons` and change the value from "no" to "yes" for those daemons you want to start by systemd. | |
128 | For example. | |
129 | ||
130 | zebra=yes | |
131 | bgpd=yes | |
132 | ospfd=yes | |
133 | ospf6d=yes | |
134 | ripd=yes | |
135 | ripngd=yes | |
136 | isisd=yes | |
137 | ||
8395883b | 138 | ### Enable the systemd serivce |
c3982458 HWC |
139 | Edit `/etc/systemd/system/frr.service` and remove the line **OnFailure=heartbeat-failed@%n.service** |
140 | For example. | |
141 | ||
142 | [Unit] | |
143 | Description=Cumulus Linux FRR | |
144 | After=syslog.target networking.service | |
145 | ||
8395883b | 146 | ### Start the systemd service |
c3982458 | 147 | - systemctl start frr |
8395883b | 148 | - use `systemctl status frr` to check its status. |