1OpenBSD 6 2========================================= 3 4Install required packages 5------------------------- 6 7Configure PKG\_PATH 8 9:: 10 11 export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/ 12 13Add packages: 14 15:: 16 17 pkg_add git autoconf-2.69p2 automake-1.15.1 libtool bison 18 pkg_add gmake json-c py-test py-sphinx libexecinfo 19 20Select Python2.7 as default (required for pytest) 21 22:: 23 24 ln -s /usr/local/bin/python2.7 /usr/local/bin/python 25 26.. include:: building-libyang.rst 27 28Get FRR, compile it and install it (from Git) 29--------------------------------------------- 30 31**This assumes you want to build and install FRR from source and not 32using any packages** 33 34Add frr group and user 35^^^^^^^^^^^^^^^^^^^^^^ 36 37:: 38 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 43 44Download Source, configure and compile it 45^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 46 47(You may prefer different options on configure statement. These are just 48an example) 49 50:: 51 52 git clone https://github.com/frrouting/frr.git frr 53 cd frr 54 export AUTOCONF_VERSION="2.69" 55 export AUTOMAKE_VERSION="1.15" 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 \ 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 \ 68 --enable-fpm \ 69 --with-pkg-git-version \ 70 --with-pkg-extra-version=-MyOwnFRRVersion 71 gmake 72 gmake check 73 doas gmake install 74 75Create empty FRR configuration files 76^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 77 78:: 79 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 99 100Enable IP & IPv6 forwarding 101^^^^^^^^^^^^^^^^^^^^^^^^^^^ 102 103Add the following lines to the end of ``/etc/rc.conf``: 104 105:: 106 107 net.inet6.ip6.forwarding=1 # 1=Permit forwarding of IPv6 packets 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 113Enable MPLS Forwarding 114^^^^^^^^^^^^^^^^^^^^^^ 115 116To enable MPLS forwarding on a given interface, use the following 117command: 118 119:: 120 121 doas ifconfig em0 mpls 122 123Alternatively, to make MPLS forwarding persistent across reboots, add 124the "mpls" keyword in the hostname.\* files of the desired interfaces. 125Example: 126 127:: 128 129 cat /etc/hostname.em0 130 inet 10.0.1.1 255.255.255.0 mpls 131 132Install rc.d init files 133^^^^^^^^^^^^^^^^^^^^^^^ 134 135(create them in /etc/rc.d - no example are included at this time with 136FRR source) 137 138Example (for zebra - store as ``/etc/rc.d/frr_zebra.sh``) 139 140:: 141 142 #!/bin/sh 143 # 144 # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $ 145 146 daemon="/usr/local/sbin/zebra -d" 147 148 . /etc/rc.d/rc.subr 149 150 rc_cmd $1 151 152Enable FRR processes 153^^^^^^^^^^^^^^^^^^^^ 154 155(Enable the required processes only) 156 157:: 158 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 168