NetBSD 6

NetBSD 6 restrictions:

  • MPLS is not supported on NetBSD. MPLS requires a Linux Kernel (4.5 or higher). LDP can be built, but may have limited use without MPLS

Install required packages

Configure Package location:

PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All"
export PKG_PATH

Add packages:

sudo pkg_add git autoconf automake libtool gmake openssl \
   pkg-config json-c py36-test python36 py36-sphinx

Install SSL Root Certificates (for git https access):

sudo pkg_add mozilla-rootcerts
sudo touch /etc/openssl/openssl.cnf
sudo mozilla-rootcerts install

FRR depends on the relatively new libyang library to provide YANG/NETCONF support. Unfortunately, most distributions do not yet offer a libyang package from their repositories. Therefore we offer two options to install this library.

Option 1: Binary Install

The FRR project builds binary libyang packages, which we offer for download here.

Warning

libyang version 0.16.105 or newer is required to build FRR.

Note

The libyang development packages need to be installed in addition to the libyang core package in order to build FRR successfully. Make sure to download and install those from the link above alongside the binary packages.

Depending on your platform, you may also need to install the PCRE development package. Typically this is libpcre-dev or pcre-devel.

Note

For Debian-based systems, the official libyang package requires recent versions of swig (3.0.12) and debhelper (11) which are only available in Debian buster (10). However, libyang packages built on Debian buster can be installed on both Debian jessie (8) and Debian stretch (9), as well as various Ubuntu systems. The python3-yang package will not work, but the other packages (libyang-dev is the one needed for FRR) will.

Option 2: Source Install

Note

Ensure that the libyang build requirements are met before continuing. Usually this entails installing cmake and libpcre-dev or pcre-devel.

git clone https://github.com/CESNET/libyang.git
cd libyang
mkdir build; cd build
cmake -DENABLE_LYD_PRIV=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr \
      -D CMAKE_BUILD_TYPE:String="Release" ..
make
sudo make install

When building libyang version 0.16.x it’s also necessary to pass the -DENABLE_CACHE=OFF parameter to cmake to work around a known bug in libyang.

Get FRR, compile it and install it (from Git)

Add frr groups and user

sudo groupadd -g 92 frr
sudo groupadd -g 93 frrvty
sudo useradd -g 92 -u 92 -G frrvty -c "FRR suite" \
    -d /nonexistent -s /sbin/nologin frr

Download Source, configure and compile it

(You may prefer different options on configure statement. These are just an example)

git clone https://github.com/frrouting/frr.git frr
cd frr
./bootstrap.sh
MAKE=gmake
export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib"
export CPPFLAGS="-I/usr/pkg/include"
./configure \
    --sysconfdir=/usr/pkg/etc/frr \
    --enable-exampledir=/usr/pkg/share/examples/frr \
    --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
    --localstatedir=/var/run/frr \
    --enable-multipath=64 \
    --enable-user=frr \
    --enable-group=frr \
    --enable-vty-group=frrvty \
    --enable-configfile-mask=0640 \
    --enable-logfile-mask=0640 \
    --enable-fpm \
    --with-pkg-git-version \
    --with-pkg-extra-version=-MyOwnFRRVersion
gmake
gmake check
sudo gmake install

Create empty FRR configuration files

sudo mkdir /var/log/frr
sudo mkdir /usr/pkg/etc/frr
sudo touch /usr/pkg/etc/frr/zebra.conf
sudo touch /usr/pkg/etc/frr/bgpd.conf
sudo touch /usr/pkg/etc/frr/ospfd.conf
sudo touch /usr/pkg/etc/frr/ospf6d.conf
sudo touch /usr/pkg/etc/frr/isisd.conf
sudo touch /usr/pkg/etc/frr/ripd.conf
sudo touch /usr/pkg/etc/frr/ripngd.conf
sudo touch /usr/pkg/etc/frr/pimd.conf
sudo chown -R frr:frr /usr/pkg/etc/frr
sudo touch /usr/local/etc/frr/vtysh.conf
sudo chown frr:frrvty /usr/pkg/etc/frr/*.conf
sudo chmod 640 /usr/pkg/etc/frr/*.conf

Enable IP & IPv6 forwarding

Add the following lines to the end of /etc/sysctl.conf:

# Routing: We need to forward packets
net.inet.ip.forwarding=1
net.inet6.ip6.forwarding=1

Reboot or use sysctl to apply the same config to the running system

Install rc.d init files

cp pkgsrc/*.sh /etc/rc.d/
chmod 555 /etc/rc.d/*.sh

Enable FRR processes

(Enable the required processes only)

echo "zebra=YES" >> /etc/rc.conf
echo "bgpd=YES" >> /etc/rc.conf
echo "ospfd=YES" >> /etc/rc.conf
echo "ospf6d=YES" >> /etc/rc.conf
echo "isisd=YES" >> /etc/rc.conf
echo "ripngd=YES" >> /etc/rc.conf
echo "ripd=YES" >> /etc/rc.conf
echo "pimd=YES" >> /etc/rc.conf