summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2008-04-24 11:57:37 -0700
committerBob Gilligan <gilligan@vyatta.com>2008-04-24 11:57:37 -0700
commit6c647cde4aa18d39c9a9cfb643b5f81bfc5a7c21 (patch)
tree775c0c422e056ed71be510eac2a3177e6e480573
parent8328b5607db0e3e8c7cc0cd2ad035475e3dc0887 (diff)
downloadvyatta-cfg-quagga-6c647cde4aa18d39c9a9cfb643b5f81bfc5a7c21.tar.gz
vyatta-cfg-quagga-6c647cde4aa18d39c9a9cfb643b5f81bfc5a7c21.zip
Bugfix: 3181, 3019hollister
Allow static interface routes to be configured via PPP interfaces that are down. Quagga will install the route when the interface comes up.
-rw-r--r--templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def33
1 files changed, 30 insertions, 3 deletions
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def
index bf6aa5b9..80526635 100644
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def
+++ b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def
@@ -1,12 +1,39 @@
+#
+# Config template for
+# protocols/static/interface-route/<prefix>/next-hop-interface
+#
+
tag:
+
type: txt
+
help: Set the next-hop interface
+
+#
+# Argument must be the name of an interface on the system. PPP interfaces
+# only come into existance when they come up. Allow interface routes
+# via them to be configured even though the link may not be up right now.
+# We need a special case for multilink interfaces because their names
+# are not coded into the name of the PPP config file in /etc/ppp/peers.
+#
syntax:expression: exec " \
- if [ -z \"`ip addr | grep $VAR(@) `\" ]; then \
- echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \
- exit 1 ; \
+ IFNAME=$VAR(@) ; \
+ if [ -z \"`ip addr | grep $IFNAME `\" ]; then \
+ if [ \"${IFNAME::5}\" != \"pppoa\" -a \"${IFNAME::5}\" != \"pppoe\" \
+ -a \"${IFNAME::3}\" != \"wan\" \
+ -a \"${IFNAME::2}\" != \"ml\" ]; then \
+ echo interface $IFNAME doesn\\'t exist on this system ; \
+ exit 1 ; \
+ fi ; \
+ if [ ! -e /etc/ppp/peers/${IFNAME} -a \"$IFNAME\" != \"ml0\" \
+ -a \"$IFNAME\" != \"ml1\" ]; then \
+ echo PPP interface $IFNAME doesn\\'t exist on this system ; \
+ exit 1 ; \
+ fi ; \
fi ; "
+
delete:expression: "touch /tmp/static.$PPID"
+
end:expression: "if [ -f \"/tmp/static.$PPID\" ]; then \
${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"no ip route $VAR(../@) $VAR(@)\" ; \
rm /tmp/static.$PPID; \