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
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
40 export LDFLAGS="-L/usr/local/lib"
41 export CPPFLAGS="-I/usr/local/include"
43 --sysconfdir=/etc/frr \
44 --localstatedir=/var/frr \
46 --enable-ospfclient=yes \
47 --enable-ospfapi=yes \
48 --enable-multipath=64 \
51 --enable-vty-group=_frrvty \
52 --enable-configfile-mask=0640 \
53 --enable-logfile-mask=0640 \
57 --with-pkg-git-version \
58 --with-pkg-extra-version=-MyOwnFRRVersion
63 ### Create empty FRR configuration files
66 sudo chown _frr:_frr /var/frr
67 sudo chmod 755 /var/frr
69 sudo touch /etc/frr/zebra.conf
70 sudo touch /etc/frr/bgpd.conf
71 sudo touch /etc/frr/ospfd.conf
72 sudo touch /etc/frr/ospf6d.conf
73 sudo touch /etc/frr/isisd.conf
74 sudo touch /etc/frr/ripd.conf
75 sudo touch /etc/frr/ripngd.conf
76 sudo touch /etc/frr/pimd.conf
77 sudo touch /etc/frr/ldpd.conf
78 sudo touch /etc/frr/nhrpd.conf
79 sudo chown -R _frr:_frr /etc/frr
80 sudo touch /etc/frr/vtysh.conf
81 sudo chown -R _frr:_frrvty /etc/frr/vtysh.conf
82 sudo chmod 750 /etc/frr
83 sudo chmod 640 /etc/frr/*.conf
85 ### Enable IP & IPv6 forwarding
87 Add the following lines to the end of `/etc/rc.conf`:
89 net.inet6.ip6.forwarding=1 # 1=Permit forwarding of IPv6 packets
90 net.inet6.ip6.mforwarding=1 # 1=Permit forwarding of IPv6 multicast packets
91 net.inet6.ip6.multipath=1 # 1=Enable IPv6 multipath routing
93 **Reboot** to apply the config to the system
95 ### Enable MPLS Forwarding
97 To enable MPLS forwarding on a given interface, use the following command:
99 sudo ifconfig em0 mpls
101 Alternatively, to make MPLS forwarding persistent across reboots, add the "mpls"
102 keyword in the hostname.* files of the desired interfaces. Example:
104 cat /etc/hostname.em0
105 inet 10.0.1.1 255.255.255.0 mpls
107 ### Install rc.d init files
108 (create them in /etc/rc.d - no example are included at this time with
111 Example (for zebra - store as `/etc/rc.d/frr_zebra.sh`)
115 # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $
117 daemon="/usr/local/sbin/zebra -d"
123 ### Enable FRR processes
124 (Enable the required processes only)
126 echo "frr_zebra=YES" >> /etc/rc.conf
127 echo "frr_bgpd=YES" >> /etc/rc.conf
128 echo "frr_ospfd=YES" >> /etc/rc.conf
129 echo "frr_ospf6d=YES" >> /etc/rc.conf
130 echo "frr_isisd=YES" >> /etc/rc.conf
131 echo "frr_ripngd=YES" >> /etc/rc.conf
132 echo "frr_ripd=YES" >> /etc/rc.conf
133 echo "frr_pimd=YES" >> /etc/rc.conf
134 echo "frr_ldpd=YES" >> /etc/rc.conf