Skip to content

Commit

Permalink
[FRR] Enable SNMP support (sonic-net#2981)
Browse files Browse the repository at this point in the history
Merge to 201811 with FRR 4.0
  • Loading branch information
MichelMoriniaux authored and zhenggen-xu committed Oct 16, 2019
1 parent d23745a commit 237c4f2
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 4 deletions.
1 change: 1 addition & 0 deletions dockers/docker-fpm-frr/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ COPY ["start.sh", "config.sh", "/usr/bin/"]
COPY ["daemons", "/etc/frr/"]
COPY ["daemons.conf", "/etc/frr/"]
COPY ["vtysh.conf", "/etc/frr/"]
COPY ["snmp.conf", "/etc/snmp/frr.conf"]

ENTRYPOINT /usr/bin/config.sh \
&& /usr/bin/start.sh \
Expand Down
4 changes: 2 additions & 2 deletions dockers/docker-fpm-frr/daemons.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Check /etc/pam.d/frr if you intend to use "vtysh"!
#
vtysh_enable=yes
zebra_options=" -s 90000000 --daemon -A 127.0.0.1 -M fpm"
bgpd_options=" --daemon -A 127.0.0.1"
zebra_options=" -s 90000000 --daemon -A 127.0.0.1 -M fpm -M snmp"
bgpd_options=" --daemon -A 127.0.0.1 -M snmp"
ospfd_options=" --daemon -A 127.0.0.1"
ospf6d_options=" --daemon -A ::1"
ripd_options=" --daemon -A 127.0.0.1"
Expand Down
1 change: 1 addition & 0 deletions dockers/docker-fpm-frr/frr.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ hostname {{ DEVICE_METADATA['localhost']['hostname'] }}
password zebra
log syslog informational
log facility local4
agentx
! enable password {# {{ en_passwd }} TODO: param needed #}
{% endblock system_init %}
!
Expand Down
7 changes: 7 additions & 0 deletions dockers/docker-fpm-frr/snmp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This line allows the FRR docker to speak with the snmp container
# Make sure this line matches the one in the snmp docker
# snmp:/etc/snmp/snmpd.conf
# To verify this works you need to have a valid bgp daemon running and configured
# Check that a snmpwalk to 1.3.6.1.2.1.15 gives an output
# Further verification: 1.3.6.1.2.1.15.2.0 = INTEGER: 65000 the returned value should be the confiugred ASN
agentXSocket tcp:localhost:3161
8 changes: 8 additions & 0 deletions dockers/docker-snmp-sv2/snmpd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ load 12 10 5
#
# Run as an AgentX master agent
master agentx
# internal socket to allow extension to other docker containers
# Currently the other container using this is docker-fpm-frr
# make sure this line matches bgp:/etc/snmp/frr.conf
# please see testing procedure in the same file to verify this works
# to verify the SNMP docker side look for the following string in the log file:
# INFO snmp-subagent [ax_interface] INFO: Using agentx socket type tcp with path tcp:localhost:3161
# INFO supervisord snmp-subagent INFO:ax_interface:Using agentx socket type tcp with path tcp:localhost:3161
agentxsocket tcp:localhost:3161

#
# SysDescription pass-through
Expand Down
2 changes: 1 addition & 1 deletion rules/docker-fpm-frr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

DOCKER_FPM_FRR = docker-fpm-frr.gz
$(DOCKER_FPM_FRR)_PATH = $(DOCKERS_PATH)/docker-fpm-frr
$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(SWSS)
$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS)
$(DOCKER_FPM_FRR)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE)
SONIC_DOCKER_IMAGES += $(DOCKER_FPM_FRR)

Expand Down
14 changes: 14 additions & 0 deletions rules/frr.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,17 @@ FRR = frr_$(FRR_VERSION)-1~sonic.debian8+1_amd64.deb
$(FRR)_DEPENDS += $(LIBSNMP_DEV)
$(FRR)_SRC_PATH = $(SRC_PATH)/sonic-frr
SONIC_MAKE_DEBS += $(FRR)

FRR_PYTHONTOOLS = frr-pythontools_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_all.deb
$(eval $(call add_derived_package,$(FRR),$(FRR_PYTHONTOOLS)))

FRR_DBG = frr-dbgsym_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb
$(eval $(call add_derived_package,$(FRR),$(FRR_DBG)))

FRR_SNMP = frr-snmp_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb
$(eval $(call add_derived_package,$(FRR),$(FRR_SNMP)))

FRR_SNMP_DBG = frr-snmp-dbgsym_$(FRR_VERSION)-sonic-$(FRR_SUBVERSION)_amd64.deb
$(eval $(call add_derived_package,$(FRR),$(FRR_SNMP_DBG)))

export FRR FRR_PYTHONTOOLS FRR_DBG FRR_SNMP FRR_SNMP_DBG
1 change: 1 addition & 0 deletions src/sonic-config-engine/tests/sample_output/frr.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ hostname switch-t0
password zebra
log syslog informational
log facility local4
agentx
! enable password !
! Enable link-detect (default disabled)
interface PortChannel01
Expand Down
3 changes: 2 additions & 1 deletion src/sonic-frr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
SHELL = /bin/bash
.SHELLFLAGS += -e

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

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

Expand Down

0 comments on commit 237c4f2

Please sign in to comment.