summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhagbard <vyosdev@derith.de>2019-04-23 14:22:09 -0700
committerhagbard <vyosdev@derith.de>2019-04-23 14:26:30 -0700
commit41df1579f6ca3e5a1618ee85bbb337011148f1ef (patch)
treedb6c79e04f10aaeaf6138fa958d058077c924db0
parentedd5e1b48e5c87d50a8d12c7c100f69332bd7326 (diff)
downloadvyatta-cfg-quagga-41df1579f6ca3e5a1618ee85bbb337011148f1ef.tar.gz
vyatta-cfg-quagga-41df1579f6ca3e5a1618ee85bbb337011148f1ef.zip
[frr-bgp] T1243 - comparison local-as, remote-as and router-as
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def9
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def1
2 files changed, 10 insertions, 0 deletions
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def
index cb565c7b..d81f497f 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/local-as/node.def
@@ -5,3 +5,12 @@ val_help: u32:1-4294967294; Local AS number
syntax:expression: $VAR(@) >=1 && $VAR(@) <= 4294967294; "local-as must be between 1 and 4294967294"
commit:expression: $VAR(@) != $VAR(../../@); "you can't set local-as the same as the router AS"
commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --is-iBGP --neighbor $VAR(../@) --as $VAR(../../@)"; "local-as can't be set on iBGP peers"
+
+end: if [ "$COMMIT_ACTION" != DELETE ]; then
+ ### check below didn't work via commit:expression:
+ if [ $VAR(@) -eq $VAR(../@/remote-as/@) ];
+ then echo "local-as: "$VAR(@)" and remote-as: "$VAR(../@/remote-as/@)" can't be the same"
+ exit 1
+ fi
+ fi
+
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
index 5fbec1ae..5e1a2447 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/remote-as/node.def
@@ -3,3 +3,4 @@ help: Neighbor BGP AS number [REQUIRED]
val_help: u32: 1-4294967294; Neighbor AS number
syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; \
"remote-as must be between 1 and 4294967294"
+commit:expression: $VAR(@) != $VAR(../../@); "remote-as and router AS can\'t be the same value"