diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2024-01-05 12:13:17 +0000 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2024-01-25 12:35:46 +0000 |
commit | 6ce5fedb602c5ea0df52049a5e9c4fb4f5a86122 (patch) | |
tree | c1260ee9efeddcf038bfcf547372efba17d26ba6 /src/conf_mode | |
parent | ada6b103f15b5871fa28c5e194afcd2f5019b2e4 (diff) | |
download | vyos-1x-6ce5fedb602c5ea0df52049a5e9c4fb4f5a86122.tar.gz vyos-1x-6ce5fedb602c5ea0df52049a5e9c4fb4f5a86122.zip |
T4839: firewall: Add dynamic address group in firewall configuration, and appropiate commands to populate such groups using source and destination address of the packet.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/nat.py | 4 | ||||
-rwxr-xr-x | src/conf_mode/policy_route.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/conf_mode/nat.py b/src/conf_mode/nat.py index 20570da62..19b206c59 100755 --- a/src/conf_mode/nat.py +++ b/src/conf_mode/nat.py @@ -69,6 +69,10 @@ def get_config(config=None): nat['firewall_group'] = conf.get_config_dict(['firewall', 'group'], key_mangling=('-', '_'), get_first_key=True, no_tag_node_value_mangle=True) + # Remove dynamic firewall groups if present: + if 'dynamic_group' in nat['firewall_group']: + del nat['firewall_group']['dynamic_group'] + return nat def verify_rule(config, err_msg, groups_dict): diff --git a/src/conf_mode/policy_route.py b/src/conf_mode/policy_route.py index adad012de..6d7a06714 100755 --- a/src/conf_mode/policy_route.py +++ b/src/conf_mode/policy_route.py @@ -53,6 +53,10 @@ def get_config(config=None): policy['firewall_group'] = conf.get_config_dict(['firewall', 'group'], key_mangling=('-', '_'), get_first_key=True, no_tag_node_value_mangle=True) + # Remove dynamic firewall groups if present: + if 'dynamic_group' in policy['firewall_group']: + del policy['firewall_group']['dynamic_group'] + return policy def verify_rule(policy, name, rule_conf, ipv6, rule_id): |