From 508ef2c225fd62a2a823489a0c112a14fae38117 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 2 Feb 2015 08:01:00 +0100 Subject: Bug #467, tos inherit not turned on by default on tunnels (IPIP, GRE) --- templates/interfaces/tunnel/node.def | 7 +++++-- 1 file 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 -- cgit v1.2.3