2 =========================================
4 Install required packages
5 -------------------------
11 export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/
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
21 Select Python2.7 as default (required for pytest)
25 ln -s /usr/local/bin/python2.7 /usr/local/bin/python
27 .. include:: building-libyang.rst
29 Get FRR, compile it and install it (from Git)
30 ---------------------------------------------
32 **This assumes you want to build and install FRR from source and not
35 Add frr group and user
36 ^^^^^^^^^^^^^^^^^^^^^^
41 groupadd -g 526 _frrvty
42 useradd -g 525 -u 525 -c "FRR suite" -G _frrvty \
43 -d /nonexistent -s /sbin/nologin _frr
45 Download Source, configure and compile it
46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48 (You may prefer different options on configure statement. These are just
53 In openbsd the proper links for the libyang library may not have been created.
57 ln -s /usr/lib/libyang.so.1.10.17 /usr/lib/libyang.so
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).
66 git clone https://github.com/frrouting/frr.git frr
68 export AUTOCONF_VERSION="2.69"
69 export AUTOMAKE_VERSION="1.15"
71 export LDFLAGS="-L/usr/local/lib"
72 export CPPFLAGS="-I/usr/local/include"
74 --sysconfdir=/etc/frr \
75 --localstatedir=/var/frr \
76 --enable-multipath=64 \
79 --enable-vty-group=_frrvty \
80 --enable-configfile-mask=0640 \
81 --enable-logfile-mask=0640 \
83 --with-pkg-git-version \
84 --with-pkg-extra-version=-MyOwnFRRVersion \
90 Create empty FRR configuration files
91 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96 doas chown _frr:_frr /var/frr
97 doas chmod 755 /var/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
115 Enable IP & IPv6 forwarding
116 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
118 Add the following lines to the end of ``/etc/rc.conf``:
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
126 **Reboot** to apply the config to the system
128 Enable MPLS Forwarding
129 ^^^^^^^^^^^^^^^^^^^^^^
131 To enable MPLS forwarding on a given interface, use the following
136 doas ifconfig em0 mpls
138 Alternatively, to make MPLS forwarding persistent across reboots, add
139 the "mpls" keyword in the hostname.\* files of the desired interfaces.
144 cat /etc/hostname.em0
145 inet 10.0.1.1 255.255.255.0 mpls
147 Install rc.d init files
148 ^^^^^^^^^^^^^^^^^^^^^^^
150 (create them in /etc/rc.d - no example are included at this time with
153 Example (for zebra - store as ``/etc/rc.d/frr_zebra.sh``)
159 # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $
161 daemon="/usr/local/sbin/zebra -d"
170 (Enable the required processes only)
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