]> git.proxmox.com Git - mirror_frr.git/blame - doc/developer/building-frr-for-openbsd6.rst
Merge pull request #13235 from Orange-OpenSource/link-state
[mirror_frr.git] / doc / developer / building-frr-for-openbsd6.rst
CommitLineData
d1890d04 1OpenBSD 6
278fb111
MW
2=========================================
3
278fb111
MW
4Install required packages
5-------------------------
6
d1890d04
QY
7Configure PKG\_PATH
8
9::
278fb111 10
eb651bbc 11 export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/
278fb111
MW
12
13Add packages:
14
d1890d04
QY
15::
16
9af46fac 17 pkg_add clang libcares python3
6dc27574 18 pkg_add git autoconf-2.69p2 automake-1.15.1 libtool bison
5b08f6f9 19 pkg_add gmake json-c py-test py-sphinx libexecinfo protobuf-c
278fb111
MW
20
21Select Python2.7 as default (required for pytest)
22
d1890d04
QY
23::
24
eb651bbc
MW
25 ln -s /usr/local/bin/python2.7 /usr/local/bin/python
26
fc5a4adc
RW
27.. include:: building-libyang.rst
28
278fb111
MW
29Get FRR, compile it and install it (from Git)
30---------------------------------------------
31
d1890d04
QY
32**This assumes you want to build and install FRR from source and not
33using any packages**
278fb111 34
d1890d04 35Add frr group and user
75ca3b11 36^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
37
38::
278fb111 39
eb651bbc
MW
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
278fb111 44
d1890d04 45Download Source, configure and compile it
75ca3b11 46^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
47
48(You may prefer different options on configure statement. These are just
eb651bbc
MW
49an example)
50
9af46fac
JG
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
d1890d04
QY
64::
65
d6180888 66 git clone https://github.com/frrouting/frr.git frr
eb651bbc 67 cd frr
cc4dd867
RW
68 export AUTOCONF_VERSION="2.69"
69 export AUTOMAKE_VERSION="1.15"
eb651bbc
MW
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 \
eb651bbc
MW
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 \
eb651bbc 82 --enable-fpm \
eb651bbc 83 --with-pkg-git-version \
9af46fac
JG
84 --with-pkg-extra-version=-MyOwnFRRVersion \
85 CC=clang
eb651bbc
MW
86 gmake
87 gmake check
cc4dd867 88 doas gmake install
278fb111 89
d1890d04 90Create empty FRR configuration files
75ca3b11 91^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
92
93::
278fb111 94
cc4dd867
RW
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
278fb111 114
d1890d04 115Enable IP & IPv6 forwarding
75ca3b11 116^^^^^^^^^^^^^^^^^^^^^^^^^^^
278fb111 117
d1890d04
QY
118Add the following lines to the end of ``/etc/rc.conf``:
119
120::
278fb111 121
76bd1499 122 net.inet6.ip6.forwarding=1 # 1=Permit forwarding of IPv6 packets
278fb111
MW
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
d1890d04 128Enable MPLS Forwarding
75ca3b11 129^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
130
131To enable MPLS forwarding on a given interface, use the following
132command:
3048625a 133
d1890d04 134::
3048625a 135
cc4dd867 136 doas ifconfig em0 mpls
3048625a 137
d1890d04
QY
138Alternatively, to make MPLS forwarding persistent across reboots, add
139the "mpls" keyword in the hostname.\* files of the desired interfaces.
140Example:
141
142::
3048625a
RW
143
144 cat /etc/hostname.em0
145 inet 10.0.1.1 255.255.255.0 mpls
146
d1890d04 147Install rc.d init files
75ca3b11 148^^^^^^^^^^^^^^^^^^^^^^^
d1890d04
QY
149
150(create them in /etc/rc.d - no example are included at this time with
eb651bbc 151FRR source)
278fb111 152
d1890d04
QY
153Example (for zebra - store as ``/etc/rc.d/frr_zebra.sh``)
154
155::
278fb111 156
eb651bbc
MW
157 #!/bin/sh
158 #
159 # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $
d1890d04 160
eb651bbc 161 daemon="/usr/local/sbin/zebra -d"
d1890d04 162
eb651bbc 163 . /etc/rc.d/rc.subr
d1890d04 164
eb651bbc 165 rc_cmd $1
278fb111 166
d1890d04 167Enable FRR processes
75ca3b11 168^^^^^^^^^^^^^^^^^^^^
d1890d04 169
278fb111
MW
170(Enable the required processes only)
171
d1890d04
QY
172::
173
eb651bbc
MW
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