From 459633eabdb1e83efc622d133c71ae1e76a4d223 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Thu, 3 Mar 2011 11:31:25 -0600 Subject: Bugfix 5491: Allow tunnel parameters to be changed on a preconfigured tunnel --- templates/interfaces/tunnel/node.tag/local-ip/node.def | 8 ++++---- templates/interfaces/tunnel/node.tag/multicast/node.def | 11 ++++++++--- templates/interfaces/tunnel/node.tag/remote-ip/node.def | 8 ++++---- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/templates/interfaces/tunnel/node.tag/local-ip/node.def b/templates/interfaces/tunnel/node.tag/local-ip/node.def index 809c4c6f..390d2767 100644 --- a/templates/interfaces/tunnel/node.tag/local-ip/node.def +++ b/templates/interfaces/tunnel/node.tag/local-ip/node.def @@ -1,3 +1,4 @@ +priority: 385 type: ipv4 help: Local IP address for this tunnel [REQUIRED] @@ -5,7 +6,6 @@ syntax:expression: exec \ "/opt/vyatta/sbin/local_ip $VAR(@) || \ echo Warning! IP address $VAR(@) doesn\\'t exist on this system" -create:expression: "true" -update:expression: "false" ; \ - "Local IP can only be set at tunnel creation for $VAR(../@)" - +update: if [ "$VAR(../encapsulation/@)" != "gre-bridge" ]; then + sudo ip tunnel cha $VAR(../@) local $VAR(@) + fi diff --git a/templates/interfaces/tunnel/node.tag/multicast/node.def b/templates/interfaces/tunnel/node.tag/multicast/node.def index 9f675b0e..8f5e2ede 100644 --- a/templates/interfaces/tunnel/node.tag/multicast/node.def +++ b/templates/interfaces/tunnel/node.tag/multicast/node.def @@ -1,3 +1,4 @@ +priority: 385 type: txt help: Multicast operation over tunnel default: "disable" @@ -8,6 +9,10 @@ allowed: echo enable disable syntax:expression: $VAR(@) in "enable", "disable"; \ "Must be 'disable' or 'enable'" -create:expression: "true" -update:expression: "false" ; \ - "Multicast should be set at tunnel creation for $VAR(../@)" +update:if [ "$VAR(../encapsulation/@)" != "gre-bridge" ]; then + if [ "$VAR(@)" == "enable" ]; then + sudo ip link set $VAR(../@) multicast on allmulticast on + else + sudo ip link set $VAR(../@) multicast off allmulticast off + fi + fi diff --git a/templates/interfaces/tunnel/node.tag/remote-ip/node.def b/templates/interfaces/tunnel/node.tag/remote-ip/node.def index 30f4e4d4..85ee0285 100644 --- a/templates/interfaces/tunnel/node.tag/remote-ip/node.def +++ b/templates/interfaces/tunnel/node.tag/remote-ip/node.def @@ -1,6 +1,6 @@ +priority: 385 type: ipv4 help: Remote IP address for this tunnel [REQUIRED] -create:expression: "true" -update:expression: "false" ; \ - "Remote IP can only be set at tunnel creation for $VAR(../@)" - +update: if [ "$VAR(../encapsulation/@)" != "gre-bridge" ]; then + sudo ip tunnel cha $VAR(../@) remote $VAR(@) + fi -- cgit v1.2.3