diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-18 16:43:13 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-18 16:43:13 -0800 |
commit | e590c623c8ecec1846fe6977a4234b18d8d26b9f (patch) | |
tree | 6c82afeaf1adb3c93c91101cc447bcb71d63350e /templates | |
parent | 048b51be982dce748fdefd1f4ba9f4df5816ba80 (diff) | |
download | vyatta-cfg-quagga-e590c623c8ecec1846fe6977a4234b18d8d26b9f.tar.gz vyatta-cfg-quagga-e590c623c8ecec1846fe6977a4234b18d8d26b9f.zip |
When removing tunnel, remove encapsulation device
Bug 4608
Diffstat (limited to 'templates')
-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 + + |