From fda276bd0bb60f0ac4289103956e07c66c8e0f1e Mon Sep 17 00:00:00 2001 From: Nicolas Fort Date: Sun, 29 May 2022 16:00:12 +0000 Subject: Policy: T4450: Expand options for ip|ipv6 address match. Now support prefix-len on both matches. Also change help properties of route-source node. --- data/templates/frr/policy.frr.j2 | 6 ++++++ interface-definitions/policy.xml.in | 28 ++++++++++++++++++++++++++-- smoketest/scripts/cli/test_policy.py | 17 +++++++++++++++-- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/data/templates/frr/policy.frr.j2 b/data/templates/frr/policy.frr.j2 index 01884101f..9326cdf03 100644 --- a/data/templates/frr/policy.frr.j2 +++ b/data/templates/frr/policy.frr.j2 @@ -185,6 +185,9 @@ route-map {{ route_map }} {{ rule_config.action }} {{ rule }} {% if rule_config.match.ip.address.prefix_list is vyos_defined %} match ip address prefix-list {{ rule_config.match.ip.address.prefix_list }} {% endif %} +{% if rule_config.match.ip.address.prefix_len is vyos_defined %} + match ip address prefix-len {{ rule_config.match.ip.address.prefix_len }} +{% endif %} {% if rule_config.match.ip.nexthop.access_list is vyos_defined %} match ip next-hop {{ rule_config.match.ip.nexthop.access_list }} {% endif %} @@ -212,6 +215,9 @@ route-map {{ route_map }} {{ rule_config.action }} {{ rule }} {% if rule_config.match.ipv6.address.prefix_list is vyos_defined %} match ipv6 address prefix-list {{ rule_config.match.ipv6.address.prefix_list }} {% endif %} +{% if rule_config.match.ipv6.address.prefix_len is vyos_defined %} + match ipv6 address prefix-len {{ rule_config.match.ipv6.address.prefix_len }} +{% endif %} {% if rule_config.match.ipv6.nexthop is vyos_defined %} match ipv6 next-hop address {{ rule_config.match.ipv6.nexthop }} {% endif %} diff --git a/interface-definitions/policy.xml.in b/interface-definitions/policy.xml.in index d4aa4e024..aaed6286f 100644 --- a/interface-definitions/policy.xml.in +++ b/interface-definitions/policy.xml.in @@ -637,6 +637,18 @@ + + + IP prefix-length to match + + u32:0-32 + Prefix length + + + + + +