summaryrefslogtreecommitdiff
path: root/templates/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'templates/protocols')
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def38
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def40
2 files changed, 66 insertions, 12 deletions
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def
index 75cd25dc..47e78336 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/export/node.def
@@ -1,17 +1,43 @@
type: txt
help: Set a route-map to filter outgoing route updates to this neighbor
-comp_help: \1 <txt>\t\troute-map name
+
commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-as --as $VAR(../../../@) --neighbor $VAR(../../@)"
+
commit:expression: $VAR(../../peer-group/) == ""; "protocols bgp $VAR(../../../@) neighbor $VAR(../../@): you can't set a route-map for a neighbor in a peer-group"
+
commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $VAR(@)\" ";"protocols bgp $VAR(../../../@) neighbor $VAR(../../@) export: route-map $VAR(@) doesn't exist"
+
update: if [ -n "$VAR(../../remote-as/@)" ]; then
peer="remote-as $VAR(../../remote-as/@)";
else
peer="peer-group $VAR(../../peer-group/@)";
fi;
- vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../../../@)" \
- -c "neighbor $VAR(../../@) $peer" \
- -c "neighbor $VAR(../../@) route-map $VAR(@) out"
-delete: vyatta-vtysh --noerror -c "configure terminal" -c "router bgp $VAR(../../../@)" \
- -c "no neighbor $VAR(../../@) route-map $VAR(@) out"
+ if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@)
+ then
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "address-family ipv6" \
+ -c "neighbor $VAR(../../@) $peer" \
+ -c "address-family ipv6" \
+ -c "neighbor $VAR(../../@) route-map $VAR(@) out"
+ else
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "neighbor $VAR(../../@) $peer" \
+ -c "neighbor $VAR(../../@) route-map $VAR(@) out"
+ fi
+
+delete: if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@)
+ then
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "address-family ipv6" \
+ -c "no neighbor $VAR(../../@) route-map $VAR(@) out"
+ else
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "no neighbor $VAR(../../@) route-map $VAR(@) out"
+ fi
+comp_help: possible completions:
+ <txt> route-map name
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def
index d6fa203e..4bac3854 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/route-map/import/node.def
@@ -1,17 +1,45 @@
type: txt
help: Set a route-map to filter incoming route updates from this neighbor
-comp_help: \1 <txt>\t\troute-map name
+
commit:expression: exec "/opt/vyatta/sbin/vyatta-bgp.pl --check-as --as $VAR(../../../@) --neighbor $VAR(../../@)"
+
commit:expression: $VAR(../../peer-group/) == ""; "protocols bgp $VAR(../../../@) neighbor $VAR(../../@): you can't set a route-map for a neighbor in a peer-group"
+
commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $VAR(@)\" ";"protocols bgp $VAR(../../../@) neighbor $VAR(../../@) import: route-map $VAR(@) doesn't exist"
+
update: if [ -n "$VAR(../../remote-as/@)" ]; then
peer="remote-as $VAR(../../remote-as/@)";
else
peer="peer-group $VAR(../../peer-group/@)";
fi;
- vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(../../../@)" \
- -c "neighbor $VAR(../../@) $peer" \
- -c "neighbor $VAR(../../@) route-map $VAR(@) in"
-delete: vyatta-vtysh --noerror -c "configure terminal" -c "router bgp $VAR(../../../@)" \
- -c "no neighbor $VAR(../../@) route-map $VAR(@) in"
+ if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@)
+ then
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "address-family ipv6" \
+ -c "neighbor $VAR(../../@) $peer" \
+ -c "address-family ipv6" \
+ -c "neighbor $VAR(../../@) route-map $VAR(@) in"
+ else
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "neighbor $VAR(../../@) $peer" \
+ -c "neighbor $VAR(../../@) route-map $VAR(@) in"
+ fi
+
+delete: if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@)
+ then
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "address-family ipv6" \
+ -c "no neighbor $VAR(../../@) route-map $VAR(@) in"
+ else
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "no neighbor $VAR(../../@) route-map $VAR(@) in"
+ fi
+
+
+comp_help: possible completions:
+ <txt> route-map name