]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_FreeBSD9.md
Merge pull request #808 from qlyoung/vtysh-termcols
[mirror_frr.git] / doc / Building_FRR_on_FreeBSD9.md
1 Building FRR on FreeBSD 9 from Git Source
2 =========================================
3
4 FreeBSD 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
11 Install required packages
12 -------------------------
13
14 Add packages:
15 (Allow the install of the package managment tool if this is first package
16 install and asked)
17
18 pkg install -y git autoconf automake libtool gmake gawk \
19 pkgconf texinfo json-c bison flex py27-pytest c-ares \
20 python3
21
22 Make sure there is no /usr/bin/flex preinstalled (and use the newly
23 installed in /usr/local/bin):
24 (FreeBSD frequently provides a older flex as part of the base OS which
25 takes preference in path)
26
27 rm -f /usr/bin/flex
28
29 For 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
36 Get FRR, compile it and install it (from Git)
37 ---------------------------------------------
38
39 **This assumes you want to build and install FRR from source and not
40 using any packages**
41
42 ### Add frr group and user
43
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
50 an example)
51
52 git clone https://github.com/frrouting/frr.git frr
53 cd frr
54 ./bootstrap.sh
55 export MAKE=gmake
56 export LDFLAGS="-L/usr/local/lib"
57 export CPPFLAGS="-I/usr/local/include"
58 ./configure \
59 --sysconfdir=/usr/local/etc/frr \
60 --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
61 --localstatedir=/var/run/frr \
62 --prefix=/usr/local \
63 --enable-ospfclient=yes \
64 --enable-ospfapi=yes \
65 --enable-multipath=64 \
66 --enable-user=frr \
67 --enable-group=frr \
68 --enable-vty-group=frrvty \
69 --enable-configfile-mask=0640 \
70 --enable-logfile-mask=0640 \
71 --enable-rtadv \
72 --enable-tcp-zebra \
73 --enable-fpm \
74 --with-pkg-git-version \
75 --with-pkg-extra-version=-MyOwnFRRVersion
76 gmake
77 gmake check
78 sudo gmake install
79
80 ### Create empty FRR configuration files
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
94
95 ### Enable IP & IPv6 forwarding
96
97 Add the following lines to the end of `/etc/sysctl.conf`:
98
99 # Routing: We need to forward packets
100 net.inet.ip.forwarding=1
101 net.inet6.ip6.forwarding=1
102
103 **Reboot** or use `sysctl` to apply the same config to the running system