]> git.proxmox.com Git - mirror_frr.git/blame - doc/Building_FRR_on_Ubuntu1604.md
Merge remote-tracking branch 'origin/stable/2.0'
[mirror_frr.git] / doc / Building_FRR_on_Ubuntu1604.md
CommitLineData
eb651bbc 1Building 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
10Install required packages
11-------------------------
eb651bbc 12
278fb111
MW
13Add 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 \
f5374e95 17 python-pytest libc-ares-dev python3-dev libsystemd-dev
eb651bbc 18
278fb111
MW
19Get 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
23any 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
35an example.)
36
d6180888 37 git clone https://github.com/frrouting/frr.git frr
eb651bbc 38 cd frr
eb651bbc
MW
39 ./bootstrap.sh
40 ./configure \
8399fd9d 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 \
78472fc8 59 --enable-systemd=yes \
eb651bbc
MW
60 --with-pkg-git-version \
61 --with-pkg-extra-version=-MyOwnFRRVersion
62 make
63 make check
64 sudo make install
278fb111
MW
65
66### Create empty FRR configuration files
67
aa1322f9
PH
68 sudo install -m 755 -o frr -g frr -d /var/log/frr
69 sudo install -m 775 -o frr -g frrvty -d /etc/frr
70 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/zebra.conf
71 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/bgpd.conf
72 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospfd.conf
73 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ospf6d.conf
74 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/isisd.conf
75 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripd.conf
76 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ripngd.conf
77 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/pimd.conf
78 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/ldpd.conf
97b02007 79 sudo install -m 640 -o frr -g frr /dev/null /etc/frr/nhrpd.conf
aa1322f9 80 sudo install -m 640 -o frr -g frrvty /dev/null /etc/frr/vtysh.conf
278fb111
MW
81
82### Enable IP & IPv6 forwarding
83
eb651bbc
MW
84Edit `/etc/sysctl.conf` and uncomment the following values (ignore the
85other settings)
278fb111 86
eb651bbc
MW
87 # Uncomment the next line to enable packet forwarding for IPv4
88 net.ipv4.ip_forward=1
278fb111 89
eb651bbc
MW
90 # Uncomment the next line to enable packet forwarding for IPv6
91 # Enabling this option disables Stateless Address Autoconfiguration
92 # based on Router Advertisements for this host
93 net.ipv6.conf.all.forwarding=1
278fb111
MW
94
95### Enable MPLS Forwarding (with Linux Kernel >= 4.5)
96
eb651bbc
MW
97Edit `/etc/sysctl.conf` and the following lines. Make sure to add a line
98equal to `net.mpls.conf.eth0.input` or each interface used with MPLS
278fb111 99
eb651bbc
MW
100 # Enable MPLS Label processing on all interfaces
101 net.mpls.conf.eth0.input=1
102 net.mpls.conf.eth1.input=1
103 net.mpls.conf.eth2.input=1
104 net.mpls.platform_labels=100000
278fb111
MW
105
106### Add MPLS kernel modules
107
108Add the following lines to `/etc/modules-load.d/modules.conf`:
109
eb651bbc
MW
110 # Load MPLS Kernel Modules
111 mpls-router
112 mpls-iptunnel
278fb111 113
02f3b051 114**Reboot** or use `sysctl -p` to apply the same config to the running system
8399fd9d
HWC
115
116
8a77d75b 117### Install the systemd service
8399fd9d
HWC
118
119 sudo install -m 644 tools/frr.service /etc/systemd/system/frr.service
120 sudo install -m 644 cumulus/etc/default/frr /etc/default/frr
121 sudo install -m 644 cumulus/etc/frr/daemons /etc/frr/daemons
a6e895a9
DS
122 sudo install -m 644 tools/etc/frr/daemons.conf /etc/frr/daemons.conf
123 sudo install -m 644 tools/etc/frr/frr.conf /etc/frr/frr.conf
8399fd9d
HWC
124 sudo install -m 644 -o frr -g frr cumulus/etc/frr/vtysh.conf /etc/frr/vtysh.conf
125
8a77d75b 126### Enable daemons
8399fd9d
HWC
127
128Edit `/etc/frr/daemons` and change the value from "no" to "yes" for those daemons you want to start by systemd.
129For example.
130
131 zebra=yes
132 bgpd=yes
133 ospfd=yes
134 ospf6d=yes
135 ripd=yes
136 ripngd=yes
137 isisd=yes
138
8a77d75b 139### Enable the systemd serivce
78472fc8 140 - systemctl enable frr
8399fd9d 141
8a77d75b 142### Start the systemd service
8399fd9d 143- systemctl start frr
8a77d75b 144- use `systemctl status frr` to check its status.