1 Building FRR on FreeBSD 9 from Git Source
2 =========================================
4 FreeBSD 9 restrictions:
5 -----------------------
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
11 Install required packages
12 -------------------------
15 (Allow the install of the package managment tool if this is first package
18 pkg install -y git autoconf automake libtool gmake gawk \
19 pkgconf texinfo json-c bison flex py27-pytest
21 Make sure there is no /usr/bin/flex preinstalled (and use the newly
22 installed in /usr/local/bin):
23 (FreeBSD frequently provides a older flex as part of the base OS which
24 takes preference in path)
28 Get FRR, compile it and install it (from Git)
29 ---------------------------------------------
31 **This assumes you want to build and install FRR from source and not
34 ### Add frr group and user
36 pw groupadd frr -g 101
37 pw groupadd frrvty -g 102
38 pw adduser frr -g 101 -u 101 -G 102 -c "FRR suite" \
39 -d /usr/local/etc/frr -s /usr/sbin/nologin
41 (You may prefer different options on configure statement. These are just
44 git clone https://github.com/freerangerouting/frr.git frr
46 git checkout stable/2.0
49 export LDFLAGS="-L/usr/local/lib"
50 export CPPFLAGS="-I/usr/local/include"
52 --sysconfdir=/usr/local/etc/frr \
53 --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
54 --localstatedir=/var/run/frr \
56 --enable-ospfclient=yes \
57 --enable-ospfapi=yes \
58 --enable-multipath=64 \
61 --enable-vty-group=frrvty \
62 --enable-configfile-mask=0640 \
63 --enable-logfile-mask=0640 \
67 --with-pkg-git-version \
68 --with-pkg-extra-version=-MyOwnFRRVersion
73 ### Create empty FRR configuration files
74 sudo mkdir /usr/local/etc/frr
75 sudo touch /usr/local/etc/frr/zebra.conf
76 sudo touch /usr/local/etc/frr/bgpd.conf
77 sudo touch /usr/local/etc/frr/ospfd.conf
78 sudo touch /usr/local/etc/frr/ospf6d.conf
79 sudo touch /usr/local/etc/frr/isisd.conf
80 sudo touch /usr/local/etc/frr/ripd.conf
81 sudo touch /usr/local/etc/frr/ripngd.conf
82 sudo touch /usr/local/etc/frr/pimd.conf
83 sudo chown -R frr:frr /usr/local/etc/frr
84 sudo touch /usr/local/etc/frr/vtysh.conf
85 sudo chown frr:frrvty /usr/local/etc/frr/vtysh.conf
86 sudo chmod 640 /usr/local/etc/frr/*.conf
88 ### Enable IP & IPv6 forwarding
90 Add the following lines to the end of `/etc/sysctl.conf`:
92 # Routing: We need to forward packets
93 net.inet.ip.forwarding=1
94 net.inet6.ip6.forwarding=1
96 **Reboot** or use `sysctl` to apply the same config to the running system