summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 %}