Skip to content

Commit 673bb65

Browse files
zhenggen-xulguohan
authored andcommitted
[sonic-frr]: FRR 4.0 integration with SONiC (#2099)
* FRR 4.0 integration with SONiC -- Uses SONiC FRR repo frr/4.0 (which has SONiC support) to build image -- Makefile changes to make frr4.0 builtable. -- Updated/Added FRR configuration files -- bgpd jinja template fixes To build SONiC images with FRR4.0, simply edit rules/config file and change routing stack to following: SONIC_ROUTING_STACK = frr and then build images as usual. * Used integrated-vtysh-config in FRR Changed to single template: frr.conf.j2 for configuration and added tests
1 parent 6ba2f97 commit 673bb65

File tree

20 files changed

+419
-333
lines changed

20 files changed

+419
-333
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
url = https://github.com/Azure/sonic-platform-daemons
4747
[submodule "src/sonic-frr/frr"]
4848
path = src/sonic-frr/frr
49-
url = https://github.com/FRRouting/frr.git
49+
url = https://github.com/Azure/sonic-frr.git
5050
[submodule "platform/p4/p4-hlir/p4-hlir-v1.1"]
5151
path = platform/p4/p4-hlir/p4-hlir-v1.1
5252
url = https://github.com/p4lang/p4-hlir.git

dockers/docker-fpm-frr/Dockerfile.j2

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ RUN rm -rf /debs ~/.cache
3333
COPY ["*.j2", "/usr/share/sonic/templates/"]
3434
COPY ["start.sh", "config.sh", "/usr/bin/"]
3535
COPY ["daemons", "/etc/frr/"]
36-
COPY ["debian.conf", "/etc/frr/"]
36+
COPY ["daemons.conf", "/etc/frr/"]
37+
COPY ["vtysh.conf", "/etc/frr/"]
3738

3839
ENTRYPOINT /usr/bin/config.sh \
3940
&& /usr/bin/start.sh \

dockers/docker-fpm-frr/bgpd.conf.j2

-101
This file was deleted.

dockers/docker-fpm-frr/config.sh

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/bash
22

33
mkdir -p /etc/frr
4-
sonic-cfggen -d -t /usr/share/sonic/templates/bgpd.conf.j2 >/etc/frr/bgpd.conf
5-
sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 >/etc/frr/zebra.conf
4+
sonic-cfggen -d -t /usr/share/sonic/templates/frr.conf.j2 >/etc/frr/frr.conf
65

76
sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 >/usr/sbin/bgp-isolate
87
chown root:root /usr/sbin/bgp-isolate
@@ -12,10 +11,5 @@ sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 >/usr/sbin/bgp-unisol
1211
chown root:root /usr/sbin/bgp-unisolate
1312
chmod 0755 /usr/sbin/bgp-unisolate
1413

15-
# If there's an integrated-config file, go ahead and remote it
16-
if [ -f /etc/frr/frr.conf ]; then
17-
rm -rf /etc/frr/frr.conf
18-
fi
19-
2014
mkdir -p /var/sonic
2115
echo "# Config files managed by sonic-config-engine" >/var/sonic/config_status

dockers/docker-fpm-frr/daemons

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# This file tells the quagga package which daemons to start.
1+
# This file tells the frr package which daemons to start.
22
#
33
# Entries are in the format: <daemon>=(yes|no|priority)
44
# 0, "no" = disabled
55
# 1, "yes" = highest priority
66
# 2 .. 10 = lower priorities
7-
# Read /usr/share/doc/quagga/README.Debian for details.
7+
# Read /usr/share/doc/frr/README.Debian for details.
88
#
99
# Sample configurations for these daemons can be found in
10-
# /usr/share/doc/quagga/examples/.
10+
# /usr/share/doc/frr/examples/.
1111
#
12-
# ATTENTION:
12+
# ATTENTION:
1313
#
1414
# When activation a daemon at the first time, a config file, even if it is
15-
# empty, has to be present *and* be owned by the user and group "quagga", else
16-
# the daemon will not be started by /etc/init.d/quagga. The permissions should
15+
# empty, has to be present *and* be owned by the user and group "frr", else
16+
# the daemon will not be started by /etc/init.d/frr. The permissions should
1717
# be u=rw,g=r,o=.
1818
# When using "vtysh" such a config file is also needed. It should be owned by
19-
# group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too.
19+
# group "frrvty" and set to ug=rw,o= though. Check /etc/pam.d/frr, too.
2020
#
21-
# The watchquagga daemon is always started. Per default in monitoring-only but
22-
# that can be changed via /etc/quagga/debian.conf.
21+
# The watchfrr daemon is always started. Per default in monitoring-only but
22+
# that can be changed via /etc/frr/daemons.conf.
2323
#
2424
zebra=yes
2525
bgpd=yes
@@ -28,4 +28,9 @@ ospf6d=no
2828
ripd=no
2929
ripngd=no
3030
isisd=no
31+
pimd=no
32+
ldpd=no
33+
nhrpd=no
34+
eigrpd=no
3135
babeld=no
36+
sharpd=no

dockers/docker-fpm-frr/debian.conf renamed to dockers/docker-fpm-frr/daemons.conf

+9-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ isisd_options=" --daemon -A 127.0.0.1"
1414
pimd_options=" --daemon -A 127.0.0.1"
1515
ldpd_options=" --daemon -A 127.0.0.1"
1616
nhrpd_options=" --daemon -A 127.0.0.1"
17+
eigrpd_options=" --daemon -A 127.0.0.1"
18+
babeld_options=" --daemon -A 127.0.0.1"
19+
sharpd_options=" --daemon -A 127.0.0.1"
1720

1821
# The list of daemons to watch is automatically generated by the init script.
1922
watchfrr_enable=yes
20-
watchfrr_options=(-adz -r /usr/sbin/servicebBfrrbBrestartbB%s -s /usr/sbin/servicebBfrrbBstartbB%s -k /usr/sbin/servicebBfrrbBstopbB%s -b bB -t 30)
23+
watchfrr_options=(-d -r /usr/sbin/servicebBfrrbBrestartbB%s -s /usr/sbin/servicebBfrrbBstartbB%s -k /usr/sbin/servicebBfrrbBstopbB%s -b bB -t 30)
24+
25+
# If valgrind_enable is 'yes' the frr daemons will be started via valgrind.
26+
# The use case for doing so is tracking down memory leaks, etc in frr.
27+
valgrind_enable=no
28+
valgrind=/usr/bin/valgrind

0 commit comments

Comments
 (0)