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