From bfde18e1064d0622d1eb022ffca2fa9a95bace0f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 1 Sep 2018 14:48:06 +0200 Subject: snmp.py: bugfix - CLI client community node was not processed --- src/conf_mode/snmp.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index 86a10c496..ef5db4690 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -270,6 +270,7 @@ def get_config(): if conf.exists('community {0} authorization'.format(name)): community['authorization'] = conf.return_value('community {0} authorization'.format(name)) + # Subnet of SNMP client(s) allowed to contact system if conf.exists('community {0} network'.format(name)): for addr in conf.return_values('community {0} network'.format(name)): if vyos.validate.is_ipv4(addr): @@ -277,6 +278,14 @@ def get_config(): else: community['network_v6'].append(addr) + # IP address of SNMP client allowed to contact system + if conf.exists('community {0} client'.format(name)): + for addr in conf.return_values('community {0} client'.format(name)): + if vyos.validate.is_ipv4(addr): + community['network_v4'].append(addr) + else: + community['network_v6'].append(addr) + snmp['communities'].append(community) if conf.exists('contact'): -- cgit v1.2.3