summaryrefslogtreecommitdiff
path: root/templates/protocols/rip
diff options
context:
space:
mode:
Diffstat (limited to 'templates/protocols/rip')
-rw-r--r--templates/protocols/rip/default-distance/node.def8
-rw-r--r--templates/protocols/rip/default-metric/node.def8
-rw-r--r--templates/protocols/rip/distribute-list/in/node.def (renamed from templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/in/node.def)0
-rw-r--r--templates/protocols/rip/distribute-list/node.def (renamed from templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/node.def)0
-rw-r--r--templates/protocols/rip/distribute-list/out/node.def (renamed from templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/out/node.def)0
-rw-r--r--templates/protocols/rip/interface/node.def3
-rw-r--r--templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.def5
-rw-r--r--templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.tag/node.def1
-rw-r--r--templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.tag/password/node.def8
-rw-r--r--templates/protocols/rip/interface/node.tag/network/node.tag/authentication/node.def1
-rw-r--r--templates/protocols/rip/interface/node.tag/network/node.tag/authentication/simple-password/node.def6
-rw-r--r--templates/protocols/rip/interface/node.tag/network/node.tag/metric/node.def9
-rw-r--r--templates/protocols/rip/interface/node.tag/network/node.tag/split-horizon/node.def6
-rw-r--r--templates/protocols/rip/interface/node.tag/network/node.tag/split-horizon/poison-reverse/node.def5
-rw-r--r--templates/protocols/rip/interface/node.tag/node.def1
-rw-r--r--templates/protocols/rip/neighbor/node.def (renamed from templates/protocols/rip/interface/node.tag/network/node.tag/passive/node.def)9
-rw-r--r--templates/protocols/rip/network-distance/node.def18
-rw-r--r--templates/protocols/rip/network-distance/node.tag/access-list/node.def3
-rw-r--r--templates/protocols/rip/network-distance/node.tag/distance/node.def6
-rw-r--r--templates/protocols/rip/network-distance/node.tag/node.def1
-rw-r--r--templates/protocols/rip/network/node.def (renamed from templates/protocols/rip/interface/node.tag/network/node.def)4
-rw-r--r--templates/protocols/rip/passive-interface/node.def25
-rw-r--r--templates/protocols/rip/route/node.def9
23 files changed, 87 insertions, 49 deletions
diff --git a/templates/protocols/rip/default-distance/node.def b/templates/protocols/rip/default-distance/node.def
new file mode 100644
index 00000000..5960fc75
--- /dev/null
+++ b/templates/protocols/rip/default-distance/node.def
@@ -0,0 +1,8 @@
+type: u32
+help: "Administrative distance"
+syntax: $(@) >= 1 && $(@) <= 255; "must be between 1 and 255"
+update: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"distance $(@) \" "
+delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"no distance $(@) \" "
+#comp_help: Enter a distance valude between 1-255
diff --git a/templates/protocols/rip/default-metric/node.def b/templates/protocols/rip/default-metric/node.def
new file mode 100644
index 00000000..8151814e
--- /dev/null
+++ b/templates/protocols/rip/default-metric/node.def
@@ -0,0 +1,8 @@
+type: u32
+help: "Set metric of redistributed routes"
+syntax: $(@) >= 1 && $(@) <= 16; "Must be between 1-16"
+update: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"default-metric $(@) \"; "
+delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"no default-metric $(@) \"; "
+#comp_help <1-16> Default metric
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/in/node.def b/templates/protocols/rip/distribute-list/in/node.def
index 83b31f9c..83b31f9c 100644
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/in/node.def
+++ b/templates/protocols/rip/distribute-list/in/node.def
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/node.def b/templates/protocols/rip/distribute-list/node.def
index 59eacb5a..59eacb5a 100644
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/node.def
+++ b/templates/protocols/rip/distribute-list/node.def
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/out/node.def b/templates/protocols/rip/distribute-list/out/node.def
index 0e7ea992..0e7ea992 100644
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/distribute-list/out/node.def
+++ b/templates/protocols/rip/distribute-list/out/node.def
diff --git a/templates/protocols/rip/interface/node.def b/templates/protocols/rip/interface/node.def
index 1c493597..a5045a05 100644
--- a/templates/protocols/rip/interface/node.def
+++ b/templates/protocols/rip/interface/node.def
@@ -1,4 +1,4 @@
-tag:
+multi:
type: txt
help: "Interface name"
syntax: exec " \
@@ -7,5 +7,4 @@ syntax: exec " \
exit 1 ; \
fi ; "
create: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" -c \"network $(@)\" "
-update: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" -c \"network $(@)\" "
delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" -c \"no network $(@)\" "
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.def b/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.def
deleted file mode 100644
index 279283e3..00000000
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-tag:
-type: u32
-help: "MD5 authentication key ID"
-syntax: $(@) >= 1 && $(@) <= 255; "ID must be between 1 and 255"
-
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.tag/node.def b/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.tag/node.def
deleted file mode 100644
index 8b0f3125..00000000
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.tag/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: "Authentication password"
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.tag/password/node.def b/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.tag/password/node.def
deleted file mode 100644
index 6bef716d..00000000
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/md5/node.tag/password/node.def
+++ /dev/null
@@ -1,8 +0,0 @@
-type: txt
-help: "Authentication password"
-create: "/usr/bin/vtysh -c \"configure terminal\" -c \"interface $(../../../../@)\" \
- -c \"ip rip authentication mode md5\" -c \"ip rip authentication key-chain $(../@)\" \
- -c \"key chain $(../@)\" -c \"key $(../@)\" -c \"key-string $(@)\" "
-delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"interface $(../../../../@)\" \
- -c \"no ip rip authentication mode md5\" -c \"no ip rip authentication key-chain $(../@)\" \
- -c \"no key chain $(../@)\" "
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/node.def b/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/node.def
deleted file mode 100644
index cd07a983..00000000
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: "Authentication method"
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/simple-password/node.def b/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/simple-password/node.def
deleted file mode 100644
index 2ab4fc5c..00000000
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/authentication/simple-password/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-type: txt
-help: "Simple password authentication key"
-create: "/usr/bin/vtysh -c \"configure terminal\" -c \"interface $(../../../@)\" \
- -c \"ip rip authentication mode text\" -c \"ip rip authentication string $(@)\"; "
-delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"interface $(../../../@)\" \
- -c \"no ip rip authentication mode\" -c \"no ip rip authentication string $(@)\"; "
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/metric/node.def b/templates/protocols/rip/interface/node.tag/network/node.tag/metric/node.def
deleted file mode 100644
index 5beb6cb9..00000000
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/metric/node.def
+++ /dev/null
@@ -1,9 +0,0 @@
-type: u32
-help: "Metric for this RIP network"
-syntax: $(@) >= 1 && $(@) <= 255; "metric must be between 1 and 255"
-create: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
- -c \"distance $(@) $(../@)\" "
-delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
- -c \"no distance $(@) $(../@)\" "
-
-
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/split-horizon/node.def b/templates/protocols/rip/interface/node.tag/network/node.tag/split-horizon/node.def
deleted file mode 100644
index cb52087d..00000000
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/split-horizon/node.def
+++ /dev/null
@@ -1,6 +0,0 @@
-help: "Enable split horizon on this interface"
-create: "/usr/bin/vtysh -c \"configure terminal\" -c \"interface $(../../@)\" \
- -c \"ip rip split-horizon\" "
-delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"interface $(../../@)\" \
- -c \"no ip rip split-horizon\" "
-
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/split-horizon/poison-reverse/node.def b/templates/protocols/rip/interface/node.tag/network/node.tag/split-horizon/poison-reverse/node.def
deleted file mode 100644
index c32d7012..00000000
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/split-horizon/poison-reverse/node.def
+++ /dev/null
@@ -1,5 +0,0 @@
-help: "With poison reverse"
-create: "/usr/bin/vtysh -c \"configure terminal\" -c \"interface $(../../../@)\" \
- -c \"ip rip split-horizon poisoned-reverse\" "
-delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"interface $(../../../@)\" \
- -c \"no ip rip split-horizon\" -c \"ip rip split-horizon\" "
diff --git a/templates/protocols/rip/interface/node.tag/node.def b/templates/protocols/rip/interface/node.tag/node.def
deleted file mode 100644
index d62d4841..00000000
--- a/templates/protocols/rip/interface/node.tag/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: "Configure RIP network"
diff --git a/templates/protocols/rip/interface/node.tag/network/node.tag/passive/node.def b/templates/protocols/rip/neighbor/node.def
index 4ed0d8e4..1b4d7ce5 100644
--- a/templates/protocols/rip/interface/node.tag/network/node.tag/passive/node.def
+++ b/templates/protocols/rip/neighbor/node.def
@@ -1,5 +1,8 @@
-help: "Set interface as receive only"
+multi:
+type: ipv4
+help: "Specify a neighbor router"
create: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
- -c \"passive-interface $(../@)\" "
+ -c \"neighbor $(@)\"; "
delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
- -c \"no passive-interface $(../@)\" "
+ -c \"no neighbor $(@)\"; "
+
diff --git a/templates/protocols/rip/network-distance/node.def b/templates/protocols/rip/network-distance/node.def
new file mode 100644
index 00000000..6159b5aa
--- /dev/null
+++ b/templates/protocols/rip/network-distance/node.def
@@ -0,0 +1,18 @@
+tag:
+type: ipv4net
+help: "Source network"
+syntax: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $(@)"
+commit: $(./distance/) != ""; "Must specify distance for network $(@)"
+delete: "touch /tmp/rip-dist.\\$PPID"
+end: "if [ -n \"$(./access-list/@)\" ]; then \
+ ACL=\"$(./access-list/@)\"; \
+ fi; \
+ if [ -f \"/tmp/rip-dist.\\$PPID\" ]; then \
+ dist=\\$(cat /tmp/rip-network-distance.\\$PPID); \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"no distance \\$dist $(@) \\$ACL \" ;
+ rm -f \"/tmp/rip-dist.\\$PPID\";
+ else \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"distance $(./distance/@) $(@) \\$ACL \" ;
+ fi; "
diff --git a/templates/protocols/rip/network-distance/node.tag/access-list/node.def b/templates/protocols/rip/network-distance/node.tag/access-list/node.def
new file mode 100644
index 00000000..ab225ff4
--- /dev/null
+++ b/templates/protocols/rip/network-distance/node.tag/access-list/node.def
@@ -0,0 +1,3 @@
+type: txt
+help: "Access list"
+commit: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --exists \"policy access-list $(@)\" ";"access-list $(@) doesn't exist"
diff --git a/templates/protocols/rip/network-distance/node.tag/distance/node.def b/templates/protocols/rip/network-distance/node.tag/distance/node.def
new file mode 100644
index 00000000..da83eed5
--- /dev/null
+++ b/templates/protocols/rip/network-distance/node.tag/distance/node.def
@@ -0,0 +1,6 @@
+type: u32
+help: "Administrative distance for network"
+syntax: $(@) >= 1 && $(@) <= 255; "must be between 1 and 255"
+delete: "echo $(@) > /tmp/rip-network-distance.\\$PPID"
+#comp_help: Enter a distance valude between 1-255
+
diff --git a/templates/protocols/rip/network-distance/node.tag/node.def b/templates/protocols/rip/network-distance/node.tag/node.def
new file mode 100644
index 00000000..c82cb253
--- /dev/null
+++ b/templates/protocols/rip/network-distance/node.tag/node.def
@@ -0,0 +1 @@
+help: "Set distance for a given network"
diff --git a/templates/protocols/rip/interface/node.tag/network/node.def b/templates/protocols/rip/network/node.def
index 7b226a4f..f8188dca 100644
--- a/templates/protocols/rip/interface/node.tag/network/node.def
+++ b/templates/protocols/rip/network/node.def
@@ -1,8 +1,8 @@
-tag:
+multi:
type: ipv4net
help: "RIP network"
syntax: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $(@)"
-update: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+create: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
-c \"network $(@)\"; "
delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
-c \"no network $(@)\"; "
diff --git a/templates/protocols/rip/passive-interface/node.def b/templates/protocols/rip/passive-interface/node.def
new file mode 100644
index 00000000..903a1e79
--- /dev/null
+++ b/templates/protocols/rip/passive-interface/node.def
@@ -0,0 +1,25 @@
+multi:
+type: txt
+help: "Suppress routing updates on an interface"
+syntax: exec " \
+ if [ -z \"`ip addr | grep $(@) `\" ] && [ x$(@) != xdefault ]; then \
+ echo ethernet interface $(@) doesn\\'t exist on this system ; \
+ exit 1 ; \
+ fi ; "
+update: "if [ x$(x) == xdefault ]; then \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"passive-interface default\"; \
+ else \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"passive-interface $(@)\"; \
+ fi; "
+delete: "if [ x$(x) == xdefault ]; then \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"no passive-interface default\"; \
+ else \
+ /usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"no passive-interface $(@)\"; \
+ fi; "
+#allowed: local -a array;
+# array=( /sys/class/net/{eth,vmnet}* ) ;
+# echo -n ${array[@]##*/}
diff --git a/templates/protocols/rip/route/node.def b/templates/protocols/rip/route/node.def
new file mode 100644
index 00000000..327c9d09
--- /dev/null
+++ b/templates/protocols/rip/route/node.def
@@ -0,0 +1,9 @@
+multi:
+type: ipv4net
+help: "RIP static route configuration"
+syntax: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $(@)"
+create: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"route $(@)\" "
+delete: "/usr/bin/vtysh -c \"configure terminal\" -c \"router rip\" \
+ -c \"no route $(@)\" "
+