diff options
author | Christian Breunig <christian@breunig.cc> | 2023-02-10 19:42:44 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2023-02-10 19:42:44 +0100 |
commit | 011e6a2cdea8fca73f7c433de5e2d6bc22bd9c19 (patch) | |
tree | 7391f3de5a743615cc3acdf9942380473eab6be3 /src/conf_mode | |
parent | a31f6d45f72dbe556bd3f3d7d62935251888eca5 (diff) | |
download | vyos-1x-011e6a2cdea8fca73f7c433de5e2d6bc22bd9c19.tar.gz vyos-1x-011e6a2cdea8fca73f7c433de5e2d6bc22bd9c19.zip |
snmp: T4857: explicitly define default community networks 0.0.0.0/0 and ::/0
After the RESTRICTED view was introduced snmpd requires a network to be
specified. Before adding the RESTRICTED view snmpd always assumed the default
network 0.0.0.0/0.
This commit re-adds the build in default networks for IPv4 and IPv6 and
exposes it as a proper default to the CLI so the user is informed about it:
vyos@vyos# set service snmp community foooo
Possible completions:
authorization Authorization type (default: ro)
+ client IP address of SNMP client allowed to contact system
+ network Subnet of SNMP client(s) allowed to contact system (default:
0.0.0.0/0, ::/0)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/snmp.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index ab2ccf99e..1a8434783 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -103,6 +103,9 @@ def get_config(config=None): if 'community' in snmp: default_values = defaults(base + ['community']) + if 'network' in default_values: + # convert multiple default networks to list + default_values['network'] = default_values['network'].split() for community in snmp['community']: snmp['community'][community] = dict_merge( default_values, snmp['community'][community]) |