summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def10
-rw-r--r--templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def2
-rw-r--r--templates/protocols/bgp/node.tag/network/node.def50
-rw-r--r--templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def (renamed from templates/protocols/bgp/node.tag/network/node.tag/.backdoor/node.def)0
4 files changed, 34 insertions, 28 deletions
diff --git a/templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def b/templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def
index 84c2ca62..3ac8e05e 100644
--- a/templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def
+++ b/templates/policy/route-map/node.tag/rule/node.tag/match/community/node.def
@@ -1,7 +1,7 @@
help: Match BGP community list
delete: echo route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@) >> /tmp/delete-policy-route-map-$VAR(../../../@)-$VAR(../../@)-match-community.$PPID
## this will always return exact-match pending bug 2525 being fixed
-end: if [ -z "$VAR(./community-list/)" ]; then
+end: if [ -z "$VAR(./community-list/@)" ]; then
echo You must configure a community-list ;
exit 1 ;
fi ;
@@ -13,9 +13,15 @@ end: if [ -z "$VAR(./community-list/)" ]; then
else
routemap='route-map $VAR(../../../@) $VAR(../../action/@) $VAR(../../@)';
- if [ -n "$VAR(./exact-match/)" ]; then
+ # uncomment and replace the call to vyatta-check-typeless-node.pl pending bug 2525
+ #if [ -n "$VAR(./exact-match/)" ]; then
+ # cond="exact-match ";
+ #fi ;
+ ${vyatta_sbindir}/vyatta-check-typeless-node.pl "policy route-map $VAR(../../../@) rule $VAR(../../@) match community exact-match";
+ if [ $? -eq 0 ]; then
cond="exact-match ";
fi ;
+
${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" -c "$routemap " -c "no match community " ;
${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c "$routemap " -c "match community $VAR(./community-list/@) $cond" ;
fi
diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def
index 5fd3eaae..eed327b9 100644
--- a/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def
+++ b/templates/policy/route-map/node.tag/rule/node.tag/set/comm-list/comm-list/node.def
@@ -1,3 +1,3 @@
-type: txt
+type: u32
help: Set BGP community list
commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy community-list $VAR(@)\""; "community list $VAR(@) does not exist"
diff --git a/templates/protocols/bgp/node.tag/network/node.def b/templates/protocols/bgp/node.tag/network/node.def
index acd2475b..c6061749 100644
--- a/templates/protocols/bgp/node.tag/network/node.def
+++ b/templates/protocols/bgp/node.tag/network/node.def
@@ -1,31 +1,31 @@
tag:
type: ipv4net
help: Specify a network to announce via BGP
-syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)"
+syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)";
+ "Prefix doesn't fall on a natural boundry"
-commit:expression: !($VAR(./backdoor/) != "" && $VAR(./route-map/) != ""); \
- "May specify route-map or backdoor but not both"
+commit:expression: !($VAR(./backdoor/) != "" && $VAR(./route-map/) != "");
+ "May specify route-map or backdoor but not both"
-delete:expression: "touch /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID"
+delete: touch /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID
-end:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -noerr \
- -c \"configure terminal\" \
- -c \"router bgp $VAR(../@)\" \
- -c \"no network $VAR(@)\"; \
- if [ -f \"/tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID\" ]; then \
- rm -rf /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID; \
- else \
-#
-# Commenting out until cli bug 2525 is fixed
-#
-# if [ -n \"$VAR(./backdoor/)\" ]; then
-# COND=\"backdoor\";
-# fi;
- if [ -n \"$VAR(./route-map/@)\" ]; then \
- COND=\"route-map $VAR(./route-map/@)\"; \
- fi; \
- ${vyatta_sbindir}/vyatta-vtysh.pl \
- -c \"configure terminal\" \
- -c \"router bgp $VAR(../@)\" \
- -c \"network $VAR(@) $COND\"; \
- fi; "
+end: ${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" -c "router bgp $VAR(../@)" -c "no network $VAR(@)";
+
+ if [ -f "/tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID" ]; then
+ rm -rf /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID;
+ else
+ # uncomment and replace the call to vyatta-check-typeless-node.pl pending bug 2525
+ #if [ -n \"$VAR(./backdoor/)\" ]; then
+ # COND=\"backdoor\";
+ #fi;
+ ${vyatta_sbindir}/vyatta-check-typeless-node.pl "protocols bgp $VAR(../@) network $VAR(@) backdoor";
+ if [ $? -eq 0 ]; then
+ cond="backdoor ";
+ fi ;
+
+ if [ -n "$VAR(./route-map/@)" ]; then
+ COND="route-map $VAR(./route-map/@)";
+ fi;
+
+ ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../@)" -c "network $VAR(@) $cond";
+ fi;
diff --git a/templates/protocols/bgp/node.tag/network/node.tag/.backdoor/node.def b/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def
index b7dc6950..b7dc6950 100644
--- a/templates/protocols/bgp/node.tag/network/node.tag/.backdoor/node.def
+++ b/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def