diff options
4 files changed, 17 insertions, 17 deletions
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def index bd2c4255..9c946091 100644 --- a/templates/interfaces/tunnel/node.def +++ b/templates/interfaces/tunnel/node.def @@ -61,15 +61,15 @@ create: KEY="key $VAR(./parameters/ip/key/@)" fi if [ "$VAR(./encapsulation/@)" == "gre" ] && [ -z $VAR(./remote-ip/) ]; then - ip tunnel add $VAR(@) local $LIP mode gre $KEY $TTL $TOS + sudo ip tunnel add $VAR(@) local $LIP mode gre $KEY $TTL $TOS elif [ "$VAR(./encapsulation/@)" == "sit" ] && [ -n "$VAR(./6rd-prefix/@)" ]; then if [ -n "$VAR(./6rd-relay-prefix/@)" ]; then RP="6rd-relay_prefix $VAR(./6rd-relay-prefix/@)" fi - ip tunnel add $VAR(@) remote $VAR(./remote-ip/@) mode sit - ip tunnel 6rd dev $VAR(@) 6rd-prefix $VAR(./6rd-prefix/@) $RP + sudo ip tunnel add $VAR(@) remote $VAR(./remote-ip/@) mode sit + sudo ip tunnel 6rd dev $VAR(@) 6rd-prefix $VAR(./6rd-prefix/@) $RP else - ip tunnel add $VAR(@) local $LIP remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL $TOS + sudo ip tunnel add $VAR(@) local $LIP remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL $TOS fi if [ -z "`ip tunnel show | grep $VAR(@)`" ]; then echo interfaces tunnel $VAR(@): error creating tunnel interface @@ -77,7 +77,7 @@ create: fi ;; "gre-bridge") - ip link add $VAR(@) type gretap local $LIP remote $VAR(./remote-ip/@) || + sudo ip link add $VAR(@) type gretap local $LIP remote $VAR(./remote-ip/@) || echo "interfaces tunnel $VAR(@): error creating tunnel interface" ;; "ipip6" | "ip6ip6") @@ -85,23 +85,23 @@ create: echo "interfaces tunnel $VAR(@): error creating tunnel interface" ;; esac - ip link set $VAR(@) $MC up || + sudo ip link set $VAR(@) $MC up || echo "interfaces tunnel $VAR(@): error setting tunnel interface active" delete: /opt/vyatta/sbin/vyos-update-nhrp.pl --checkref --tun $VAR(@) - ip link set $VAR(@) down + sudo ip link set $VAR(@) down case "$VAR(./encapsulation/@)" in "gre" | "ipip" | "sit") if [ -z $VAR(./remote-ip/) ]; then - ip tunnel del $VAR(@) mode gre + sudo ip tunnel del $VAR(@) mode gre else - ip tunnel del $VAR(@) mode $VAR(./encapsulation/@) + sudo ip tunnel del $VAR(@) mode $VAR(./encapsulation/@) fi;; "gre-bridge") - ip link delete $VAR(@) ;; + sudo ip link delete $VAR(@) ;; "ipip6" | "ip6ip6") - ip -6 tunnel del $VAR(@) mode $VAR(./encapsulation/@);; + sudo ip -6 tunnel del $VAR(@) mode $VAR(./encapsulation/@);; esac diff --git a/templates/interfaces/tunnel/node.tag/dhcp-interface/node.def b/templates/interfaces/tunnel/node.tag/dhcp-interface/node.def index de0450d7..f9d81b20 100644 --- a/templates/interfaces/tunnel/node.tag/dhcp-interface/node.def +++ b/templates/interfaces/tunnel/node.tag/dhcp-interface/node.def @@ -7,10 +7,10 @@ allowed: create: sudo /opt/vyatta/sbin/vyatta-update-tunnel.pl --interface=$VAR(@) --tunnel=$VAR(../@) --option=create LIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=local) - ip tunnel cha $VAR(../@) local $LIP + sudo ip tunnel cha $VAR(../@) local $LIP update: sudo /opt/vyatta/sbin/vyatta-update-tunnel.pl --interface=$VAR(@) --tunnel=$VAR(../@) --option=create LIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=local) - ip tunnel cha $VAR(../@) local $LIP + sudo ip tunnel cha $VAR(../@) local $LIP delete: sudo /opt/vyatta/sbin/vyatta-update-tunnel.pl --interface=$VAR(@) --tunnel=$VAR(../@) --option=delete diff --git a/templates/interfaces/tunnel/node.tag/disable/node.def b/templates/interfaces/tunnel/node.tag/disable/node.def index 26199646..8c580c95 100644 --- a/templates/interfaces/tunnel/node.tag/disable/node.def +++ b/templates/interfaces/tunnel/node.tag/disable/node.def @@ -1,4 +1,4 @@ help: Disable interface -update: ip link set $VAR(../@) down +update: sudo ip link set $VAR(../@) down -delete: ip link set $VAR(../@) up +delete: sudo ip link set $VAR(../@) up diff --git a/templates/interfaces/tunnel/node.tag/mtu/node.def b/templates/interfaces/tunnel/node.tag/mtu/node.def index 9161653a..6753bea7 100644 --- a/templates/interfaces/tunnel/node.tag/mtu/node.def +++ b/templates/interfaces/tunnel/node.tag/mtu/node.def @@ -4,5 +4,5 @@ help: Maximum Transmission Unit (MTU) syntax:expression: $VAR(@) >= 64 && $VAR(@) <= 8024; "Must be between 64-8024" val_help: u32:64-8024; Maximum Transmission Unit (MTU) -update: ip link set $VAR(../@) mtu $VAR(@) -delete: ip link set $VAR(../@) mtu 1476 +update: sudo ip link set $VAR(../@) mtu $VAR(@) +delete: sudo ip link set $VAR(../@) mtu 1476 |