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