1 Building FRR on OpenBSD 6 from Git Source
2 =========================================
4 Install required packages
5 -------------------------
9 export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/
13 pkg_add git autoconf-2.69p2 automake-1.15p0 libtool bison
14 pkg_add gmake gawk dejagnu openssl json-c p5-XML-LibXML py-test
16 Select Python2.7 as default (required for pytest)
18 ln -s /usr/local/bin/python2.7 /usr/local/bin/python
20 Get FRR, compile it and install it (from Git)
21 ---------------------------------------------
23 **This assumes you want to build and install FRR from source and not using
26 ### Add frr group and user
29 groupadd -g 526 _frrvty
30 useradd -g 525 -u 525 -c "FRR suite" -G _frrvty \
31 -d /nonexistent -s /sbin/nologin _frr
33 ### Download Source, configure and compile it
34 (You may prefer different options on configure statement. These are just
37 git clone https://github.com/frrouting/frr.git frr
39 export AUTOCONF_VERSION="2.69"
40 export AUTOMAKE_VERSION="1.15"
42 export LDFLAGS="-L/usr/local/lib"
43 export CPPFLAGS="-I/usr/local/include"
45 --sysconfdir=/etc/frr \
46 --localstatedir=/var/frr \
48 --enable-ospfclient=yes \
49 --enable-ospfapi=yes \
50 --enable-multipath=64 \
53 --enable-vty-group=_frrvty \
54 --enable-configfile-mask=0640 \
55 --enable-logfile-mask=0640 \
59 --with-pkg-git-version \
60 --with-pkg-extra-version=-MyOwnFRRVersion
65 ### Create empty FRR configuration files
68 doas chown _frr:_frr /var/frr
69 doas chmod 755 /var/frr
71 doas touch /etc/frr/zebra.conf
72 doas touch /etc/frr/bgpd.conf
73 doas touch /etc/frr/ospfd.conf
74 doas touch /etc/frr/ospf6d.conf
75 doas touch /etc/frr/isisd.conf
76 doas touch /etc/frr/ripd.conf
77 doas touch /etc/frr/ripngd.conf
78 doas touch /etc/frr/pimd.conf
79 doas touch /etc/frr/ldpd.conf
80 doas touch /etc/frr/nhrpd.conf
81 doas chown -R _frr:_frr /etc/frr
82 doas touch /etc/frr/vtysh.conf
83 doas chown -R _frr:_frrvty /etc/frr/vtysh.conf
84 doas chmod 750 /etc/frr
85 doas chmod 640 /etc/frr/*.conf
87 ### Enable IP & IPv6 forwarding
89 Add the following lines to the end of `/etc/rc.conf`:
91 net.inet6.ip6.forwarding=1 # 1=Permit forwarding of IPv6 packets
92 net.inet6.ip6.mforwarding=1 # 1=Permit forwarding of IPv6 multicast packets
93 net.inet6.ip6.multipath=1 # 1=Enable IPv6 multipath routing
95 **Reboot** to apply the config to the system
97 ### Enable MPLS Forwarding
99 To enable MPLS forwarding on a given interface, use the following command:
101 doas ifconfig em0 mpls
103 Alternatively, to make MPLS forwarding persistent across reboots, add the "mpls"
104 keyword in the hostname.* files of the desired interfaces. Example:
106 cat /etc/hostname.em0
107 inet 10.0.1.1 255.255.255.0 mpls
109 ### Install rc.d init files
110 (create them in /etc/rc.d - no example are included at this time with
113 Example (for zebra - store as `/etc/rc.d/frr_zebra.sh`)
117 # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $
119 daemon="/usr/local/sbin/zebra -d"
125 ### Enable FRR processes
126 (Enable the required processes only)
128 echo "frr_zebra=YES" >> /etc/rc.conf
129 echo "frr_bgpd=YES" >> /etc/rc.conf
130 echo "frr_ospfd=YES" >> /etc/rc.conf
131 echo "frr_ospf6d=YES" >> /etc/rc.conf
132 echo "frr_isisd=YES" >> /etc/rc.conf
133 echo "frr_ripngd=YES" >> /etc/rc.conf
134 echo "frr_ripd=YES" >> /etc/rc.conf
135 echo "frr_pimd=YES" >> /etc/rc.conf
136 echo "frr_ldpd=YES" >> /etc/rc.conf