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