diff options
-rw-r--r-- | templates/interfaces/tunnel/node.def | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def index e86ef9a0..912e4c13 100644 --- a/templates/interfaces/tunnel/node.def +++ b/templates/interfaces/tunnel/node.def @@ -33,9 +33,16 @@ create:if [ -n "$VAR(./key/@)" ]; then ip link set $VAR(@) $MC up || echo "interfaces tunnel $VAR(@): error setting tunnel interface active" -delete:if [ "$VAR(./encapsulation/@)" == "gre-bridge" ]; then +delete: ip link set $VAR(@) down + if [ "$VAR(./encapsulation/@)" == "gre-bridge" ]; then ip link delete $VAR(@) - else - ip link set $VAR(@) down - ip tunnel del $VAR(@) - fi + else + ip tunnel del $VAR(@) mode $VAR(./encapsulation/@) + case "$VAR(./encapsulation/@)" in + ipip) ip link del tunl0 ;; + gre) ip link del gre0 ;; + sit) ip link del sit0 ;; + esac + fi + + |