summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def44
-rw-r--r--templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def46
2 files changed, 77 insertions, 13 deletions
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def
index e116f9b4..48e397db 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/export/node.def
@@ -1,17 +1,49 @@
type: txt
help: Set an as-path-list to filter outgoing route updates to this neighbor
-comp_help: \1 <txt>\t\tas-path-list name
+
+allowed: local -a params
+ params=( /opt/vyatta/config/active/policy/as-path-list/* )
+ echo -n ${params[@]##*/}
+
+comp_help: possible completions:
+ <txt> as-path-list 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 filter-list for a neighbor in peer-group"
+
commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy as-path-list $VAR(@)\" ";"protocols bgp $VAR(../../../@) neighbor $VAR(../../@) filter-list export: as-path-list $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(../../@) filter-list $VAR(@) out"
-delete: vyatta-vtysh --noerror -c "configure terminal" -c "router bgp $VAR(../../../@)" \
- -c "no neighbor $VAR(../../@) filter-list $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(../../@) filter-list $VAR(@) out"
+ else
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "neighbor $VAR(../../@) $peer" \
+ -c "neighbor $VAR(../../@) filter-list $VAR(@) out"
+ fi;
+
+delete: if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@); then
+ vyatta-vtysh --noerror \
+ -c "configure terminal" \
+ -c "address-family ipv6" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "address-family ipv6" \
+ -c "no neighbor $VAR(../../@) filter-list $VAR(@) out"
+ else
+ vyatta-vtysh --noerror \
+ -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "no neighbor $VAR(../../@) filter-list $VAR(@) out"
+ fi
diff --git a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def
index f6ef4a99..91b8814c 100644
--- a/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def
+++ b/templates/protocols/bgp/node.tag/neighbor/node.tag/filter-list/import/node.def
@@ -1,17 +1,49 @@
type: txt
help: Set an as-path-list to filter incoming route updates from this neighbor
-comp_help: \1 <txt>\t\tas-path-list name
+
+allowed: local -a params
+ params=( /opt/vyatta/config/active/policy/as-path-list/* )
+ echo -n ${params[@]##*/}
+
+comp_help: possible completions:
+ <txt> as-path-list 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 filter-list for a neighbor in peer-group"
+
commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy as-path-list $VAR(@)\" ";"protocols bgp $VAR(../../../@) neighbor $VAR(../../@) filter-list import: as-path-list $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(../../@) filter-list $VAR(@) in"
-delete: vyatta-vtysh --noerror -c "configure terminal" -c "router bgp $VAR(../../../@)" \
- -c "no neighbor $VAR(../../@) filter-list $VAR(@) in"
+ fi;
+ 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(../../@) filter-list $VAR(@) in"
+ else
+ vyatta-vtysh -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "neighbor $VAR(../../@) $peer" \
+ -c "neighbor $VAR(../../@) filter-list $VAR(@) in"
+ fi;
+
+delete: if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $VAR(../../@); then
+ vyatta-vtysh --noerror \
+ -c "configure terminal" \
+ -c "address-family ipv6" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "address-family ipv6" \
+ -c "no neighbor $VAR(../../@) filter-list $VAR(@) in"
+ else
+ vyatta-vtysh --noerror \
+ -c "configure terminal" \
+ -c "router bgp $VAR(../../../@)" \
+ -c "no neighbor $VAR(../../@) filter-list $VAR(@) in"
+ fi