summaryrefslogtreecommitdiff
path: root/templates/interfaces/tunnel/node.def
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/tunnel/node.def')
-rw-r--r--templates/interfaces/tunnel/node.def7
1 files changed, 5 insertions, 2 deletions
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def
index f7ffd746..795168f6 100644
--- a/templates/interfaces/tunnel/node.def
+++ b/templates/interfaces/tunnel/node.def
@@ -40,6 +40,9 @@ create:
echo "interfaces tunnel $VAR(@): Tunnel encapsulation type must be gre-bridge if a bridge group is defined";
exit 1;
fi
+ if [ -z "$VAR(./parameters/ip/tos/@)" ]; then
+ TOS="tos inherit"
+ fi
if [ -z "$VAR(./parameters/ip/ttl/@)" ]; then
TTL="ttl 255"
fi
@@ -47,9 +50,9 @@ create:
KEY="key $VAR(./parameters/ip/key/@)";
fi
if [ "$VAR(./encapsulation/@)" == "gre" ] && [ -z $VAR(./remote-ip/) ]; then
- ip tunnel add $VAR(@) local $VAR(./local-ip/@) mode gre $KEY $TTL
+ ip tunnel add $VAR(@) local $VAR(./local-ip/@) mode gre $KEY $TTL $TOS
else
- ip tunnel add $VAR(@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL
+ ip tunnel add $VAR(@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL $TOS
fi
if [ -z "`ip tun sh | grep $VAR(@)`" ]; then
echo interfaces tunnel $VAR(@): error creating tunnel interface