]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_OpenBSD6.md
Merge pull request #1126 from subsecond/patch-2
[mirror_frr.git] / doc / Building_FRR_on_OpenBSD6.md
1 Building FRR on OpenBSD 6 from Git Source
2 =========================================
3
4 Install required packages
5 -------------------------
6
7 Configure PKG_PATH
8
9 export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/
10
11 Add packages:
12
13 pkg_add git autoconf-2.69p2 automake-1.15p0 libtool bison
14 pkg_add gmake gawk dejagnu openssl json-c p5-XML-LibXML py-test
15
16 Select Python2.7 as default (required for pytest)
17
18 ln -s /usr/local/bin/python2.7 /usr/local/bin/python
19
20 Get FRR, compile it and install it (from Git)
21 ---------------------------------------------
22
23 **This assumes you want to build and install FRR from source and not using
24 any packages**
25
26 ### Add frr group and user
27
28 groupadd -g 525 _frr
29 groupadd -g 526 _frrvty
30 useradd -g 525 -u 525 -c "FRR suite" -G _frrvty \
31 -d /nonexistent -s /sbin/nologin _frr
32
33 ### Download Source, configure and compile it
34 (You may prefer different options on configure statement. These are just
35 an example)
36
37 git clone https://github.com/frrouting/frr.git frr
38 cd frr
39 export AUTOCONF_VERSION="2.69"
40 export AUTOMAKE_VERSION="1.15"
41 ./bootstrap.sh
42 export LDFLAGS="-L/usr/local/lib"
43 export CPPFLAGS="-I/usr/local/include"
44 ./configure \
45 --sysconfdir=/etc/frr \
46 --localstatedir=/var/frr \
47 --enable-pimd \
48 --enable-ospfclient=yes \
49 --enable-ospfapi=yes \
50 --enable-multipath=64 \
51 --enable-user=_frr \
52 --enable-group=_frr \
53 --enable-vty-group=_frrvty \
54 --enable-configfile-mask=0640 \
55 --enable-logfile-mask=0640 \
56 --enable-rtadv \
57 --enable-tcp-zebra \
58 --enable-fpm \
59 --with-pkg-git-version \
60 --with-pkg-extra-version=-MyOwnFRRVersion
61 gmake
62 gmake check
63 doas gmake install
64
65 ### Create empty FRR configuration files
66
67 doas mkdir /var/frr
68 doas chown _frr:_frr /var/frr
69 doas chmod 755 /var/frr
70 doas mkdir /etc/frr
71 doas touch /etc/frr/zebra.conf
72 doas touch /etc/frr/bgpd.conf
73 doas touch /etc/frr/ospfd.conf
74 doas touch /etc/frr/ospf6d.conf
75 doas touch /etc/frr/isisd.conf
76 doas touch /etc/frr/ripd.conf
77 doas touch /etc/frr/ripngd.conf
78 doas touch /etc/frr/pimd.conf
79 doas touch /etc/frr/ldpd.conf
80 doas touch /etc/frr/nhrpd.conf
81 doas chown -R _frr:_frr /etc/frr
82 doas touch /etc/frr/vtysh.conf
83 doas chown -R _frr:_frrvty /etc/frr/vtysh.conf
84 doas chmod 750 /etc/frr
85 doas chmod 640 /etc/frr/*.conf
86
87 ### Enable IP & IPv6 forwarding
88
89 Add the following lines to the end of `/etc/rc.conf`:
90
91 net.inet6.ip6.forwarding=1 # 1=Permit forwarding of IPv6 packets
92 net.inet6.ip6.mforwarding=1 # 1=Permit forwarding of IPv6 multicast packets
93 net.inet6.ip6.multipath=1 # 1=Enable IPv6 multipath routing
94
95 **Reboot** to apply the config to the system
96
97 ### Enable MPLS Forwarding
98
99 To enable MPLS forwarding on a given interface, use the following command:
100
101 doas ifconfig em0 mpls
102
103 Alternatively, to make MPLS forwarding persistent across reboots, add the "mpls"
104 keyword in the hostname.* files of the desired interfaces. Example:
105
106 cat /etc/hostname.em0
107 inet 10.0.1.1 255.255.255.0 mpls
108
109 ### Install rc.d init files
110 (create them in /etc/rc.d - no example are included at this time with
111 FRR source)
112
113 Example (for zebra - store as `/etc/rc.d/frr_zebra.sh`)
114
115 #!/bin/sh
116 #
117 # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $
118
119 daemon="/usr/local/sbin/zebra -d"
120
121 . /etc/rc.d/rc.subr
122
123 rc_cmd $1
124
125 ### Enable FRR processes
126 (Enable the required processes only)
127
128 echo "frr_zebra=YES" >> /etc/rc.conf
129 echo "frr_bgpd=YES" >> /etc/rc.conf
130 echo "frr_ospfd=YES" >> /etc/rc.conf
131 echo "frr_ospf6d=YES" >> /etc/rc.conf
132 echo "frr_isisd=YES" >> /etc/rc.conf
133 echo "frr_ripngd=YES" >> /etc/rc.conf
134 echo "frr_ripd=YES" >> /etc/rc.conf
135 echo "frr_pimd=YES" >> /etc/rc.conf
136 echo "frr_ldpd=YES" >> /etc/rc.conf