]> git.proxmox.com Git - mirror_frr.git/blob - doc/Building_FRR_on_OpenBSD6.md
Merge remote-tracking branch 'origin/stable/3.0'
[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
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 ./bootstrap.sh
40 export LDFLAGS="-L/usr/local/lib"
41 export CPPFLAGS="-I/usr/local/include"
42 ./configure \
43 --sysconfdir=/etc/frr \
44 --localstatedir=/var/frr \
45 --enable-pimd \
46 --enable-ospfclient=yes \
47 --enable-ospfapi=yes \
48 --enable-multipath=64 \
49 --enable-user=_frr \
50 --enable-group=_frr \
51 --enable-vty-group=_frrvty \
52 --enable-configfile-mask=0640 \
53 --enable-logfile-mask=0640 \
54 --enable-rtadv \
55 --enable-tcp-zebra \
56 --enable-fpm \
57 --with-pkg-git-version \
58 --with-pkg-extra-version=-MyOwnFRRVersion
59 gmake
60 gmake check
61 sudo gmake install
62
63 ### Create empty FRR configuration files
64
65 sudo mkdir /var/frr
66 sudo chown _frr:_frr /var/frr
67 sudo chmod 755 /var/frr
68 sudo mkdir /etc/frr
69 sudo touch /etc/frr/zebra.conf
70 sudo touch /etc/frr/bgpd.conf
71 sudo touch /etc/frr/ospfd.conf
72 sudo touch /etc/frr/ospf6d.conf
73 sudo touch /etc/frr/isisd.conf
74 sudo touch /etc/frr/ripd.conf
75 sudo touch /etc/frr/ripngd.conf
76 sudo touch /etc/frr/pimd.conf
77 sudo touch /etc/frr/ldpd.conf
78 sudo touch /etc/frr/nhrpd.conf
79 sudo chown -R _frr:_frr /etc/frr
80 sudo touch /etc/frr/vtysh.conf
81 sudo chown -R _frr:_frrvty /etc/frr/vtysh.conf
82 sudo chmod 750 /etc/frr
83 sudo chmod 640 /etc/frr/*.conf
84
85 ### Enable IP & IPv6 forwarding
86
87 Add the following lines to the end of `/etc/rc.conf`:
88
89 net.inet6.ip6.forwarding=1 # 1=Permit forwarding of IPv6 packets
90 net.inet6.ip6.mforwarding=1 # 1=Permit forwarding of IPv6 multicast packets
91 net.inet6.ip6.multipath=1 # 1=Enable IPv6 multipath routing
92
93 **Reboot** to apply the config to the system
94
95 ### Enable MPLS Forwarding
96
97 To enable MPLS forwarding on a given interface, use the following command:
98
99 sudo ifconfig em0 mpls
100
101 Alternatively, to make MPLS forwarding persistent across reboots, add the "mpls"
102 keyword in the hostname.* files of the desired interfaces. Example:
103
104 cat /etc/hostname.em0
105 inet 10.0.1.1 255.255.255.0 mpls
106
107 ### Install rc.d init files
108 (create them in /etc/rc.d - no example are included at this time with
109 FRR source)
110
111 Example (for zebra - store as `/etc/rc.d/frr_zebra.sh`)
112
113 #!/bin/sh
114 #
115 # $OpenBSD: frr_zebra.rc,v 1.1 2013/04/18 20:29:08 sthen Exp $
116
117 daemon="/usr/local/sbin/zebra -d"
118
119 . /etc/rc.d/rc.subr
120
121 rc_cmd $1
122
123 ### Enable FRR processes
124 (Enable the required processes only)
125
126 echo "frr_zebra=YES" >> /etc/rc.conf
127 echo "frr_bgpd=YES" >> /etc/rc.conf
128 echo "frr_ospfd=YES" >> /etc/rc.conf
129 echo "frr_ospf6d=YES" >> /etc/rc.conf
130 echo "frr_isisd=YES" >> /etc/rc.conf
131 echo "frr_ripngd=YES" >> /etc/rc.conf
132 echo "frr_ripd=YES" >> /etc/rc.conf
133 echo "frr_pimd=YES" >> /etc/rc.conf
134 echo "frr_ldpd=YES" >> /etc/rc.conf