diff --git a/dockers/docker-fpm-frr/Dockerfile.j2 b/dockers/docker-fpm-frr/Dockerfile.j2 index 748c9b29a5ff..e6abef67aca2 100644 --- a/dockers/docker-fpm-frr/Dockerfile.j2 +++ b/dockers/docker-fpm-frr/Dockerfile.j2 @@ -41,5 +41,6 @@ RUN rm -rf /debs ~/.cache COPY ["bgpcfgd", "start.sh", "/usr/bin/"] COPY ["*.j2", "/usr/share/sonic/templates/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] +COPY ["snmp.conf", "/etc/snmp/frr.conf"] ENTRYPOINT ["/usr/bin/supervisord"] diff --git a/dockers/docker-fpm-frr/bgpd.conf.j2 b/dockers/docker-fpm-frr/bgpd.conf.j2 index 4879736437bc..0e3530a37e39 100644 --- a/dockers/docker-fpm-frr/bgpd.conf.j2 +++ b/dockers/docker-fpm-frr/bgpd.conf.j2 @@ -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 %} ! diff --git a/dockers/docker-fpm-frr/frr.conf.j2 b/dockers/docker-fpm-frr/frr.conf.j2 index d4fdec897da2..1dc4fc6715af 100644 --- a/dockers/docker-fpm-frr/frr.conf.j2 +++ b/dockers/docker-fpm-frr/frr.conf.j2 @@ -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 %} ! diff --git a/dockers/docker-fpm-frr/snmp.conf b/dockers/docker-fpm-frr/snmp.conf new file mode 100644 index 000000000000..0d875a61fe87 --- /dev/null +++ b/dockers/docker-fpm-frr/snmp.conf @@ -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 diff --git a/dockers/docker-fpm-frr/supervisord.conf b/dockers/docker-fpm-frr/supervisord.conf index 0b1c813847b6..ba9f38507b80 100644 --- a/dockers/docker-fpm-frr/supervisord.conf +++ b/dockers/docker-fpm-frr/supervisord.conf @@ -31,7 +31,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:zebra] -command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm +command=/usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp priority=4 autostart=false autorestart=false @@ -49,7 +49,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:bgpd] -command=/usr/lib/frr/bgpd -A 127.0.0.1 +command=/usr/lib/frr/bgpd -A 127.0.0.1 -M snmp priority=5 stopsignal=KILL autostart=false diff --git a/dockers/docker-snmp-sv2/snmpd.conf.j2 b/dockers/docker-snmp-sv2/snmpd.conf.j2 index 6353246acb08..68d08318cb98 100644 --- a/dockers/docker-snmp-sv2/snmpd.conf.j2 +++ b/dockers/docker-snmp-sv2/snmpd.conf.j2 @@ -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 diff --git a/rules/docker-fpm-frr.mk b/rules/docker-fpm-frr.mk index fd593c5cb92a..d10ac325f27e 100644 --- a/rules/docker-fpm-frr.mk +++ b/rules/docker-fpm-frr.mk @@ -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) $(LIBYANG) +$(DOCKER_FPM_FRR)_DEPENDS += $(FRR) $(FRR_SNMP) $(SWSS) $(LIBYANG) $(DOCKER_FPM_FRR)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) SONIC_DOCKER_IMAGES += $(DOCKER_FPM_FRR) diff --git a/rules/frr.mk b/rules/frr.mk index ac110d03f54d..52dfbe13ec2d 100644 --- a/rules/frr.mk +++ b/rules/frr.mk @@ -18,4 +18,10 @@ $(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))) -export FRR FRR_PYTHONTOOLS 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 diff --git a/src/sonic-config-engine/tests/sample_output/frr.conf b/src/sonic-config-engine/tests/sample_output/frr.conf index 7ea45508f236..56d7122186b2 100644 --- a/src/sonic-config-engine/tests/sample_output/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/frr.conf @@ -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 diff --git a/src/sonic-frr/Makefile b/src/sonic-frr/Makefile index 48da9c72116e..5ba70addf17e 100644 --- a/src/sonic-frr/Makefile +++ b/src/sonic-frr/Makefile @@ -3,7 +3,7 @@ SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = $(FRR) -DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) +DERIVED_TARGET = $(FRR_PYTHONTOOLS) $(FRR_DBG) $(FRR_SNMP) $(FRR_SNMP_DBG) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package