]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_NetBSD6.md
release: FRR 3.0-rc1
[mirror_frr.git] / doc / Building_FRR_on_NetBSD6.md
1 Building FRR on NetBSD 6 from Git Source
2 ========================================
3
4 NetBSD 6 restrictions:
5 ----------------------
6
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
9 without MPLS
10
11 Install required packages
12 -------------------------
13 Configure Package location:
14
15 PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/`uname -m`/`uname -r`/All"
16 export PKG_PATH
17
18 Add packages:
19
20 sudo pkg_add git autoconf automake libtool gmake gawk openssl \
21 pkg-config json-c p5-XML-LibXML python27 py27-test python35
22
23 Install SSL Root Certificates (for git https access):
24
25 sudo pkg_add mozilla-rootcerts
26 sudo touch /etc/openssl/openssl.cnf
27 sudo mozilla-rootcerts install
28
29 Select default Python and py.test
30
31 sudo ln -s /usr/pkg/bin/python2.7 /usr/bin/python
32 sudo ln -s /usr/pkg/bin/py.test-2.7 /usr/bin/py.test
33
34 Get FRR, compile it and install it (from Git)
35 ------------------------------------------------
36
37 ### Add frr groups and user
38
39 sudo groupadd -g 92 frr
40 sudo groupadd -g 93 frrvty
41 sudo useradd -g 92 -u 92 -G frrvty -c "FRR suite" \
42 -d /nonexistent -s /sbin/nologin frr
43
44 ### Download Source, configure and compile it
45 (You may prefer different options on configure statement. These are just
46 an example)
47
48 git clone https://github.com/frrouting/frr.git frr
49 cd frr
50 ./bootstrap.sh
51 MAKE=gmake
52 export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib"
53 export CPPFLAGS="-I/usr/pkg/include"
54 ./configure \
55 --sysconfdir=/usr/pkg/etc/frr \
56 --enable-exampledir=/usr/pkg/share/examples/frr \
57 --enable-pkgsrcrcdir=/usr/pkg/share/examples/rc.d \
58 --localstatedir=/var/run/frr \
59 --enable-ospfclient=yes \
60 --enable-ospfapi=yes \
61 --enable-multipath=64 \
62 --enable-user=frr \
63 --enable-group=frr \
64 --enable-vty-group=frrvty \
65 --enable-configfile-mask=0640 \
66 --enable-logfile-mask=0640 \
67 --enable-rtadv \
68 --enable-tcp-zebra \
69 --enable-fpm \
70 --with-pkg-git-version \
71 --with-pkg-extra-version=-MyOwnFRRVersion
72 gmake
73 gmake check
74 sudo gmake install
75
76 ### Create empty FRR configuration files
77 sudo mkdir /var/log/frr
78 sudo mkdir /usr/pkg/etc/frr
79 sudo touch /usr/pkg/etc/frr/zebra.conf
80 sudo touch /usr/pkg/etc/frr/bgpd.conf
81 sudo touch /usr/pkg/etc/frr/ospfd.conf
82 sudo touch /usr/pkg/etc/frr/ospf6d.conf
83 sudo touch /usr/pkg/etc/frr/isisd.conf
84 sudo touch /usr/pkg/etc/frr/ripd.conf
85 sudo touch /usr/pkg/etc/frr/ripngd.conf
86 sudo touch /usr/pkg/etc/frr/pimd.conf
87 sudo chown -R frr:frr /usr/pkg/etc/frr
88 sudo touch /usr/local/etc/frr/vtysh.conf
89 sudo chown frr:frrvty /usr/pkg/etc/frr/*.conf
90 sudo chmod 640 /usr/pkg/etc/frr/*.conf
91
92 ### Enable IP & IPv6 forwarding
93
94 Add the following lines to the end of `/etc/sysctl.conf`:
95
96 # Routing: We need to forward packets
97 net.inet.ip.forwarding=1
98 net.inet6.ip6.forwarding=1
99
100 **Reboot** or use `sysctl` to apply the same config to the running system
101
102 ### Install rc.d init files
103 cp pkgsrc/*.sh /etc/rc.d/
104 chmod 555 /etc/rc.d/*.sh
105
106 ### Enable FRR processes
107 (Enable the required processes only)
108
109 echo "zebra=YES" >> /etc/rc.conf
110 echo "bgpd=YES" >> /etc/rc.conf
111 echo "ospfd=YES" >> /etc/rc.conf
112 echo "ospf6d=YES" >> /etc/rc.conf
113 echo "isisd=YES" >> /etc/rc.conf
114 echo "ripngd=YES" >> /etc/rc.conf
115 echo "ripd=YES" >> /etc/rc.conf
116 echo "pimd=YES" >> /etc/rc.conf