diff options
author | Christian Poessinger <christian@poessinger.com> | 2018-09-10 22:10:56 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2018-09-10 22:10:56 +0200 |
commit | bfedcd4c79650414b123fad8158c30fb42ad8fb0 (patch) | |
tree | 901432ab8acf89a5cb24d92a83bbd7206f688911 /src/conf_mode | |
parent | 9fde738774b826ab18d235ab0fb7e2b3c7d9998a (diff) | |
download | vyos-1x-bfedcd4c79650414b123fad8158c30fb42ad8fb0.tar.gz vyos-1x-bfedcd4c79650414b123fad8158c30fb42ad8fb0.zip |
snmp.py: proper creation of non network bound SNMP communities
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/snmp.py | 7 |
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 %} |