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