]> git.proxmox.com Git - mirror_frr.git/blob - doc/developer/building-frr-for-openbsd6.rst
Merge pull request #13464 from sri-mohan1/srib-ldpd
[mirror_frr.git] / doc / developer / building-frr-for-openbsd6.rst
1 OpenBSD 6
2 =========================================
3
4 Install required packages
5 -------------------------
6
7 Configure PKG\_PATH
8
9 ::
10
11 export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/
12
13 Add packages:
14
15 ::
16
17 pkg_add clang libcares python3
18 pkg_add git autoconf-2.69p2 automake-1.15.1 libtool bison
19 pkg_add gmake json-c py-test py-sphinx libexecinfo protobuf-c
20
21 Select Python2.7 as default (required for pytest)
22
23 ::
24
25 ln -s /usr/local/bin/python2.7 /usr/local/bin/python
26
27 .. include:: building-libyang.rst
28
29 Get FRR, compile it and install it (from Git)
30 ---------------------------------------------
31
32 **This assumes you want to build and install FRR from source and not
33 using any packages**
34
35 Add frr group and user
36 ^^^^^^^^^^^^^^^^^^^^^^
37
38 ::
39
40 groupadd -g 525 _frr
41 groupadd -g 526 _frrvty
42 useradd -g 525 -u 525 -c "FRR suite" -G _frrvty \
43 -d /nonexistent -s /sbin/nologin _frr
44
45 Download Source, configure and compile it
46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47
48 (You may prefer different options on configure statement. These are just
49 an example)
50
51 .. warning::
52
53 In openbsd the proper links for the libyang library may not have been created.
54
55 ::
56
57 ln -s /usr/lib/libyang.so.1.10.17 /usr/lib/libyang.so
58
59 .. warning::
60
61 ``openbsd`` since version 6.2 has ``clang`` as the default compiler so to
62 build frr, clang must be used (the included gcc version is very old).
63
64 ::
65
66 git clone https://github.com/frrouting/frr.git frr
67 cd frr
68 export AUTOCONF_VERSION="2.69"
69 export AUTOMAKE_VERSION="1.15"
70 ./bootstrap.sh
71 export LDFLAGS="-L/usr/local/lib"
72 export CPPFLAGS="-I/usr/local/include"
73 ./configure \
74 --sysconfdir=/etc/frr \
75 --localstatedir=/var/frr \
76 --enable-multipath=64 \
77 --enable-user=_frr \
78 --enable-group=_frr \
79 --enable-vty-group=_frrvty \
80 --enable-configfile-mask=0640 \
81 --enable-logfile-mask=0640 \
82 --enable-fpm \
83 --with-pkg-git-version \
84 --with-pkg-extra-version=-MyOwnFRRVersion \
85 CC=clang
86 gmake
87 gmake check
88 doas gmake install
89
90 Create empty FRR configuration files
91 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92
93 ::
94
95 doas mkdir /var/frr
96 doas chown _frr:_frr /var/frr
97 doas chmod 755 /var/frr
98 doas mkdir /etc/frr
99 doas touch /etc/frr/zebra.conf
100 doas touch /etc/frr/bgpd.conf
101 doas touch /etc/frr/ospfd.conf
102 doas touch /etc/frr/ospf6d.conf
103 doas touch /etc/frr/isisd.conf
104 doas touch /etc/frr/ripd.conf
105 doas touch /etc/frr/ripngd.conf
106 doas touch /etc/frr/pimd.conf
107 doas touch /etc/frr/ldpd.conf
108 doas touch /etc/frr/nhrpd.conf
109 doas chown -R _frr:_frr /etc/frr
110 doas touch /etc/frr/vtysh.conf
111 doas chown -R _frr:_frrvty /etc/frr/vtysh.conf
112 doas chmod 750 /etc/frr
113 doas chmod 640 /etc/frr/*.conf
114
115 Enable IP & IPv6 forwarding
116 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
117
118 Add the following lines to the end of ``/etc/rc.conf``:
119
120 ::
121
122 net.inet6.ip6.forwarding=1 # 1=Permit forwarding of IPv6 packets
123 net.inet6.ip6.mforwarding=1 # 1=Permit forwarding of IPv6 multicast packets
124 net.inet6.ip6.multipath=1 # 1=Enable IPv6 multipath routing
125
126 **Reboot** to apply the config to the system
127
128 Enable MPLS Forwarding
129 ^^^^^^^^^^^^^^^^^^^^^^
130
131 To enable MPLS forwarding on a given interface, use the following
132 command:
133
134 ::
135
136 doas ifconfig em0 mpls
137
138 Alternatively, to make MPLS forwarding persistent across reboots, add
139 the "mpls" keyword in the hostname.\* files of the desired interfaces.
140 Example:
141
142 ::
143
144 cat /etc/hostname.em0
145 inet 10.0.1.1 255.255.255.0 mpls
146
147 Install rc.d init files
148 ^^^^^^^^^^^^^^^^^^^^^^^
149
150 (create them in /etc/rc.d - no example are included at this time with
151 FRR source)
152
153 Example (for zebra - store as ``/etc/rc.d/frr_zebra.sh``)
154
155 ::
156
157 #!/bin/sh
158 #
159 # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $
160
161 daemon="/usr/local/sbin/zebra -d"
162
163 . /etc/rc.d/rc.subr
164
165 rc_cmd $1
166
167 Enable FRR processes
168 ^^^^^^^^^^^^^^^^^^^^
169
170 (Enable the required processes only)
171
172 ::
173
174 echo "frr_zebra=YES" >> /etc/rc.conf
175 echo "frr_bgpd=YES" >> /etc/rc.conf
176 echo "frr_ospfd=YES" >> /etc/rc.conf
177 echo "frr_ospf6d=YES" >> /etc/rc.conf
178 echo "frr_isisd=YES" >> /etc/rc.conf
179 echo "frr_ripngd=YES" >> /etc/rc.conf
180 echo "frr_ripd=YES" >> /etc/rc.conf
181 echo "frr_pimd=YES" >> /etc/rc.conf
182 echo "frr_ldpd=YES" >> /etc/rc.conf