summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2009-10-30 17:17:22 -0700
committerStig Thormodsrud <stig@vyatta.com>2009-10-30 17:17:22 -0700
commit777f544d0361d63c1eea1fa39d4e620fa02ed597 (patch)
treee5b5b5d11cee0f84e5c883e80a80595cd1ec4bba
parentdd4c226ebb1690dbbfd16097c7637317541e0ed2 (diff)
downloadvyatta-cfg-quagga-777f544d0361d63c1eea1fa39d4e620fa02ed597.tar.gz
vyatta-cfg-quagga-777f544d0361d63c1eea1fa39d4e620fa02ed597.zip
Fix 5060: error adding bgp policy to ipv6 peer.
-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