summaryrefslogtreecommitdiff
path: root/templates/interfaces/pseudo-ethernet
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/pseudo-ethernet')
-rw-r--r--templates/interfaces/pseudo-ethernet/node.def6
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/mode/node.def2
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def2
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def6
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/mtu/node.def4
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.def6
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/mtu/node.def4
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif/node.def6
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/disable/node.def4
-rw-r--r--templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/mtu/node.def4
13 files changed, 28 insertions, 28 deletions
diff --git a/templates/interfaces/pseudo-ethernet/node.def b/templates/interfaces/pseudo-ethernet/node.def
index 00e54055..14fe64aa 100644
--- a/templates/interfaces/pseudo-ethernet/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.def
@@ -10,10 +10,10 @@ syntax:expression: pattern $VAR(@) "^peth[0-9]+$" \
commit:expression: $VAR(link) != ""
; "link device must be set for virtual ethernet $VAR(@)"
-create: ip link add $VAR(@) link $VAR(link/@) type macvlan mode $VAR(mode/@) || exit 1
+create: sudo ip link add $VAR(@) link $VAR(link/@) type macvlan mode $VAR(mode/@) || exit 1
if ! cli-shell-api exists interfaces ethernet $VAR(@) disable;
- then ip link set $VAR(@) up
+ then sudo ip link set $VAR(@) up
fi
/opt/vyatta/sbin/vyatta-link-detect $VAR(@) on
-delete: ip link delete dev $VAR(@) type macvlan
+delete: sudo ip link delete dev $VAR(@) type macvlan
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/disable/node.def b/templates/interfaces/pseudo-ethernet/node.tag/disable/node.def
index 91c60323..c4bfba77 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/disable/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/disable/node.def
@@ -5,12 +5,12 @@ create: vif=`/opt/vyatta/sbin/vyatta-interfaces.pl --vif=$VAR(../@) --show=all`
exit 1
fi
/etc/netplug/linkdown.d/dhclient $VAR(../@)
- if ! ip link set $VAR(../@) down 2>/dev/null; then
+ if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../@)
exit 1
fi
-delete: if ! ip link set $VAR(../@) up; then
+delete: if ! sudo ip link set $VAR(../@) up; then
echo "Error enabling dev $VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/mode/node.def b/templates/interfaces/pseudo-ethernet/node.tag/mode/node.def
index 1ab595b0..ed557760 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/mode/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/mode/node.def
@@ -10,4 +10,4 @@ val_help:vepa: Virtual Ethernet Port Aggregator reflective relay
val_help:bridge: Simple bridge between pseudo-devices
val_help:passthru: Promicious mode passthrough of underlying device
-update: ip link set dev $VAR(../@) type macvlan mode $VAR(@)
+update: sudo ip link set dev $VAR(../@) type macvlan mode $VAR(@)
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
index c4bc9577..0d338c1d 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def
@@ -9,4 +9,4 @@ delete: ETHERTYPE=`echo "$VAR(ethertype/@)"`
if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
[ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
- ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto $ETHTYPE id $VAR(@)
+ sudo ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto $ETHTYPE id $VAR(@)
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/disable/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/disable/node.def
index e9943645..12db6a98 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/disable/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/disable/node.def
@@ -1,11 +1,11 @@
help: Disable interface
update: /etc/netplug/linkdown.d/dhclient $VAR(../../@).$VAR(../@)
- if ! ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
+ if ! sudo ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../../@).$VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../../@).$VAR(../@)
exit 1
fi
-delete: if ! ip link set $VAR(../../@).$VAR(../@) up; then
+delete: if ! sudo ip link set $VAR(../../@).$VAR(../@) up; then
echo "Error enabling dev $VAR(../../@).$VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def
index 9e2d5a54..e88ff7e5 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def
@@ -15,7 +15,7 @@ update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces pseudo-etherne
ETHERTYPE=`echo "$VAR(@)"`
if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi
if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi
- ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1
- ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) || exit 1
- ip link set "$VAR(../../@).$VAR(../@)" up
+ sudo ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1
+ sudo ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) || exit 1
+ sudo ip link set "$VAR(../../@).$VAR(../@)" up
/opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@)" on
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/mtu/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/mtu/node.def
index d6151dcb..b3f3e7c7 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/mtu/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/mtu/node.def
@@ -4,6 +4,6 @@ help: Maximum Transmission Unit (MTU)
val_help: u32:68-9000; Maximum Transmission Unit (MTU)
syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000"
-update: ip link set $VAR(../../@).$VAR(../@) mtu $VAR(@)
+update: sudo ip link set $VAR(../../@).$VAR(../@) mtu $VAR(@)
delete: [ -d /sys/class/net/$VAR(../../@).$VAR(../@) ] || exit 0
- ip link set $VAR(../../@).$VAR(../@) mtu 1500
+ sudo ip link set $VAR(../../@).$VAR(../@) mtu 1500
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.def
index 5016dd5f..7dfb8a1c 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.def
@@ -5,9 +5,9 @@ help: QinQ TAG-C Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
val_help: u32:0-4094; VLAN ID
-create: ip link add link $VAR(../../@).$VAR(../@) name "$VAR(../../@).$VAR(../@).$VAR(@)" type vlan proto 802.1q id $VAR(@) || exit 1
- ip link set "$VAR(../../@).$VAR(../@).$VAR(@)" up
+create: sudo ip link add link $VAR(../../@).$VAR(../@) name "$VAR(../../@).$VAR(../@).$VAR(@)" type vlan proto 802.1q id $VAR(@) || exit 1
+ sudo ip link set "$VAR(../../@).$VAR(../@).$VAR(@)" up
/opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@).$VAR(@)" on
delete: [ -d /sys/class/net/$VAR(../../@).$VAR(../@).$VAR(@) ] || exit 0
- ip link delete dev "$VAR(../../@).$VAR(../@).$VAR(@)" type vlan proto 802.1q id $VAR(@)
+ sudo ip link delete dev "$VAR(../../@).$VAR(../@).$VAR(@)" type vlan proto 802.1q id $VAR(@)
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/disable/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/disable/node.def
index 31c5a9b2..7069e9c9 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/disable/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/disable/node.def
@@ -1,11 +1,11 @@
help: Disable interface
update: /etc/netplug/linkdown.d/dhclient $VAR(../../../@).$VAR(../../@).$VAR(../@)
- if ! ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) down 2>/dev/null; then
+ if ! sudo ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../../../@).$VAR(../../@).$VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../../../@).$VAR(../../@).$VAR(../@)
exit 1
fi
-delete: if ! ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) up; then
+delete: if ! sudo ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) up; then
echo "Error enabling dev $VAR(../../../@).$VAR(../../@).$VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/mtu/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/mtu/node.def
index ca8795ee..264c429b 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/mtu/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/mtu/node.def
@@ -4,6 +4,6 @@ help: Maximum Transmission Unit (MTU)
val_help: u32:68-9000; Maximum Transmission Unit (MTU)
syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000"
-update: ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) mtu $VAR(@)
+update: sudo ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) mtu $VAR(@)
delete: [ -d /sys/class/net/$VAR(../../../@).$VAR(../../@).$VAR(../@) ] || exit 0
- ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) mtu 1500
+ sudo ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) mtu 1500
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.def
index 2c73ca16..d66c2fbe 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.def
@@ -5,9 +5,9 @@ help: Virtual Local Area Network (VLAN) ID
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094"
val_help: u32:0-4094; VLAN ID
-create: ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1
- ip link set "$VAR(../@).$VAR(@)" up
+create: sudo ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1
+ sudo ip link set "$VAR(../@).$VAR(@)" up
/opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on
delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0
- ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
+ sudo ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@)
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/disable/node.def
index e9943645..12db6a98 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/disable/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/disable/node.def
@@ -1,11 +1,11 @@
help: Disable interface
update: /etc/netplug/linkdown.d/dhclient $VAR(../../@).$VAR(../@)
- if ! ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
+ if ! sudo ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
echo "Error disabling dev $VAR(../../@).$VAR(../@)"
/etc/netplug/linkup.d/dhclient $VAR(../../@).$VAR(../@)
exit 1
fi
-delete: if ! ip link set $VAR(../../@).$VAR(../@) up; then
+delete: if ! sudo ip link set $VAR(../../@).$VAR(../@) up; then
echo "Error enabling dev $VAR(../../@).$VAR(../@)"
exit 1
fi
diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/mtu/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/mtu/node.def
index d6151dcb..b3f3e7c7 100644
--- a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/mtu/node.def
+++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/mtu/node.def
@@ -4,6 +4,6 @@ help: Maximum Transmission Unit (MTU)
val_help: u32:68-9000; Maximum Transmission Unit (MTU)
syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000"
-update: ip link set $VAR(../../@).$VAR(../@) mtu $VAR(@)
+update: sudo ip link set $VAR(../../@).$VAR(../@) mtu $VAR(@)
delete: [ -d /sys/class/net/$VAR(../../@).$VAR(../@) ] || exit 0
- ip link set $VAR(../../@).$VAR(../@) mtu 1500
+ sudo ip link set $VAR(../../@).$VAR(../@) mtu 1500