]> git.proxmox.com Git - mirror_frr.git/blame - doc/Building_FRR_on_FreeBSD9.md
Merge pull request #1329 from opensourcerouting/debian9-pkg
[mirror_frr.git] / doc / Building_FRR_on_FreeBSD9.md
CommitLineData
278fb111
MW
1Building FRR on FreeBSD 9 from Git Source
2=========================================
3
4FreeBSD 9 restrictions:
5-----------------------
6
7- MPLS is not supported on `FreeBSD`. MPLS requires a Linux Kernel
8 (4.5 or higher). LDP can be built, but may have limited use
9 without MPLS
10
11Install required packages
12-------------------------
13
14Add packages:
eb651bbc
MW
15(Allow the install of the package managment tool if this is first package
16install and asked)
278fb111
MW
17
18 pkg install -y git autoconf automake libtool gmake gawk \
ae32b152
MW
19 pkgconf texinfo json-c bison flex py27-pytest c-ares \
20 python3
278fb111 21
eb651bbc
MW
22Make sure there is no /usr/bin/flex preinstalled (and use the newly
23installed in /usr/local/bin):
24(FreeBSD frequently provides a older flex as part of the base OS which
25takes preference in path)
26
27 rm -f /usr/bin/flex
278fb111 28
ae32b152
MW
29For building with clang (instead of gcc), upgrade clang from 3.4 default to 3.6 *This is needed to build FreeBSD packages as well - for packages clang is default* (Clang 3.4 as shipped with FreeBSD 9 crashes during compile)
30
31 pkg install clang36
32 pkg delete clang34
33 mv /usr/bin/clang /usr/bin/clang34
34 ln -s /usr/local/bin/clang36 /usr/bin/clang
35
278fb111
MW
36Get FRR, compile it and install it (from Git)
37---------------------------------------------
38
eb651bbc
MW
39**This assumes you want to build and install FRR from source and not
40using any packages**
278fb111
MW
41
42### Add frr group and user
43
eb651bbc
MW
44 pw groupadd frr -g 101
45 pw groupadd frrvty -g 102
46 pw adduser frr -g 101 -u 101 -G 102 -c "FRR suite" \
47 -d /usr/local/etc/frr -s /usr/sbin/nologin
48
49(You may prefer different options on configure statement. These are just
50an example)
51
d6180888 52 git clone https://github.com/frrouting/frr.git frr
eb651bbc 53 cd frr
d300f570 54 git checkout stable/3.0
eb651bbc
MW
55 ./bootstrap.sh
56 export MAKE=gmake
57 export LDFLAGS="-L/usr/local/lib"
58 export CPPFLAGS="-I/usr/local/include"
59 ./configure \
60 --sysconfdir=/usr/local/etc/frr \
61 --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
62 --localstatedir=/var/run/frr \
63 --prefix=/usr/local \
64 --enable-ospfclient=yes \
65 --enable-ospfapi=yes \
66 --enable-multipath=64 \
67 --enable-user=frr \
68 --enable-group=frr \
69 --enable-vty-group=frrvty \
70 --enable-configfile-mask=0640 \
71 --enable-logfile-mask=0640 \
72 --enable-rtadv \
eb651bbc
MW
73 --enable-fpm \
74 --with-pkg-git-version \
75 --with-pkg-extra-version=-MyOwnFRRVersion
76 gmake
77 gmake check
78 sudo gmake install
278fb111
MW
79
80### Create empty FRR configuration files
eb651bbc
MW
81 sudo mkdir /usr/local/etc/frr
82 sudo touch /usr/local/etc/frr/zebra.conf
83 sudo touch /usr/local/etc/frr/bgpd.conf
84 sudo touch /usr/local/etc/frr/ospfd.conf
85 sudo touch /usr/local/etc/frr/ospf6d.conf
86 sudo touch /usr/local/etc/frr/isisd.conf
87 sudo touch /usr/local/etc/frr/ripd.conf
88 sudo touch /usr/local/etc/frr/ripngd.conf
89 sudo touch /usr/local/etc/frr/pimd.conf
90 sudo chown -R frr:frr /usr/local/etc/frr
91 sudo touch /usr/local/etc/frr/vtysh.conf
92 sudo chown frr:frrvty /usr/local/etc/frr/vtysh.conf
93 sudo chmod 640 /usr/local/etc/frr/*.conf
278fb111
MW
94
95### Enable IP & IPv6 forwarding
96
97Add the following lines to the end of `/etc/sysctl.conf`:
98
eb651bbc
MW
99 # Routing: We need to forward packets
100 net.inet.ip.forwarding=1
101 net.inet6.ip6.forwarding=1
278fb111
MW
102
103**Reboot** or use `sysctl` to apply the same config to the running system