1 Building FRR on NetBSD 7 from Git Source
2 ========================================
7 - MPLS is not supported on `NetBSD`. MPLS requires a Linux Kernel
8 (4.5 or higher). LDP can be built, but may have limited use
11 Install required packages
12 -------------------------
14 sudo pkgin install git autoconf automake libtool gmake gawk openssl \
15 pkg-config json-c p5-XML-LibXML python27 py27-test
17 Install SSL Root Certificates (for git https access):
19 sudo pkgin install mozilla-rootcerts
20 sudo touch /etc/openssl/openssl.cnf
21 sudo mozilla-rootcerts install
23 Select default Python and py.test
25 sudo ln -s /usr/pkg/bin/python2.7 /usr/bin/python
26 sudo ln -s /usr/pkg/bin/py.test-2.7 /usr/bin/py.test
28 Get FRR, compile it and install it (from Git)
29 ------------------------------------------------
31 ### Add frr groups and user
33 sudo groupadd -g 92 frr
34 sudo groupadd -g 93 frrvty
35 sudo useradd -g 92 -u 92 -G frrvty -c "FRR suite" \
36 -d /nonexistent -s /sbin/nologin frr
38 ### Download Source, configure and compile it
39 (You may prefer different options on configure statement. These are just
42 git clone https://github.com/freerangerouting/frr.git frr
44 git checkout stable/2.0
47 export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib"
48 export CPPFLAGS="-I/usr/pkg/include"
50 --sysconfdir=/usr/pkg/etc/frr \
51 --enable-exampledir=/usr/pkg/share/examples/frr \
52 --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
53 --localstatedir=/var/run/frr \
54 --enable-ospfclient=yes \
55 --enable-ospfapi=yes \
56 --enable-multipath=64 \
59 --enable-vty-group=frrvty \
60 --enable-configfile-mask=0640 \
61 --enable-logfile-mask=0640 \
65 --with-pkg-git-version \
66 --with-pkg-extra-version=-MyOwnFRRVersion
71 ### Create empty FRR configuration files
72 sudo mkdir /usr/pkg/etc/frr
73 sudo touch /usr/pkg/etc/frr/zebra.conf
74 sudo touch /usr/pkg/etc/frr/bgpd.conf
75 sudo touch /usr/pkg/etc/frr/ospfd.conf
76 sudo touch /usr/pkg/etc/frr/ospf6d.conf
77 sudo touch /usr/pkg/etc/frr/isisd.conf
78 sudo touch /usr/pkg/etc/frr/ripd.conf
79 sudo touch /usr/pkg/etc/frr/ripngd.conf
80 sudo touch /usr/pkg/etc/frr/pimd.conf
81 sudo chown -R frr:frr /usr/pkg/etc/frr
82 sudo touch /usr/local/etc/frr/vtysh.conf
83 sudo chown frr:frrvty /usr/pkg/etc/frr/*.conf
84 sudo chmod 640 /usr/pkg/etc/frr/*.conf
86 ### Enable IP & IPv6 forwarding
88 Add the following lines to the end of `/etc/sysctl.conf`:
90 # Routing: We need to forward packets
91 net.inet.ip.forwarding=1
92 net.inet6.ip6.forwarding=1
94 **Reboot** or use `sysctl` to apply the same config to the running system
96 ### Install rc.d init files
97 cp pkgsrc/*.sh /etc/rc.d/
98 chmod 555 /etc/rc.d/*.sh
100 ### Enable FRR processes
101 (Enable the required processes only)
103 echo "zebra=YES" >> /etc/rc.conf
104 echo "bgpd=YES" >> /etc/rc.conf
105 echo "ospfd=YES" >> /etc/rc.conf
106 echo "ospf6d=YES" >> /etc/rc.conf
107 echo "isisd=YES" >> /etc/rc.conf
108 echo "ripngd=YES" >> /etc/rc.conf
109 echo "ripd=YES" >> /etc/rc.conf
110 echo "pimd=YES" >> /etc/rc.conf