summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-09-10 22:10:56 +0200
committerChristian Poessinger <christian@poessinger.com>2018-09-10 22:10:56 +0200
commitbfedcd4c79650414b123fad8158c30fb42ad8fb0 (patch)
tree901432ab8acf89a5cb24d92a83bbd7206f688911 /src
parent9fde738774b826ab18d235ab0fb7e2b3c7d9998a (diff)
downloadvyos-1x-bfedcd4c79650414b123fad8158c30fb42ad8fb0.tar.gz
vyos-1x-bfedcd4c79650414b123fad8158c30fb42ad8fb0.zip
snmp.py: proper creation of non network bound SNMP communities
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/snmp.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py
index 051b58cc4..f3406bb5b 100755
--- a/src/conf_mode/snmp.py
+++ b/src/conf_mode/snmp.py
@@ -138,15 +138,18 @@ agentaddress unix:/run/snmpd.socket{% if listen_on %}{% for li in listen_on %},{
# SNMP communities
{%- for c in communities %}
-{%- if c.authorization %}
+{%- if c.network_v4 %}
{%- for network in c.network_v4 %}
{{ c.authorization }}community {{ c.name }} {{ network }}
{%- endfor %}
+{%- else %}
+{{ c.authorization }}community {{ c.name }}
+{%- endif %}
+{%- if c.network_v6 %}
{%- for network in c.network_v6 %}
{{ c.authorization }}community6 {{ c.name }} {{ network }}
{%- endfor %}
{%- else %}
-{{ c.authorization }}community {{ c.name }}
{{ c.authorization }}community6 {{ c.name }}
{%- endif %}
{%- endfor %}