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