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