]>
Commit | Line | Data |
---|---|---|
d1890d04 | 1 | FreeBSD 9 |
278fb111 MW |
2 | ========================================= |
3 | ||
4 | FreeBSD 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 |
11 | Install required packages |
12 | ------------------------- | |
13 | ||
56f0bea7 | 14 | Add packages: (Allow the install of the package management tool if this |
d1890d04 QY |
15 | is first package install and asked) |
16 | ||
17 | :: | |
278fb111 | 18 | |
7d9a2e6d | 19 | pkg install -y git autoconf automake libtool gmake \ |
45da32d7 | 20 | pkgconf texinfo json-c bison flex py36-pytest c-ares \ |
5b08f6f9 | 21 | python3 py36-sphinx libexecinfo protobuf-c |
278fb111 | 22 | |
eb651bbc | 23 | Make sure there is no /usr/bin/flex preinstalled (and use the newly |
d1890d04 QY |
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 | :: | |
eb651bbc MW |
28 | |
29 | rm -f /usr/bin/flex | |
278fb111 | 30 | |
d1890d04 QY |
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 | :: | |
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 | ||
fc5a4adc RW |
43 | .. include:: building-libyang.rst |
44 | ||
278fb111 MW |
45 | Get FRR, compile it and install it (from Git) |
46 | --------------------------------------------- | |
47 | ||
eb651bbc MW |
48 | **This assumes you want to build and install FRR from source and not |
49 | using any packages** | |
278fb111 | 50 | |
d1890d04 | 51 | Add frr group and user |
75ca3b11 | 52 | ^^^^^^^^^^^^^^^^^^^^^^ |
d1890d04 QY |
53 | |
54 | :: | |
278fb111 | 55 | |
eb651bbc MW |
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 | ||
d1890d04 QY |
64 | :: |
65 | ||
d6180888 | 66 | git clone https://github.com/frrouting/frr.git frr |
eb651bbc | 67 | cd frr |
eb651bbc MW |
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 \ | |
eb651bbc MW |
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 \ | |
eb651bbc MW |
83 | --enable-fpm \ |
84 | --with-pkg-git-version \ | |
76bd1499 | 85 | --with-pkg-extra-version=-MyOwnFRRVersion |
eb651bbc MW |
86 | gmake |
87 | gmake check | |
88 | sudo gmake install | |
278fb111 | 89 | |
d1890d04 | 90 | Create empty FRR configuration files |
75ca3b11 | 91 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
d1890d04 | 92 | |
09b67c09 QY |
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 | |
d1890d04 | 108 | |
09b67c09 QY |
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 | |
278fb111 | 128 | |
d1890d04 | 129 | Enable IP & IPv6 forwarding |
75ca3b11 | 130 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
d1890d04 QY |
131 | |
132 | Add the following lines to the end of ``/etc/sysctl.conf``: | |
278fb111 | 133 | |
d1890d04 | 134 | :: |
278fb111 | 135 | |
09b67c09 QY |
136 | # Routing: We need to forward packets |
137 | net.inet.ip.forwarding=1 | |
138 | net.inet6.ip6.forwarding=1 | |
278fb111 | 139 | |
09b67c09 | 140 | **Reboot** or use ``sysctl`` to apply the same config to the running system. |