From 5e653da788469cc70004c928e64a0d931e29eb77 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 17 Jun 2021 18:59:00 +0200 Subject: route-map: T3632: fix invalid validation regex for extcommunity-rt and extcommunity-soo Use the validation string/system available within vyos-1x. This also works also on VyOS 1.2 series systems. (cherry picked from commit 2c6ec4330384606fb25b8afb5ef1831320715917) --- .../route-map/node.tag/rule/node.tag/set/extcommunity-rt/node.def | 6 ++++-- .../node.tag/rule/node.tag/set/extcommunity-soo/node.def | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/extcommunity-rt/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/extcommunity-rt/node.def index 6338ca50..e536c698 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/extcommunity-rt/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/extcommunity-rt/node.def @@ -1,8 +1,10 @@ type: txt help: Set route target value -val_help: ASN:nn_or_IP_address:nn VPN extended community +val_help: ASN:NN; based on autonomous system number +val_help: IP:NN; Based on a router-id IP address + +syntax:expression: exec "${vyos_libexec_dir}/validate-value --regex \'^((?:[0-9]{1,3}\\.){3}[0-9]{1,3}|\\d+):\\d+$\' --value \'$VAR(@)\'"; "Should be in form: ASN:NN or IPADDR:NN where ASN is autonomous system number" -syntax:expression: pattern $VAR(@) "\d+:\d+(\.\d+\.\d+\.\d+):\d+" ; "Should be in form: ASN:nn_or_IP_address:nn where ASN is autonomous system number" commit:expression: $VAR(../../action/) != ""; "you must specify an action" update: vtysh -c "configure terminal" \ diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/extcommunity-soo/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/extcommunity-soo/node.def index e76243dd..51f6bb5c 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/extcommunity-soo/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/extcommunity-soo/node.def @@ -1,8 +1,10 @@ type: txt -help: Set Site of Origin value. -val_help: ASN:nn_or_IP_address:nn VPN extended community +help: Set Site of Origin value. +val_help: ASN:NN; based on autonomous system number +val_help: IP:NN; Based on a router-id IP address + +syntax:expression: exec "${vyos_libexec_dir}/validate-value --regex \'^((?:[0-9]{1,3}\\.){3}[0-9]{1,3}|\\d+):\\d+$\' --value \'$VAR(@)\'"; "Should be in form: ASN:NN or IPADDR:NN where ASN is autonomous system number" -syntax:expression: pattern $VAR(@) "\d+:\d+(\.\d+\.\d+\.\d+):\d+" ; "Should be in form: ASN:nn_or_IP_address:nn where ASN is autonomous system number" commit:expression: $VAR(../../action/) != ""; "you must specify an action" update: vtysh -c "configure terminal" \ -- cgit v1.2.3