From d3578739d67dff813c8eccc1428bd40b96ed8340 Mon Sep 17 00:00:00 2001 From: sever-sever Date: Tue, 23 Feb 2021 21:25:54 +0000 Subject: routing: T3211: Add redistribute protocol IS-IS to bgp ospf --- .../ospf/redistribute/isis/metric-type/node.def | 5 +++++ .../ospf/redistribute/isis/metric/node.def | 4 ++++ templates/protocols/ospf/redistribute/isis/node.def | 21 +++++++++++++++++++++ .../ospf/redistribute/isis/route-map/node.def | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 templates/protocols/ospf/redistribute/isis/metric-type/node.def create mode 100644 templates/protocols/ospf/redistribute/isis/metric/node.def create mode 100644 templates/protocols/ospf/redistribute/isis/node.def create mode 100644 templates/protocols/ospf/redistribute/isis/route-map/node.def (limited to 'templates/protocols/ospf/redistribute/isis') diff --git a/templates/protocols/ospf/redistribute/isis/metric-type/node.def b/templates/protocols/ospf/redistribute/isis/metric-type/node.def new file mode 100644 index 00000000..e49f528c --- /dev/null +++ b/templates/protocols/ospf/redistribute/isis/metric-type/node.def @@ -0,0 +1,5 @@ +type: u32 +help: OSPF metric type +default: 2 +syntax:expression: $VAR(@) in 1, 2 ; "metric-type must be either 1 or 2" +val_help: u32:1-2; Metric type (default 2) diff --git a/templates/protocols/ospf/redistribute/isis/metric/node.def b/templates/protocols/ospf/redistribute/isis/metric/node.def new file mode 100644 index 00000000..58fd80d7 --- /dev/null +++ b/templates/protocols/ospf/redistribute/isis/metric/node.def @@ -0,0 +1,4 @@ +type: u32 +help: Metric for redistributed routes +syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 16777214; "metric must be between 0 and 16777214" +val_help: u32:0-16777214; Metric for redistributed routes diff --git a/templates/protocols/ospf/redistribute/isis/node.def b/templates/protocols/ospf/redistribute/isis/node.def new file mode 100644 index 00000000..1eaaa0de --- /dev/null +++ b/templates/protocols/ospf/redistribute/isis/node.def @@ -0,0 +1,21 @@ +help: Redistribute IS-IS routes +delete:expression: "touch /tmp/ospf-redist-isis.$PPID" +end: vtysh -c "configure terminal" \ + -c "router ospf" \ + -c "no redistribute isis"; + if [ -f "/tmp/ospf-redist-isis.$PPID" ]; then + rm -f /tmp/ospf-redist-isis.$PPID; + else + if [ -n "$VAR(./metric/@)" ]; then + COND="metric $VAR(./metric/@)"; + fi; + if [ -n "$VAR(./metric-type/@)" ]; then + COND="$COND metric-type $VAR(./metric-type/@)"; + fi; + if [ -n "$VAR(./route-map/@)" ]; then + COND="$COND route-map $VAR(./route-map/@)"; + fi; + vtysh -c "configure terminal" \ + -c "router ospf" \ + -c "redistribute isis $COND"; + fi; diff --git a/templates/protocols/ospf/redistribute/isis/route-map/node.def b/templates/protocols/ospf/redistribute/isis/route-map/node.def new file mode 100644 index 00000000..f2c6f7c2 --- /dev/null +++ b/templates/protocols/ospf/redistribute/isis/route-map/node.def @@ -0,0 +1,3 @@ +type: txt +help: Route map reference +commit:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy route-map $VAR(@)\" ";"route-map $VAR(@) doesn't exist" -- cgit v1.2.3