]> git.proxmox.com Git - mirror_frr.git/blame - doc/Building_FRR_on_FreeBSD11.md
Merge pull request #1690 from dslicenc/bgpd-vrf-show-cm17377
[mirror_frr.git] / doc / Building_FRR_on_FreeBSD11.md
CommitLineData
278fb111
MW
1Building FRR on FreeBSD 11 from Git Source
2==========================================
3
4FreeBSD 11 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 17
eb651bbc 18 pkg install git autoconf automake libtool gmake gawk json-c pkgconf \
ae32b152 19 bison flex py27-pytest c-ares python3
278fb111 20
eb651bbc
MW
21Make sure there is no /usr/bin/flex preinstalled (and use the newly
22installed in /usr/local/bin):
23(FreeBSD frequently provides a older flex as part of the base OS which
24takes preference in path)
25
26 rm -f /usr/bin/flex
278fb111 27
278fb111
MW
28Get FRR, compile it and install it (from Git)
29---------------------------------------------
30
eb651bbc
MW
31**This assumes you want to build and install FRR from source and not
32using any packages**
278fb111
MW
33
34### Add frr group and user
35
eb651bbc
MW
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
40
41(You may prefer different options on configure statement. These are just
42an example)
43
d6180888 44 git clone https://github.com/frrouting/frr.git frr
eb651bbc 45 cd frr
eb651bbc
MW
46 ./bootstrap.sh
47 export MAKE=gmake
48 export LDFLAGS="-L/usr/local/lib"
49 export CPPFLAGS="-I/usr/local/include"
50 ./configure \
51 --sysconfdir=/usr/local/etc/frr \
52 --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
53 --localstatedir=/var/run/frr \
54 --prefix=/usr/local \
55 --enable-ospfclient=yes \
56 --enable-ospfapi=yes \
57 --enable-multipath=64 \
58 --enable-user=frr \
59 --enable-group=frr \
60 --enable-vty-group=frrvty \
61 --enable-configfile-mask=0640 \
62 --enable-logfile-mask=0640 \
63 --enable-rtadv \
eb651bbc
MW
64 --enable-fpm \
65 --with-pkg-git-version \
66 --with-pkg-extra-version=-MyOwnFRRVersion
67 gmake
68 gmake check
69 sudo gmake install
278fb111
MW
70
71### Create empty FRR configuration files
eb651bbc
MW
72 sudo mkdir /usr/local/etc/frr
73 sudo touch /usr/local/etc/frr/zebra.conf
74 sudo touch /usr/local/etc/frr/bgpd.conf
75 sudo touch /usr/local/etc/frr/ospfd.conf
76 sudo touch /usr/local/etc/frr/ospf6d.conf
77 sudo touch /usr/local/etc/frr/isisd.conf
78 sudo touch /usr/local/etc/frr/ripd.conf
79 sudo touch /usr/local/etc/frr/ripngd.conf
80 sudo touch /usr/local/etc/frr/pimd.conf
81 sudo chown -R frr:frr /usr/local/etc/frr
82 sudo touch /usr/local/etc/frr/vtysh.conf
83 sudo chown frr:frrvty /usr/local/etc/frr/vtysh.conf
84 sudo chmod 640 /usr/local/etc/frr/*.conf
278fb111
MW
85
86### Enable IP & IPv6 forwarding
87
88Add the following lines to the end of `/etc/sysctl.conf`:
89
eb651bbc
MW
90 # Routing: We need to forward packets
91 net.inet.ip.forwarding=1
92 net.inet6.ip6.forwarding=1
278fb111
MW
93
94**Reboot** or use `sysctl` to apply the same config to the running system