summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-06-03 12:57:37 +0200
committerGitHub <noreply@github.com>2023-06-03 12:57:37 +0200
commita35bd5233b3f1879fbc9948a5401d424c850419e (patch)
treedcdbf9b0195dccd27f6d5b2667f1988ac63b3574 /src
parentb8a3dc506b7bd83a0a0fcb7981571eeeb8eedf64 (diff)
parent6e46958c3fdd6ed7d0052c6f49933f5e7b7481ea (diff)
downloadvyos-1x-a35bd5233b3f1879fbc9948a5401d424c850419e.tar.gz
vyos-1x-a35bd5233b3f1879fbc9948a5401d424c850419e.zip
Merge pull request #2024 from ServerForge/current
T5257: Fix netflow VRF and bracketize v6 source addresses for netflow…
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/flow_accounting_conf.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/conf_mode/flow_accounting_conf.py b/src/conf_mode/flow_accounting_conf.py
index f67f1710e..327b77991 100755
--- a/src/conf_mode/flow_accounting_conf.py
+++ b/src/conf_mode/flow_accounting_conf.py
@@ -211,7 +211,7 @@ def verify(flow_config):
if not is_addr_assigned(tmp, sflow_vrf):
raise ConfigError(f'Configured "sflow agent-address {tmp}" does not exist in the system!')
- # Check if configured netflow source-address exist in the system
+ # Check if configured sflow source-address exist in the system
if 'source_address' in flow_config['sflow']:
if not is_addr_assigned(flow_config['sflow']['source_address'], sflow_vrf):
tmp = flow_config['sflow']['source_address']
@@ -219,13 +219,18 @@ def verify(flow_config):
# check NetFlow configuration
if 'netflow' in flow_config:
+ # check if vrf is defined for netflow
+ netflow_vrf = None
+ if 'vrf' in flow_config:
+ netflow_vrf = flow_config['vrf']
+
# check if at least one NetFlow collector is configured if NetFlow configuration is presented
if 'server' not in flow_config['netflow']:
raise ConfigError('You need to configure at least one NetFlow server!')
# Check if configured netflow source-address exist in the system
if 'source_address' in flow_config['netflow']:
- if not is_addr_assigned(flow_config['netflow']['source_address']):
+ if not is_addr_assigned(flow_config['netflow']['source_address'], netflow_vrf):
tmp = flow_config['netflow']['source_address']
raise ConfigError(f'Configured "netflow source-address {tmp}" does not exist on the system!')