Skip to content

Commit 237c4f2

Browse files
MichelMoriniauxzhenggen-xu
authored andcommitted
[FRR] Enable SNMP support (sonic-net#2981)
Merge to 201811 with FRR 4.0
1 parent d23745a commit 237c4f2

File tree

9 files changed

+37
-4
lines changed

9 files changed

+37
-4
lines changed

dockers/docker-fpm-frr/Dockerfile.j2

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ COPY ["start.sh", "config.sh", "/usr/bin/"]
4141
COPY ["daemons", "/etc/frr/"]
4242
COPY ["daemons.conf", "/etc/frr/"]
4343
COPY ["vtysh.conf", "/etc/frr/"]
44+
COPY ["snmp.conf", "/etc/snmp/frr.conf"]
4445

4546
ENTRYPOINT /usr/bin/config.sh \
4647
&& /usr/bin/start.sh \

dockers/docker-fpm-frr/daemons.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# Check /etc/pam.d/frr if you intend to use "vtysh"!
55
#
66
vtysh_enable=yes
7-
zebra_options=" -s 90000000 --daemon -A 127.0.0.1 -M fpm"
8-
bgpd_options=" --daemon -A 127.0.0.1"
7+
zebra_options=" -s 90000000 --daemon -A 127.0.0.1 -M fpm -M snmp"
8+
bgpd_options=" --daemon -A 127.0.0.1 -M snmp"
99
ospfd_options=" --daemon -A 127.0.0.1"
1010
ospf6d_options=" --daemon -A ::1"
1111
ripd_options=" --daemon -A 127.0.0.1"

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

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ hostname {{ DEVICE_METADATA['localhost']['hostname'] }}
1111
password zebra
1212
log syslog informational
1313
log facility local4
14+
agentx
1415
! enable password {# {{ en_passwd }} TODO: param needed #}
1516
{% endblock system_init %}
1617
!

dockers/docker-fpm-frr/snmp.conf

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This line allows the FRR docker to speak with the snmp container
2+
# Make sure this line matches the one in the snmp docker
3+
# snmp:/etc/snmp/snmpd.conf
4+
# To verify this works you need to have a valid bgp daemon running and configured
5+
# Check that a snmpwalk to 1.3.6.1.2.1.15 gives an output
6+
# Further verification: 1.3.6.1.2.1.15.2.0 = INTEGER: 65000 the returned value should be the confiugred ASN
7+
agentXSocket tcp:localhost:3161

dockers/docker-snmp-sv2/snmpd.conf.j2

+8
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ load 12 10 5
118118
#
119119
# Run as an AgentX master agent
120120
master agentx
121+
# internal socket to allow extension to other docker containers
122+
# Currently the other container using this is docker-fpm-frr
123+
# make sure this line matches bgp:/etc/snmp/frr.conf
124+
# please see testing procedure in the same file to verify this works
125+
# to verify the SNMP docker side look for the following string in the log file:
126+
# INFO snmp-subagent [ax_interface] INFO: Using agentx socket type tcp with path tcp:localhost:3161
127+
# INFO supervisord snmp-subagent INFO:ax_interface:Using agentx socket type tcp with path tcp:localhost:3161
128+
agentxsocket tcp:localhost:3161
121129

122130
#
123131
# SysDescription pass-through

rules/docker-fpm-frr.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
DOCKER_FPM_FRR = docker-fpm-frr.gz
44
$(DOCKER_FPM_FRR)_PATH = $(DOCKERS_PATH)/docker-fpm-frr
5-
$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(SWSS)
5+
$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS)
66
$(DOCKER_FPM_FRR)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
77
SONIC_DOCKER_IMAGES += $(DOCKER_FPM_FRR)
88

rules/frr.mk

+14
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,17 @@ FRR = frr_$(FRR_VERSION)-1~sonic.debian8+1_amd64.deb
77
$(FRR)_DEPENDS += $(LIBSNMP_DEV)
88
$(FRR)_SRC_PATH = $(SRC_PATH)/sonic-frr
99
SONIC_MAKE_DEBS += $(FRR)
10+
11+
FRR_PYTHONTOOLS = frr-pythontools_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_all.deb
12+
$(eval $(call add_derived_package,$(FRR),$(FRR_PYTHONTOOLS)))
13+
14+
FRR_DBG = frr-dbgsym_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb
15+
$(eval $(call add_derived_package,$(FRR),$(FRR_DBG)))
16+
17+
FRR_SNMP = frr-snmp_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb
18+
$(eval $(call add_derived_package,$(FRR),$(FRR_SNMP)))
19+
20+
FRR_SNMP_DBG = frr-snmp-dbgsym_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb
21+
$(eval $(call add_derived_package,$(FRR),$(FRR_SNMP_DBG)))
22+
23+
export FRR FRR_PYTHONTOOLS FRR_DBG FRR_SNMP FRR_SNMP_DBG

src/sonic-config-engine/tests/sample_output/frr.conf

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ hostname switch-t0
88
password zebra
99
log syslog informational
1010
log facility local4
11+
agentx
1112
! enable password !
1213
! Enable link-detect (default disabled)
1314
interface PortChannel01

src/sonic-frr/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
SHELL = /bin/bash
33
.SHELLFLAGS += -e
44

5-
MAIN_TARGET = frr_$(FRR_VERSION)-1~sonic.debian8+1_amd64.deb
5+
MAIN_TARGET = $(FRR)
6+
DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(FRR_SNMP) $(FRR_SNMP_DBG)
67

78
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
89

0 commit comments

Comments
 (0)