]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-freebsd9.rst
Merge pull request #13430 from opensourcerouting/feature/rip_allow-ecmp_limit
[mirror_frr.git] / doc / developer / building-frr-for-freebsd9.rst
1 FreeBSD 9
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 without
9 MPLS
10
11 Install required packages
12 -------------------------
13
14 Add packages: (Allow the install of the package management tool if this
15 is first package install and asked)
16
17 ::
18
19 pkg install -y git autoconf automake libtool gmake \
20 pkgconf texinfo json-c bison flex py36-pytest c-ares \
21 python3 py36-sphinx libexecinfo protobuf-c
22
23 Make sure there is no /usr/bin/flex preinstalled (and use the newly
24 installed in /usr/local/bin): (FreeBSD frequently provides a older flex
25 as part of the base OS which takes preference in path)
26
27 ::
28
29 rm -f /usr/bin/flex
30
31 For building with clang (instead of gcc), upgrade clang from 3.4 default
32 to 3.6 *This is needed to build FreeBSD packages as well - for packages
33 clang is default* (Clang 3.4 as shipped with FreeBSD 9 crashes during
34 compile)
35
36 ::
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
43 .. include:: building-libyang.rst
44
45 Get FRR, compile it and install it (from Git)
46 ---------------------------------------------
47
48 **This assumes you want to build and install FRR from source and not
49 using any packages**
50
51 Add frr group and user
52 ^^^^^^^^^^^^^^^^^^^^^^
53
54 ::
55
56 pw groupadd frr -g 101
57 pw groupadd frrvty -g 102
58 pw adduser frr -g 101 -u 101 -G 102 -c "FRR suite" \
59 -d /usr/local/etc/frr -s /usr/sbin/nologin
60
61 (You may prefer different options on configure statement. These are just
62 an example)
63
64 ::
65
66 git clone https://github.com/frrouting/frr.git frr
67 cd frr
68 ./bootstrap.sh
69 export MAKE=gmake
70 export LDFLAGS="-L/usr/local/lib"
71 export CPPFLAGS="-I/usr/local/include"
72 ./configure \
73 --sysconfdir=/usr/local/etc/frr \
74 --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
75 --localstatedir=/var/run/frr \
76 --prefix=/usr/local \
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-fpm \
84 --with-pkg-git-version \
85 --with-pkg-extra-version=-MyOwnFRRVersion
86 gmake
87 gmake check
88 sudo gmake install
89
90 Create empty FRR configuration files
91 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
93 .. code-block:: shell
94
95 sudo mkdir /usr/local/etc/frr
96
97 For integrated config file:
98
99 .. code-block:: shell
100
101 sudo touch /usr/local/etc/frr/frr.conf
102
103 For individual config files:
104
105 .. note:: Integrated config is preferred to individual config.
106
107 .. code-block:: shell
108
109 sudo touch /usr/local/etc/frr/babeld.conf
110 sudo touch /usr/local/etc/frr/bfdd.conf
111 sudo touch /usr/local/etc/frr/bgpd.conf
112 sudo touch /usr/local/etc/frr/eigrpd.conf
113 sudo touch /usr/local/etc/frr/isisd.conf
114 sudo touch /usr/local/etc/frr/ldpd.conf
115 sudo touch /usr/local/etc/frr/nhrpd.conf
116 sudo touch /usr/local/etc/frr/ospf6d.conf
117 sudo touch /usr/local/etc/frr/ospfd.conf
118 sudo touch /usr/local/etc/frr/pbrd.conf
119 sudo touch /usr/local/etc/frr/pimd.conf
120 sudo touch /usr/local/etc/frr/ripd.conf
121 sudo touch /usr/local/etc/frr/ripngd.conf
122 sudo touch /usr/local/etc/frr/staticd.conf
123 sudo touch /usr/local/etc/frr/zebra.conf
124 sudo chown -R frr:frr /usr/local/etc/frr/
125 sudo touch /usr/local/etc/frr/vtysh.conf
126 sudo chown frr:frrvty /usr/local/etc/frr/vtysh.conf
127 sudo chmod 640 /usr/local/etc/frr/*.conf
128
129 Enable IP & IPv6 forwarding
130 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
131
132 Add the following lines to the end of ``/etc/sysctl.conf``:
133
134 ::
135
136 # Routing: We need to forward packets
137 net.inet.ip.forwarding=1
138 net.inet6.ip6.forwarding=1
139
140 **Reboot** or use ``sysctl`` to apply the same config to the running system.