From a4f5dbef77793280e1dc9a5bb068d71b1067ea8f Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 2 Mar 2009 14:26:45 -0800 Subject: RIP allow any interface type Not restricted to just ethernet, RIP should work over bonding etc.. --- .../rip/distribute-list/interface/node.def | 4 +-- templates/protocols/rip/interface/node.def | 8 +++--- templates/protocols/rip/passive-interface/node.def | 30 ++++++++++------------ 3 files changed, 17 insertions(+), 25 deletions(-) (limited to 'templates/protocols/rip') diff --git a/templates/protocols/rip/distribute-list/interface/node.def b/templates/protocols/rip/distribute-list/interface/node.def index 46fe743d..749e5fb5 100644 --- a/templates/protocols/rip/distribute-list/interface/node.def +++ b/templates/protocols/rip/distribute-list/interface/node.def @@ -5,6 +5,4 @@ syntax:expression: exec "if [ -z \"`ip addr | grep $VAR(@) `\" ]; then echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ exit 1 ; \ fi ; " -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all diff --git a/templates/protocols/rip/interface/node.def b/templates/protocols/rip/interface/node.def index 8a1e560e..1cbbdaac 100644 --- a/templates/protocols/rip/interface/node.def +++ b/templates/protocols/rip/interface/node.def @@ -6,8 +6,6 @@ syntax:expression: exec " \ echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ exit 1 ; \ fi ; " -create:expression: "vyatta-vtysh -c \"configure terminal\" -c \"router rip\" -c \"network $VAR(@)\" " -delete:expression: "vyatta-vtysh -c \"configure terminal\" -c \"router rip\" -c \"no network $VAR(@)\" " -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} +create:vyatta-vtysh -c "configure terminal" -c "router rip" -c "network $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" -c "router rip" -c "no network $VAR(@)" +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all diff --git a/templates/protocols/rip/passive-interface/node.def b/templates/protocols/rip/passive-interface/node.def index 1663df1b..09039331 100644 --- a/templates/protocols/rip/passive-interface/node.def +++ b/templates/protocols/rip/passive-interface/node.def @@ -6,20 +6,16 @@ syntax:expression: exec " \ echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ exit 1 ; \ fi ; " -update:expression: "if [ x$VAR(x) == xdefault ]; then \ - vyatta-vtysh -c \"configure terminal\" -c \"router rip\" \ - -c \"passive-interface default\"; \ - else \ - vyatta-vtysh -c \"configure terminal\" -c \"router rip\" \ - -c \"passive-interface $VAR(@)\"; \ - fi; " -delete:expression: "if [ x$VAR(x) == xdefault ]; then \ - vyatta-vtysh -c \"configure terminal\" -c \"router rip\" \ - -c \"no passive-interface default\"; \ - else \ - vyatta-vtysh -c \"configure terminal\" -c \"router rip\" \ - -c \"no passive-interface $VAR(@)\"; \ - fi; " -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} +update: if [ x$VAR(x) == xdefault ] + then vyatta-vtysh -c "configure terminal" -c "router rip" \ + -c "passive-interface default" + else vyatta-vtysh -c "configure terminal" -c "router rip" \ + -c "passive-interface $VAR(@)" + fi +delete: if [ x$VAR(x) == xdefault ] + then vyatta-vtysh -c "configure terminal" -c "router rip" \ + -c "no passive-interface default" + else vyatta-vtysh -c "configure terminal" -c "router rip" \ + -c "no passive-interface $VAR(@)" + fi +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all -- cgit v1.2.3